Failed to import module file, this is most likely NOT a problem

596 views
Skip to first unread message

ryan

unread,
Oct 22, 2013, 8:20:17 AM10/22/13
to salt-...@googlegroups.com
HI ALL

My minion and master running a bdist_esky build. version:0.17.0.
When I running below on master:

[root@salt-master]#./salt '10.10.30.186' state.highstate
[root@salt-master]#

FAILED!!

[root@salt-master]./salt '10.10.30.186' grains.items

ok...

[root@salt-minion]#tail /var/log/salt/minion
[DEBUG   ] Local cache dir: '/var/cache/salt/minion/files/base/_outputters'
[DEBUG   ] MinionEvent PUB socket URI: ipc:///var/run/salt/minion/minion_event_53e5f585928644e04561750cae669400_pub.ipc
[DEBUG   ] MinionEvent PULL socket URI: ipc:///var/run/salt/minion/minion_event_53e5f585928644e04561750cae669400_pull.ipc
[DEBUG   ] Refreshing modules...
[WARNING ] The minion function caused an exception: Traceback (most recent call last):
  File "salt/minion.py", line 659, in _thread_return
  File "salt/modules/state.py", line 257, in highstate
  File "salt/state.py", line 2304, in call_highstate
  File "salt/state.py", line 1927, in load_dynamic
  File "salt/state.py", line 553, in module_refresh
  File "site.py", line 548, in <module>
  File "site.py", line 526, in main
  File "site.py", line 94, in abs__file__
  File "email/__init__.py", line 79, in __getattr__
ImportError: No module named audio

[INFO    ] Returning information for job: 20131022195433689897
[DEBUG   ] Reading configuration from /etc/salt/minion
[DEBUG   ] loading grain in ['/var/cache/salt/minion/extmods/grains', '/usr/local/services/salt-minion/salt-0.17.1.linux-x86_64/salt-0.17.1-py2.7.egg/salt/grains']
[DEBUG   ] Skipping /var/cache/salt/minion/extmods/grains, it is not a directory
[DEBUG   ] loading module in ['/var/cache/salt/minion/extmods/modules', '/usr/local/services/salt-minion/salt-0.17.1.linux-x86_64/salt-0.17.1-py2.7.egg/salt/modules']
[DEBUG   ] Skipping /var/cache/salt/minion/extmods/modules, it is not a directory
[DEBUG   ] Failed to import module file, this is most likely NOT a problem:
Traceback (most recent call last):
  File "salt/loader.py", line 641, in gen_functions
  File "salt/modules/file.py", line 18, in <module>
ImportError: No module named fileinput
[DEBUG   ] Failed to import module win_file, this is most likely NOT a problem:
Traceback (most recent call last):
  File "salt/loader.py", line 641, in gen_functions
  File "salt/modules/win_file.py", line 32, in <module>
  File "salt/modules/file.py", line 18, in <module>
ImportError: No module named fileinput
[DEBUG   ] Loaded localemod as virtual locale
[DEBUG   ] Loaded groupadd as virtual group
[DEBUG   ] Loaded rh_service as virtual service
[DEBUG   ] Loaded parted as virtual partition
[DEBUG   ] Loaded linux_sysctl as virtual sysctl
[DEBUG   ] Loaded mdadm as virtual raid
[DEBUG   ] Loaded linux_acl as virtual acl
[DEBUG   ] Loaded sysmod as virtual sys
[DEBUG   ] Loaded rpm as virtual lowpkg
[DEBUG   ] Loaded useradd as virtual user
[DEBUG   ] Loaded grub_legacy as virtual grub
[DEBUG   ] Loaded rh_ip as virtual ip
[DEBUG   ] Loaded cmdmod as virtual cmd
[DEBUG   ] Loaded virtualenv_mod as virtual virtualenv
[DEBUG   ] Loaded linux_lvm as virtual lvm
[DEBUG   ] Loaded djangomod as virtual django
[DEBUG   ] loading returner in ['/var/cache/salt/minion/extmods/returners', '/usr/local/services/salt-minion/salt-0.17.1.linux-x86_64/salt-0.17.1-py2.7.egg/salt/returners']
[DEBUG   ] Skipping /var/cache/salt/minion/extmods/returners, it is not a directory
[DEBUG   ] Loaded couchdb_return as virtual couchdb
[DEBUG   ] Loaded carbon_return as virtual carbon

[root@salt-minion]# /usr/local/services/python27/bin/python2.7
Python 2.7.5 (default, Oct 18 2013, 12:04:23) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import fileinput
>>> 
>>> import audio
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named audio
>>> 


My bdist_esky build step:
[root@salt-build]#/usr/local/services/python27/bin/python2.7 setup.py bdist
[root@salt-build]#/usr/local/services/python27/bin/python2.7 setup.py bdist_esky
Everything is good,no error. Even warning info about patchelf fixed.
[root@salt-build]#ls dist/
salt-0.17.1.linux-x86_64.zip

