Sometimes get 'Text file busy' error while creating virtualenv
davidshepherd7 opened this issue · comments
Hi, for one particular action we're seeing this fail during virtualenv setup with the error
OSError: [Errno 26] Text file busy: '/github/home/.local/share/virtualenvs/-x-v5uFv0/bin/python'
which, if I'm interpreting it correctly, probably means that another process is using the virtualenv while it is being setup. However I can't see any other places that would be running a python process here, and particularly not any that are running inside pipenv
. Do you have any idea what could be causing this?
Here's the action in question:
action "create follow up issue" {
uses = "swinton/httpie.action@master"
secrets = ["GITHUB_TOKEN"]
needs = ["if comment is /improve"]
args = [
"--auth-type=jwt",
"--auth=$GITHUB_TOKEN",
"POST",
"`jq .issue.repository_url $GITHUB_EVENT_PATH --raw-output`/issues",
"labels:=[\\\"review:is-follow-up\\\"]",
"assignees:=[\\\"`jq .issue.user.login $GITHUB_EVENT_PATH --raw-output`\\\"]",
"title=\"Follow up on '`jq .issue.title $GITHUB_EVENT_PATH --raw-output`'\"",
"body=\"Original PR: #`jq .issue.number $GITHUB_EVENT_PATH --raw-output`.\"",
]
}
Here's the full log:
### STARTED label review:needs-follow-up 15:39:26Z
Already have image (with digest): gcr.io/github-actions-images/action-runner:latest
fc613b4dfd6736a7bd268c8a0e74ed0d1c04a959f59dd74ef2874983fd443fc9: Pulling from gct-12-539e3k68baucjmx9k3wgol5/e5b3804e9b98cbcbb7ce5247d08b0c2bf4794d41223fb4476f5a42d9600d9b0c/8a5edab282632443219e051e4ade2d1d5bbc671c781051bf1437897cbdfea0f1
0a4690c5d889: Pulling fs layer
9ef510f4d0f7: Pulling fs layer
53fe96932e3f: Pulling fs layer
13d55380052c: Pulling fs layer
1aa19c55c880: Pulling fs layer
45c095ecc0c0: Pulling fs layer
84007a446af8: Pulling fs layer
33a7ecdd83f0: Pulling fs layer
13d55380052c: Waiting
1aa19c55c880: Waiting
45c095ecc0c0: Waiting
84007a446af8: Waiting
33a7ecdd83f0: Waiting
9ef510f4d0f7: Verifying Checksum
9ef510f4d0f7: Download complete
0a4690c5d889: Verifying Checksum
53fe96932e3f: Verifying Checksum
0a4690c5d889: Download complete
53fe96932e3f: Download complete
13d55380052c: Verifying Checksum
13d55380052c: Download complete
45c095ecc0c0: Verifying Checksum
45c095ecc0c0: Download complete
84007a446af8: Download complete
1aa19c55c880: Verifying Checksum
1aa19c55c880: Download complete
33a7ecdd83f0: Verifying Checksum
33a7ecdd83f0: Download complete
0a4690c5d889: Pull complete
9ef510f4d0f7: Pull complete
53fe96932e3f: Pull complete
13d55380052c: Pull complete
1aa19c55c880: Pull complete
45c095ecc0c0: Pull complete
84007a446af8: Pull complete
33a7ecdd83f0: Pull complete
Digest: sha256:61c4831989b2dd99073171d608624b95a66264a3b7253a1d956dab6728a09fe9
Status: Downloaded newer image for gcr.io/gct-12-539e3k68baucjmx9k3wgol5/e5b3804e9b98cbcbb7ce5247d08b0c2bf4794d41223fb4476f5a42d9600d9b0c/8a5edab282632443219e051e4ade2d1d5bbc671c781051bf1437897cbdfea0f1:fc613b4dfd6736a7bd268c8a0e74ed0d1c04a959f59dd74ef2874983fd443fc9
Step 1/17 : FROM python:3-slim-stretch
3-slim-stretch: Pulling from library/python
0a4690c5d889: Already exists
9ef510f4d0f7: Already exists
53fe96932e3f: Already exists
13d55380052c: Already exists
1aa19c55c880: Already exists
Digest: sha256:b5136440d5b2d61e96747f9859f4fccbd4fe7519bc64e73e7e0341e0e7a5405f
Status: Downloaded newer image for python:3-slim-stretch
---> d554f04f22a4
Step 2/17 : LABEL name="HTTP client for GitHub Actions"
---> Using cache
---> 29e9101f81bb
Step 3/17 : LABEL version="1.0.3"
---> Using cache
---> fa63359d4af4
Step 4/17 : LABEL repository="http://github.com/swinton/httpie.action"
---> Using cache
---> dff9af5ac0a3
Step 5/17 : LABEL homepage="http://github.com/swinton/httpie.action"
---> Using cache
---> d43d3c93adcf
Step 6/17 : LABEL maintainer="Steve Winton <stevewinton@gmail.com>"
---> Using cache
---> 6747aae291a8
Step 7/17 : LABEL com.github.actions.name="HTTP client"
---> Using cache
---> 965100871789
Step 8/17 : LABEL com.github.actions.description="A general purpose HTTP client for GitHub Actions providing human-friendly interactions with third-party web services."
---> Using cache
---> 032e044c4865
Step 9/17 : LABEL com.github.actions.icon="send"
---> Using cache
---> aa17ee6703ff
Step 10/17 : LABEL com.github.actions.color="gray-dark"
---> Using cache
---> 6776d51c11de
Step 11/17 : WORKDIR /
---> Using cache
---> f015d183986a
Step 12/17 : COPY "entrypoint.sh" "Pipfile" "Pipfile.lock" /
---> Using cache
---> 9ff430a30d44
Step 13/17 : COPY "config.json" /.httpie/
---> Using cache
---> bfe16135414a
Step 14/17 : RUN apt-get update -y && apt-get install -y --no-install-recommends jq && rm -rf /var/lib/apt/lists/* && pip install --upgrade pip && pip install --upgrade pipenv && pipenv install --deploy --system
---> Using cache
---> 35574cbad432
Step 15/17 : ENV HTTPIE_CONFIG_DIR /.httpie
---> Using cache
---> 4b99dfb2ca52
Step 16/17 : ENTRYPOINT ["/entrypoint.sh"]
---> Using cache
---> 0f9602e0cdaf
Step 17/17 : CMD ["--help"]
---> Using cache
---> 10a0d47af1c3
Successfully built 10a0d47af1c3
Successfully tagged gcr.io/gct-12-539e3k68baucjmx9k3wgol5/e5b3804e9b98cbcbb7ce5247d08b0c2bf4794d41223fb4476f5a42d9600d9b0c/8a5edab282632443219e051e4ade2d1d5bbc671c781051bf1437897cbdfea0f1:fc613b4dfd6736a7bd268c8a0e74ed0d1c04a959f59dd74ef2874983fd443fc9
Already have image (with digest): gcr.io/github-actions-images/action-runner:latest
Creating a virtualenv for this project…
Pipfile: /Pipfile
Using /usr/local/bin/python (3.7.4) to create virtualenv…
⠋ Creating virtual environment...�
⠙ Creating virtual environment...�
⠹ Creating virtual environment...Already using interpreter /usr/local/bin/python
Using base prefix '/usr/local'
New python executable in /github/home/.local/share/virtualenvs/-x-v5uFv0/bin/python
�✘ Failed creating virtual environment
[pipenv.exceptions.VirtualenvCreationException]: File "/usr/local/lib/python3.7/site-packages/pipenv/cli/command.py", line 408, in run
[pipenv.exceptions.VirtualenvCreationException]: command=command, args=args, three=state.three, python=state.python, pypi_mirror=state.pypi_mirror
[pipenv.exceptions.VirtualenvCreationException]: File "/usr/local/lib/python3.7/site-packages/pipenv/core.py", line 2310, in do_run
[pipenv.exceptions.VirtualenvCreationException]: three=three, python=python, validate=False, pypi_mirror=pypi_mirror,
[pipenv.exceptions.VirtualenvCreationException]: File "/usr/local/lib/python3.7/site-packages/pipenv/core.py", line 574, in ensure_project
[pipenv.exceptions.VirtualenvCreationException]: pypi_mirror=pypi_mirror,
[pipenv.exceptions.VirtualenvCreationException]: File "/usr/local/lib/python3.7/site-packages/pipenv/core.py", line 506, in ensure_virtualenv
[pipenv.exceptions.VirtualenvCreationException]: python=python, site_packages=site_packages, pypi_mirror=pypi_mirror
[pipenv.exceptions.VirtualenvCreationException]: File "/usr/local/lib/python3.7/site-packages/pipenv/core.py", line 935, in do_create_virtualenv
[pipenv.exceptions.VirtualenvCreationException]: extra=[crayons.blue("{0}".format(c.err)),]
[pipenv.exceptions.VirtualenvCreationException]: Traceback (most recent call last):
File "/usr/local/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/local/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.7/site-packages/virtualenv.py", line 2619, in <module>
main()
File "/usr/local/lib/python3.7/site-packages/virtualenv.py", line 867, in main
symlink=options.symlink,
File "/usr/local/lib/python3.7/site-packages/virtualenv.py", line 1142, in create_environment
install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages=site_packages, clear=clear, symlink=symlink)
File "/usr/local/lib/python3.7/site-packages/virtualenv.py", line 1512, in install_python
shutil.copyfile(executable, py_executable)
File "/usr/local/lib/python3.7/shutil.py", line 121, in copyfile
with open(dst, 'wb') as fdst:
OSError: [Errno 26] Text file busy: '/github/home/.local/share/virtualenvs/-x-v5uFv0/bin/python'
Failed to create virtual environment.
### FAILED label review:needs-follow-up 15:40:07Z (41.288s)
Thanks 👍