graphite icon indicating copy to clipboard operation
graphite copied to clipboard

"ImportError: No module named fields" when install

Open iiro opened this issue 9 years ago • 13 comments

Hi,

suddenly the cookbook started giving this kind of error when running:

     * execute[python manage.py syncdb --noinput] action run

       ================================================================================
       Error executing action `run` on resource 'execute[python manage.py syncdb --noinput]'
       ================================================================================

       Mixlib::ShellOut::ShellCommandFailed
       ------------------------------------
       Expected process to exit with [0], but received '1'
   ---- Begin output of python manage.py syncdb --noinput ----
       STDOUT: 
       STDERR: ImportError: No module named fields
       ---- End output of python manage.py syncdb --noinput ----
       Ran python manage.py syncdb --noinput returned 1

I tried to run the command by hand and I can get:

/opt/graphite/webapp/graphite# python manage.py syncdb --noinput ImportError: No module named fields

Cookbook version is 1.0.2 and OS is Ubuntu 14.04.2 LTS.

Anyone else experiencing this?

iiro avatar Jun 16 '15 00:06 iiro

I have an older setup which was previously installed fine; just did a quick pip- check; the old setup has django-tagging (0.3.6) but the new - broken one - has django-tagging (0.4)...

https://pypi.python.org/pypi/django-tagging - django-tagging 0.4 requires newer django and we still have 1.5.5 on the setup...

iiro avatar Jun 16 '15 00:06 iiro

We just ran into the same issue. CentOS 6.6, cookbook version 1.0.2.

tmonk42 avatar Jun 16 '15 17:06 tmonk42

Hi,

Yep same issue using Ubuntu 14.04, cookbook version 1.0.2

================================================================================
    Error executing action `run` on resource 'execute[python manage.py syncdb --noinput]'
    ================================================================================

    Mixlib::ShellOut::ShellCommandFailed
    ------------------------------------
    Expected process to exit with [0], but received '1'
    ---- Begin output of python manage.py syncdb --noinput ----
    STDOUT: 
    STDERR: ImportError: No module named fields
    ---- End output of python manage.py syncdb --noinput ----
    Ran python manage.py syncdb --noinput returned 1

    Cookbook Trace:
    ---------------
    /home/vagrant/chef-solo/cookbooks-2/lxc/libraries/monkey.rb:20:in `monkey_shell_out!'

    Resource Declaration:
    ---------------------
    # In /home/vagrant/chef-solo/cookbooks-3/graphite-config/recipes/single_node.rb

     76: execute "python manage.py syncdb --noinput" do
     77:   user node['graphite']['user']
     78:   group node['graphite']['group']
     79:   cwd "#{base_dir}/webapp/graphite"
     80:   creates "#{storage_dir}/graphite.db"
     81:   notifies :run, "python[set admin password]"
     82: end
     83: 
   Compiled Resource:
    ------------------
    # Declared in /home/vagrant/chef-solo/cookbooks-3/graphite-config/recipes/single_node.rb:76:in `from_file'

    execute("python manage.py syncdb --noinput") do
      action "run"
      retries 0
      retry_delay 2
      default_guard_interpreter :execute
      command "python manage.py syncdb --noinput"
      backup 5
      creates "/opt/graphite/storage/graphite.db"
      cwd "/opt/graphite/webapp/graphite"
      group "graphite"
      returns 0
      user "graphite"
      declared_type :execute
      cookbook_name :"graphite-config"
      recipe_name "single_node"
    end

rudijs avatar Jun 18 '15 10:06 rudijs

I got around this temporarily reopening the resource in the recipe for my wrapper cookbook (simplified below):

r = resources(python_pip: 'django-tagging')
r.action :install
r.version "0.3.6"

and it's able to complete the syncdb operation. Hopefully someone finds it a helpful starting point until the issue is resolved upstream.

tjabri avatar Jul 14 '15 17:07 tjabri

Temporary solution in Chef,

python_pip "django-tagging" do
  version "0.3.6"
end

Or manually,

pip install django-tagging==0.3.6

bobhlo avatar Jul 23 '15 17:07 bobhlo

This is an issue here as well, on Ubuntu 14.04.

@bobhlo: The chef solution above didn't work for me but the manual one did. Thanks!

rambler avatar Aug 28 '15 18:08 rambler

@rambler just put include_recipe 'python::pip'

before

python_pip "django-tagging" do
    version "0.3.6"
end

mblankleder avatar Sep 11 '15 14:09 mblankleder

@rambler, may need to remove newer version before applying old one

python_pip "django-tagging" do
  action :remove
end
python_pip "django-tagging" do
  version "0.3.6"
end

bobhlo avatar Sep 14 '15 19:09 bobhlo

+1 - any chance of this being fixed?

ianbamforth avatar Jan 08 '16 10:01 ianbamforth

Yes. I have also encountered and verified the suggested solution. We will try and get this fixed and release soon.

slyness avatar Jan 27 '16 19:01 slyness

Friendly reminder that over 4 months have passed.

jblaine avatar Jun 14 '16 19:06 jblaine

@bobhlo - "pip install django-tagging==0.3.6"

Thank you for the manual fix. It worked for me.

rbrasga avatar Oct 10 '16 22:10 rbrasga

Marking stale due to inactivity. Remove stale label or comment or this will be closed in 7 days. Alternatively drop by the #sous-chefs channel on the Chef Community Slack and we'll be happy to help! Thanks, Sous-Chefs.

github-actions[bot] avatar Sep 30 '20 00:09 github-actions[bot]