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

IOError: [Errno 26] Text file busy #46

Closed
RichardKnop opened this issue Dec 22, 2013 · 2 comments
Closed

IOError: [Errno 26] Text file busy #46

RichardKnop opened this issue Dec 22, 2013 · 2 comments

Comments

@RichardKnop
Copy link

I am using this class in my manifest:

python::virtualenv { $virtualenv_dir:
ensure => present,
version => 'system',
systempkgs => false,
distribute => false,
owner => $user,
group => $group,
}

It works great the first time.

The problem is I have several daemonized celery workers launched which are using the venv/bin/python file.

When I apply the manifest second time, I get:

Already using interpreter /usr/bin/python
Traceback (most recent call last):
File "/usr/bin/virtualenv", line 3, in
virtualenv.main()
File "/usr/lib/python2.7/dist-packages/virtualenv.py", line 938, in main
never_download=options.never_download)
File "/usr/lib/python2.7/dist-packages/virtualenv.py", line 1039, in create_environment
site_packages=site_packages, clear=clear))
File "/usr/lib/python2.7/dist-packages/virtualenv.py", line 1274, in install_python
shutil.copyfile(executable, py_executable)
File "/usr/lib/python2.7/shutil.py", line 83, in copyfile
with open(dst, 'wb') as fdst:
IOError: [Errno 26] Text file busy: '/usr/local/myapp/venv/bin/python'

Is it somehow possible to only run virtualenv command if the venv directory has not been created yet?

Or what would you suggest? I don't want to stop my celery workers while applying the puppet manifest.

@dcarley
Copy link
Contributor

dcarley commented Dec 31, 2013

I think it might be a typo in f7801a4 (#43) which causes the virtualenv to be rebuilt erroneously. @jalli?

antevens pushed a commit to antevens/puppet-python that referenced this issue Jan 1, 2014
dcarley added a commit to alphagov/puppet-graphite that referenced this issue Jan 2, 2014
Install Graphite, Carbon, Whisper, and (nearly) all dependencies into a
virtualenv using the `stankevich/python` module. This retains the same
sandboxing that `--install-option`/`--prefix` was doing, but with the added
benefit of:

- Allowing the version param to upgrade and downgrade the packages without
  writing the `pip` logic ourselves.
- Isolating dependencies from the system's Python/pip paths.

Absolute binary paths are used to reference the virtualenv without needing
to `source bin/activate` each time. Cairo is shimmed into the virtualenv
from the system package because of the reasons described in the class doc.
I've rebased the dependencies against Graphite's `requirements.txt` to
reference specific versions and dropped:

- LDAP support: because it has compile dependencies and I'm not aware of
  anyone currently using this functionality from the module.
- pysqlite2: because Python >=2.6 has this builtin.

I'm using an earlier version of the `python` module because of the following
bug which causes the virtualenv to be recreated on every run:

- voxpupuli/puppet-python#46

Tests will be committed separately because they depend on refactoring
currently in unmerged PR #16.
dcarley added a commit to alphagov/puppet-graphite that referenced this issue Jan 3, 2014
Install Graphite, Carbon, Whisper, and (nearly) all dependencies into a
virtualenv using the `stankevich/python` module. This retains the same
sandboxing that `--install-option`/`--prefix` was doing, but with the added
benefit of:

- Allowing the version param to upgrade and downgrade the packages without
  writing the `pip` logic ourselves.
- Isolating dependencies from the system's Python/pip paths.

Absolute binary paths are used to reference the virtualenv without needing
to `source bin/activate` each time. Cairo is shimmed into the virtualenv
from the system package because of the reasons described in the class doc.
I've rebased the dependencies against Graphite's `requirements.txt` to
reference specific versions and dropped:

- LDAP support: because it has compile dependencies and I'm not aware of
  anyone currently using this functionality from the module.
- pysqlite2: because Python >=2.6 has this builtin.

I'm using an earlier version of the `python` module because of the following
bug which causes the virtualenv to be recreated on every run:

- voxpupuli/puppet-python#46

Tests will be committed separately because they depend on refactoring
currently in unmerged PR #16.
@antevens
Copy link
Contributor

antevens commented Jan 3, 2014

I have submitted a pull request with a fix that I have verified along with fixes needed for PIP 1.5 compatibility.

shivapoudel pushed a commit that referenced this issue Sep 1, 2015
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

4 participants