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

seed.apply tries to use salt.syspaths.BOOTSTRAP outside chroot. #25947

Closed
gusajz opened this issue Aug 1, 2015 · 3 comments
Closed

seed.apply tries to use salt.syspaths.BOOTSTRAP outside chroot. #25947

gusajz opened this issue Aug 1, 2015 · 3 comments
Labels
Bug broken, incorrect, or confusing behavior Execution-Module help-wanted Community help is needed to resolve this P3 Priority 3 Platform Relates to OS, containers, platform-based utilities like FS, system based apps severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around stale
Milestone

Comments

@gusajz
Copy link

gusajz commented Aug 1, 2015

There seems to be an issue with seed.apply (actually, It affects also virt.init). The problem is that the image is never seeded with the minion. I tried it on an Ubuntu server 15.04, a Debian-8 guest image and salt version, 2015.5.0.

The command: salt 'id' seed.apply /srv/salt/vm-images/debian_test_chroot.qcow2 guest1 (the same happens with other images I tried)

Returns always False and nothing is installed.

I debugged it and I found the following:

salt/modules/seed.py:_install(mtp):

    cmd = 'if type salt-minion; then exit 0; '
    cmd += 'else sh {0} -c /tmp; fi'.format(salt.syspaths.BOOTSTRAP)

Which evaluates to:

ipdb> cmd
"chroot /tmp/guest/srv.salt-images.debian_test_chroot.system.qcow2 /bin/bash -c 'if type salt-minion; then exit 0; else sh /usr/lib/python2.7/dist-packages/salt/cloud/deploy/bootstrap-salt.sh -c /tmp; fi'"

The problem is that /usr/lib/python2.7/dist-packages/salt/cloud/deploy/bootstrap-salt.sh is outside the chroot, so, when it tries to execute the command, the result is: "/bin/bash: line 0: type: salt-minion: not found\nsh: 0: Can't open /usr/lib/python2.7/dist-packages/salt/cloud/deploy/bootstrap-salt.sh\n"

Version report:
                  Salt: 2015.5.0
                Python: 2.7.9 (default, Apr  2 2015, 15:33:21)
                Jinja2: 2.7.3
              M2Crypto: 0.21.1
        msgpack-python: 0.4.2
          msgpack-pure: Not Installed
              pycrypto: 2.6.1
               libnacl: Not Installed
                PyYAML: 3.11
                 ioflo: Not Installed
                 PyZMQ: 14.4.1
                  RAET: Not Installed
                   ZMQ: 4.0.5
                  Mako: 1.0.0
 Debian source package: 2015.5.0+ds-1utopic1
@jfindlay jfindlay added Execution-Module Bug broken, incorrect, or confusing behavior P3 Priority 3 Platform Relates to OS, containers, platform-based utilities like FS, system based apps severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around labels Aug 3, 2015
@jfindlay jfindlay added this to the Approved milestone Aug 3, 2015
@jfindlay jfindlay added the help-wanted Community help is needed to resolve this label Aug 3, 2015
@jfindlay
Copy link
Contributor

jfindlay commented Aug 3, 2015

@gusajz, thanks for the report.

@rallytime
Copy link
Contributor

This could also be related to what we're seeing in #26699.

@stale
Copy link

stale bot commented Jan 9, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

@stale stale bot added the stale label Jan 9, 2018
@stale stale bot closed this as completed Jan 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior Execution-Module help-wanted Community help is needed to resolve this P3 Priority 3 Platform Relates to OS, containers, platform-based utilities like FS, system based apps severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around stale
Projects
None yet
Development

No branches or pull requests

3 participants