pkg content info:
-rwxr-xr-x 1 root root   14688 19:46 fcntl.so
-rwxr-xr-x 1 root root   19440 19:46 library.zip
-rwxr-xr-x 1 root root 1770224 19:46 salt
drwxr-xr-x 8 root root    4096 19:48 salt-0.17.1.linux-x86_64
-rwxr-xr-x 1 root root 1770224 19:46 salt-call
-rwxr-xr-x 1 root root 1770224 19:46 salt-cp
-rwxr-xr-x 1 root root 1770224 19:46 salt-key
-rwxr-xr-x 1 root root 1770224 19:46 salt-master
-rwxr-xr-x 1 root root 1770224 19:46 salt-minion
-rwxr-xr-x 1 root root 1770224 19:46 salt-run
-rwxr-xr-x 1 root root 1770224 19:46 salt-ssh
-rwxr-xr-x 1 root root 1770224 19:46 salt-syndic


I don't know where's problem....

Thanks very much!

Colton Myers

unread,
Oct 22, 2013, 12:30:41 PM10/22/13
to salt-...@googlegroups.com
Can you gist your state files?

--
Colton Myers


--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

ryan

unread,
Oct 22, 2013, 10:13:03 PM10/22/13
to salt-...@googlegroups.com
Thank you reply.

It's very simple:
top.sls
base:
    '*':
        - webserver
webserver/init.sls
/var/www/html/index.html:
    file:
        - managed
        - source: salt://webserver/index.html
tree /srv/salt
/srv/
└── salt
    ├── top.sls
    └── webserver
        ├── index.html
        └── init.sls


If minion used python build running, it works fine.
[root@salt-minion bin]# pwd
/usr/local/services/python27/bin
[root@salt-minion bin]# ls -ltrh salt*
-rwxr-xr-x 1 root root 191 10月 22 23:40 salt-syndic
-rwxr-xr-x 1 root root 160 10月 22 23:40 salt-ssh
-rwxr-xr-x 1 root root 167 10月 22 23:40 salt-run
-rwxr-xr-x 1 root root 373 10月 22 23:40 salt-minion
-rwxr-xr-x 1 root root 160 10月 22 23:40 salt-master
-rwxr-xr-x 1 root root 177 10月 22 23:40 salt-key
-rwxr-xr-x 1 root root 203 10月 22 23:40 salt-cp
-rwxr-xr-x 1 root root 226 10月 22 23:40 salt-call
-rwxr-xr-x 1 root root 207 10月 22 23:40 salt
[root@salt-minion bin]#cat salt-minion 
#!/usr/local/services/python27/bin/python2.7
'''
This script is used to kick off a salt minion daemon
'''

from salt.scripts import salt_minion
from multiprocessing import freeze_support


if __name__ == '__main__':
    # This handles the bootstrapping code that is included with frozen
    # scripts. It is a no-op on unfrozen code.
    freeze_support()
    salt_minion()



[root@salt-master]#./salt '10.10.30.186' state.highstate -v
Executing job with jid 20131022234936697332
-------------------------------------------

----------
    State: - file
    Name:      /var/www/html/index.html
    Function:  managed
        Result:    True
        Comment:   File /var/www/html/index.html is in the correct state
        Changes:   

Summary
------------
Succeeded: 1
Failed:    0
------------
Total:     1


在 2013年10月23日星期三UTC+8上午12时30分41秒,basepi写道:

Colton Myers

unread,
Oct 23, 2013, 1:39:42 PM10/23/13
to salt-...@googlegroups.com
So just the esky build fails?  I haven't messed with that, I'll have to look into it a little.

--
Colton Myers

David Boucha

unread,
Oct 23, 2013, 1:44:46 PM10/23/13
to salt users list
Hi Ryan,

if you look in the setup.py file in the develop branch there's a python list named FREEZER_INCLUDES

Several items have been added which haven't been backported to 0.17.1

If any needed modules are not being frozen properly, you can add that module to FREEZER_INCLUDES to ensure they are frozen and included in your esky build.

python setup.py sdist
python setup.py bdist
python setup.py bdist_esky




On Tue, Oct 22, 2013 at 6:20 AM, ryan <duckdr...@gmail.com> wrote:

--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Dave Boucha  |  Sr. Engineer


5272 South College Drive, Suite 301 | Murray, UT 84123

office 801-305-3563
da...@saltstack.com | www.saltstack.com

ryan

unread,
Oct 24, 2013, 12:23:05 AM10/24/13
to salt-...@googlegroups.com
Thanks very much! David Boucha

According to your suggestions, edit setup.py and add module which appear in debug log
# vim setup.py
FREEZER_INCLUDES = [
    'zmq.core.*',
    'zmq.utils.*',
    'ast',
    'difflib',
    'distutils',
    'distutils.version',
    'numbers',
    'json',
    'fileinput',
    'email.mime.*',
]
# python setup.py sdist
# python setup.py bdist
# python setup.py bdist_esky

Then deploy...,the debug info
ImportError: No module named fileinput
ImportError: No module named audio
....
has gone!

[root@salt-master]# ./salt '10.10.30.186' state.highstate -v
Executing job with jid 20131024120317665881
-------------------------------------------

----------
    State: - file
    Name:      /var/www/html/index.html
    Function:  managed
        Result:    True
        Comment:   File /var/www/html/index.html is in the correct state
        Changes:   

Summary
------------
Succeeded: 1
Failed:    0
------------
Total:     1

It works!

Thanks everyone again!!




在 2013年10月24日星期四UTC+8上午1时44分46秒,David Boucha写道:
Reply all
Reply to author
Forward
0 new messages