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

virtualenv.managed ran twice over the same directory breaks it #38681

Closed
alexykot opened this issue Jan 11, 2017 · 3 comments
Closed

virtualenv.managed ran twice over the same directory breaks it #38681

alexykot opened this issue Jan 11, 2017 · 3 comments
Labels
cannot-reproduce cannot be replicated with info/context provided info-needed waiting for more info stale
Milestone

Comments

@alexykot
Copy link

Description of Issue/Question

virtualenv.managed configured to create Python3 venv on first run does the right thing, but when run for second time on the same minion with already existing venv breaks it and resets to Python2.

Workaround - explicitly delete venv environment folder before (re)creating the venv.

Setup

/opt/projects/project
  virtualenv.managed:
    - cwd: /opt/projects/project
    - name: /opt/projects/project/venv
    - python: /bin/python3
    - pip_upgrade: True

Steps to Reproduce Issue

  1. create virtualenv.managed state to create a python3 venv.
  2. run salt '<minion_name>' state.apply on master.
  3. login into the minion.
  4. on minion run cd /opt/projects/project && . venv/bin/activate && which python && python --version
  5. as expected get:
/opt/projects/project/venv/bin/python
Python 3.4.5
  1. run salt '<minion_name>' state.apply on master again.
  2. on minion run same cd /opt/projects/project && . venv/bin/activate && which python && python --version
  3. suddenly get:
/bin/python
Python 2.7.5

Versions Report

[root@master]# salt --versions-report
Salt Version:
           Salt: 2016.11.1
 
Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.7.2
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.4.8
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
         pygit2: Not Installed
         Python: 2.7.5 (default, Nov  6 2016, 00:28:07)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 15.3.0
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.1.4
 
System Versions:
           dist: centos 7.3.1611 Core
        machine: x86_64
        release: 3.10.0-327.22.2.el7.x86_64
         system: Linux
        version: CentOS Linux 7.3.1611 Core
[root@minion]# salt-minion --versions-report
Salt Version:
           Salt: 2016.3.4
 
Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.7.2
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.4.8
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
         pygit2: Not Installed
         Python: 2.7.5 (default, Nov  6 2016, 00:28:07)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 15.3.0
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.1.4
 
System Versions:
           dist: centos 7.2.1511 Core
        machine: x86_64
        release: 3.10.0-327.22.2.el7.x86_64
         system: Linux
        version: CentOS Linux 7.2.1511 Core
@Ch3LL
Copy link
Contributor

Ch3LL commented Jan 11, 2017

@alexykot i'm haivng a hard time replicate this. When you run the state.apply again does it state that there were any changes?

@Ch3LL Ch3LL added cannot-reproduce cannot be replicated with info/context provided info-needed waiting for more info labels Jan 11, 2017
@Ch3LL Ch3LL added this to the Blocked milestone Jan 11, 2017
@alexykot
Copy link
Author

alexykot commented Jan 12, 2017

Just retried it, no, it returns:

          ID: project-venv
    Function: virtualenv.managed
        Name: /opt/projects/project/venv
      Result: True
     Comment: virtualenv exists
     Started: 09:35:04.548450
    Duration: 0.73 ms
     Changes:   

There are 88 states applied to this system at once when I run state.apply, and I'm not sure what can interfere here. How can I debug that?

@stale
Copy link

stale bot commented Aug 24, 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 Aug 24, 2018
@stale stale bot closed this as completed Aug 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cannot-reproduce cannot be replicated with info/context provided info-needed waiting for more info stale
Projects
None yet
Development

No branches or pull requests

2 participants