Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"ImportError: No module named fields" when install #227

Open
iiro opened this issue Jun 16, 2015 · 13 comments
Open

"ImportError: No module named fields" when install #227

iiro opened this issue Jun 16, 2015 · 13 comments

Comments

@iiro
Copy link

iiro commented Jun 16, 2015

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
Copy link
Author

iiro commented Jun 16, 2015

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...

@tmonk42
Copy link

tmonk42 commented Jun 16, 2015

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

@rudijs
Copy link

rudijs commented Jun 18, 2015

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

@tjabri
Copy link

tjabri commented Jul 14, 2015

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.

@bobhlo
Copy link

bobhlo commented Jul 23, 2015

Temporary solution in Chef,

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

Or manually,

pip install django-tagging==0.3.6

@rambler
Copy link

rambler commented Aug 28, 2015

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!

@mblankleder
Copy link

@rambler just put
include_recipe 'python::pip'

before

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

@bobhlo
Copy link

bobhlo commented Sep 14, 2015

@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

@ianbamforth
Copy link

+1 - any chance of this being fixed?

@slyness
Copy link

slyness commented Jan 27, 2016

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

@jblaine
Copy link
Contributor

jblaine commented Jun 14, 2016

Friendly reminder that over 4 months have passed.

@rbrasga
Copy link

rbrasga commented Oct 10, 2016

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

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

@damacus damacus removed bug labels Oct 12, 2017
@github-actions
Copy link

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 github-actions bot added the Stale label Sep 30, 2020
@xorimabot xorimabot removed the Stale label Sep 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests