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

salt-minion miss markupsafe #18905

Closed
calve opened this issue Dec 11, 2014 · 8 comments
Closed

salt-minion miss markupsafe #18905

calve opened this issue Dec 11, 2014 · 8 comments

Comments

@calve
Copy link
Contributor

calve commented Dec 11, 2014

Hi

I have one minion that suddently fails to respond.

$ salt-minion --versions
Traceback (most recent call last):
  File "/usr/bin/salt-minion", line 6, in <module>
    from salt.scripts import salt_minion
  File "/usr/lib/python2.7/dist-packages/salt/__init__.py", line 44, in <module>
    from salt.utils import migrations
  File "/usr/lib/python2.7/dist-packages/salt/utils/__init__.py", line 102, in <module>
    import salt.payload
  File "/usr/lib/python2.7/dist-packages/salt/payload.py", line 14, in <module>
    import salt.crypt
  File "/usr/lib/python2.7/dist-packages/salt/crypt.py", line 32, in <module>
    import salt.minion
  File "/usr/lib/python2.7/dist-packages/salt/minion.py", line 60, in <module>
    import salt.client
  File "/usr/lib/python2.7/dist-packages/salt/client/__init__.py", line 38, in <module>
    import salt.utils.event
  File "/usr/lib/python2.7/dist-packages/salt/utils/event.py", line 74, in <module>
    import salt.state
  File "/usr/lib/python2.7/dist-packages/salt/state.py", line 29, in <module>
    import salt.pillar
  File "/usr/lib/python2.7/dist-packages/salt/pillar/__init__.py", line 14, in <module>
    import salt.fileclient
  File "/usr/lib/python2.7/dist-packages/salt/fileclient.py", line 26, in <module>
    import salt.utils.templates
  File "/usr/lib/python2.7/dist-packages/salt/utils/templates.py", line 18, in <module>
    import jinja2
  File "/usr/lib/python2.7/dist-packages/jinja2/__init__.py", line 33, in <module>
    from jinja2.environment import Environment, Template
  File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 13, in <module>
    from jinja2 import nodes
  File "/usr/lib/python2.7/dist-packages/jinja2/nodes.py", line 18, in <module>
    from jinja2.utils import Markup
  File "/usr/lib/python2.7/dist-packages/jinja2/utils.py", line 520, in <module>
    from markupsafe import Markup, escape, soft_unicode
ImportError: No module named markupsafe

So I purged and reinstalled python-jinja2 and salt-minion, but it is not helping

$ sudo apt-get purge python-jinja2
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  dctrl-tools libpgm-5.1-0 libzmq3 python-crypto python-m2crypto python-mako
  python-msgpack python-zmq
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  python-jinja2* salt-common* salt-minion*
0 upgraded, 0 newly installed, 3 to remove and 4 not upgraded.
After this operation, 9,702 kB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 113029 files and directories currently installed.)
Removing salt-minion (2014.7.0+ds-2trusty1) ...
Purging configuration files for salt-minion (2014.7.0+ds-2trusty1) ...
dpkg: warning: while removing salt-minion, directory '/etc/salt' not empty so not removed
Removing salt-common (2014.7.0+ds-2trusty1) ...
Purging configuration files for salt-common (2014.7.0+ds-2trusty1) ...
Removing python-jinja2 (2.7.2-2) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...

$ sudo apt-get install salt-minion
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  python-jinja2 salt-common
Suggested packages:
  python-jinja2-doc salt-doc python-augeas
The following NEW packages will be installed:
  python-jinja2 salt-common salt-minion
0 upgraded, 3 newly installed, 0 to remove and 4 not upgraded.
Need to get 0 B/2,051 kB of archives.
After this operation, 9,702 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Selecting previously unselected package python-jinja2.
(Reading database ... 112175 files and directories currently installed.)
Preparing to unpack .../python-jinja2_2.7.2-2_all.deb ...
Unpacking python-jinja2 (2.7.2-2) ...
Selecting previously unselected package salt-common.
Preparing to unpack .../salt-common_2014.7.0+ds-2trusty1_all.deb ...
Unpacking salt-common (2014.7.0+ds-2trusty1) ...
Selecting previously unselected package salt-minion.
Preparing to unpack .../salt-minion_2014.7.0+ds-2trusty1_all.deb ...
Unpacking salt-minion (2014.7.0+ds-2trusty1) ...
Processing triggers for ufw (0.34~rc-0ubuntu2) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Processing triggers for ureadahead (0.100.0-16) ...
Setting up python-jinja2 (2.7.2-2) ...
Setting up salt-common (2014.7.0+ds-2trusty1) ...
Processing triggers for ufw (0.34~rc-0ubuntu2) ...
Setting up salt-minion (2014.7.0+ds-2trusty1) ...
salt-minion start/running, process 21816
Processing triggers for ureadahead (0.100.0-16) ...

$ salt-minion --versions
Traceback (most recent call last):
  File "/usr/bin/salt-minion", line 6, in <module>
    from salt.scripts import salt_minion
  File "/usr/lib/python2.7/dist-packages/salt/__init__.py", line 44, in <module>
    from salt.utils import migrations
  File "/usr/lib/python2.7/dist-packages/salt/utils/__init__.py", line 102, in <module>
    import salt.payload
  File "/usr/lib/python2.7/dist-packages/salt/payload.py", line 14, in <module>
    import salt.crypt
  File "/usr/lib/python2.7/dist-packages/salt/crypt.py", line 32, in <module>
    import salt.minion
  File "/usr/lib/python2.7/dist-packages/salt/minion.py", line 60, in <module>
    import salt.client
  File "/usr/lib/python2.7/dist-packages/salt/client/__init__.py", line 38, in <module>
    import salt.utils.event
  File "/usr/lib/python2.7/dist-packages/salt/utils/event.py", line 74, in <module>
    import salt.state
  File "/usr/lib/python2.7/dist-packages/salt/state.py", line 29, in <module>
    import salt.pillar
  File "/usr/lib/python2.7/dist-packages/salt/pillar/__init__.py", line 14, in <module>
    import salt.fileclient
  File "/usr/lib/python2.7/dist-packages/salt/fileclient.py", line 26, in <module>
    import salt.utils.templates
  File "/usr/lib/python2.7/dist-packages/salt/utils/templates.py", line 18, in <module>
    import jinja2
  File "/usr/lib/python2.7/dist-packages/jinja2/__init__.py", line 33, in <module>
    from jinja2.environment import Environment, Template
  File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 13, in <module>
    from jinja2 import nodes
  File "/usr/lib/python2.7/dist-packages/jinja2/nodes.py", line 18, in <module>
    from jinja2.utils import Markup
  File "/usr/lib/python2.7/dist-packages/jinja2/utils.py", line 520, in <module>
    from markupsafe import Markup, escape, soft_unicode
ImportError: No module named markupsafe

Any idea ? I have the same config (Ubuntu 14.04) on some other minion and everything works as expected

@calve
Copy link
Contributor Author

calve commented Dec 11, 2014

Hi again,
it appears I had to reinstall markupsafe and msgpack as well (apt-get --reinstall install python-markupsafe python-msgpack) and now I have what I want :

$  salt-minion --version
salt-minion 2014.7.0 (Helium)

@calve calve closed this as completed Dec 11, 2014
@rallytime
Copy link
Contributor

Interesting. I haven't seen that particular error, but yes, it looks like something went amiss in the install/upgrade. I'm glad you figured it out!

@calve
Copy link
Contributor Author

calve commented Dec 11, 2014

Weirdest part is I did not run an explicit upgrade.
Maybe this is an Ubuntu issue.

Le jeudi 11 décembre 2014, 06:10:54 Nicole Thomas a écrit :

Interesting. I haven't seen that particular error, but yes, it looks like
something went amiss in the install/upgrade. I'm glad you figured it out!


Reply to this email directly or view it on GitHub:
#18905 (comment)

@wwentland
Copy link
Contributor

Well, if we wanted to attempt to track this down we would have to see your /var/log/apt/history file.

@calve
Copy link
Contributor Author

calve commented Dec 11, 2014

Here are what I think is the relevant part.
It looks like an install failed a few days ago. I think I tried to upgrade to
2014.7.0 from my master at that time. I had no idea it failed, salt '*' test.version replied with the expected number, as far as I remember.
There is not much more between those line apart purge/install of python-*
dependancies packages.

 Start-Date: 2014-11-21  10:23:08
Commandline: apt-get -q -y -o DPkg::Options::=--force-confold -o        

DPkg::Options::=--force-confdef install salt-minion
Upgrade: salt-minion:amd64 (2014.1.13+ds-1trusty1, 2014.7.0+ds-2trusty1),
salt-common:amd64 (2014.1.13+ds-1trusty1, 2014.7.0+ds-2trusty1)
Error: Sub-process /usr/bin/dpkg returned an error code (1)
End-Date: 2014-11-21 10:23:18

Start-Date: 2014-12-11  10:17:30
Commandline: apt-get --reinstall install python-jinja2
Reinstall: python-jinja2:amd64 (2.7.2-2)
End-Date: 2014-12-11  10:17:32

Start-Date: 2014-12-11  10:17:43
Commandline: apt-get --reinstall install salt-minion
Reinstall: salt-minion:amd64 (2014.7.0+ds-2trusty1)
End-Date: 2014-12-11  10:17:47

Start-Date: 2014-12-11  10:56:19
Commandline: apt-get --reinstall install python-markupsafe
Reinstall: python-markupsafe:amd64 (0.18-1build2)
End-Date: 2014-12-11  10:56:20

Start-Date: 2014-12-11  10:57:46
Commandline: apt-get --reinstall install python-msgpack
Reinstall: python-msgpack:amd64 (0.3.0-1ubuntu3)
End-Date: 2014-12-11  10:57:47

Start-Date: 2014-12-11  11:20:31
Commandline: apt-get --reinstall install python-m2crypto
Reinstall: python-m2crypto:amd64 (0.21.1-3ubuntu5)
End-Date: 2014-12-11  11:20:32

Please let me know if you need more information

Le jeudi 11 décembre 2014, 06:18:56 Wolodja Wentland a écrit :

Well, if we wanted to attempt to track this down we would have to see your
/var/log/apt/history file.


Reply to this email directly or view it on GitHub:
#18905 (comment)

@wwentland
Copy link
Contributor

It contains Error: Sub-process /usr/bin/dpkg returned an error code (1) so you encountered an error during that run and did not investigate further.

Does /var/log/apt/term.log contain information about that?

@calve
Copy link
Contributor Author

calve commented Dec 11, 2014

I wasn't aware of the error.
Luckily, I logged the output when I runned sudo salt -C '*' pkg.install salt-minion on my master.
It appears that this particular minion did not respond error nor success durring the call, and obviously didnot respond to my salt '*' test.version command (I wasn't aware of salt-run manage.status at that time)

/var/log/apt/term.log does not contains anything usefull:

Log started: 2014-11-21  10:23:08
Log ended: 2014-11-21  10:23:18

Here is how I understand the issue :

  • Upgraded all my minions in a row
  • One minion silently failed to upgrade for an unknow reason
  • I noticied today
  • Reinstalling salt-minion via apt does not help
  • Reinstalling some dependancies solve the issue

@wwentland
Copy link
Contributor

What about /var/log/apt/term.log.1.gz (or any of the other logs there) ?

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

3 participants