serverless-python-requirements
serverless-python-requirements copied to clipboard
EEXIST issue with sls deploy and dockerizePip
Hello,
When I try to "sls deploy" using "dockerizePip: true" option, i get the following error:
Serverless: Invoke deploy
Serverless: Invoke package
Serverless: Invoke aws:common:validate
Serverless: Invoke aws:common:cleanupTempDir
Serverless: Installing required Python packages with python3.6...
Serverless: Docker Image: lambci/lambda:build-python3.6
Serverless: Linking required Python packages...
Error --------------------------------------------------
EEXIST: file already exists, symlink '/Users/me/project/test/lambda/.serverless/requirements/requirements.txt' -> './requirements.txt'
For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
Stack Trace --------------------------------------------
Error: EEXIST: file already exists, symlink '/Users/me/project/test/lambda/.serverless/requirements/requirements.txt' -> './requirements.txt'
at Object.fs.symlinkSync (fs.js:1014:18)
I'm running on macOS, with latest sls version, and latest serverless-python-requirements version.
Thanks for your support.
Can you post your serverless config file please?
service: test
provider:
name: aws
runtime: python3.6
region: ap-southeast-1
environment:
JENKINS_TOKEN: ${file(./serverless.env.yml):JENKINS_TOKEN, ''}
functions:
check_access:
handler: access.main
memorySize: 128
events:
- http:
path: /check_access
method: get
cors: true
plugins:
- serverless-python-requirements
custom:
pythonRequirements:
dockerizePip: true
My requirements.txt:
openshift
kubernetes
python-jenkins
urllib3==1.21.1
requests
FYI, here is what i did from start:
- tried to run sls deploy without dockerizePip settings => issues because i have python3.7 installed, not 3.6
- tried to run sls deploy with dockerizePip settings => issue about EEXIST
- tried to run sls deploy without dockerizePip settings but with pythonBin settings => same issue (EEXIST)
Serverless: Installing required Python packages with /usr/local/bin/python3.6...
Serverless: Linking required Python packages...
Error --------------------------------------------------
EEXIST: file already exists, symlink '/Users/me/project/testlambda/.serverless/requirements/requirements.txt' -> './requirements.txt'
For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
Stack Trace --------------------------------------------
Error: EEXIST: file already exists, symlink '/Users/me/project/test/lambda/.serverless/requirements/requirements.txt' -> './requirements.txt'
Hope that helps :)
NOTE: After renaming requirements.txt into requirements, i don't have the issue anymore, BUT, the requirements are not packaged in the resulting zip file...
Could you try rm -rf .serverless
and re running (i think the pythonBin route is preferable in your case
Thanks for the support, but I already tried to remove the .serverless folder and start from fresh, but I've got same result. EEXIST error. On Mon, Nov 12, 2018 at 22:27 Daniel Schep [email protected] wrote:
Could you try rm -rf .serverless and re running (i think the pythonBin route is preferable in your case
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/UnitedIncome/serverless-python-requirements/issues/278#issuecomment-437879431, or mute the thread https://github.com/notifications/unsubscribe-auth/ACJinq1nl2YF5VaXr26JLVrV6B9FDFyaks5uuXc_gaJpZM4YWA4Q .
This is very odd. I tested this on macOS 10.13.4 and wasn't able to recreate the issue.
My test repo is https://github.com/dschep-bug-repos/sls-py-req-278
Could you follow the readme and confirm it causes this EEXIST
issue for you too?
Using your repo, i don't have the EEXIST issue anymore ... Which is very odd, as i don't see a lot of differences between your setup and mine.
I will try to investigate a bit more on our differences, and keep you posted.
Thanks for the support
On Tue, Nov 13, 2018 at 8:49 AM Daniel Schep [email protected] wrote:
This is very odd. I tested this on macOS 10.13.4 and wasn't able to recreate the issue.
My test repo is https://github.com/dschep-bug-repos/sls-py-req-278
Could you follow the readme and confirm it causes this EEXIST issue for you too?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/UnitedIncome/serverless-python-requirements/issues/278#issuecomment-438074385, or mute the thread https://github.com/notifications/unsubscribe-auth/ACJinjlbWlgJ-_Oy997dqZ46XGfbVgTpks5uugkZgaJpZM4YWA4Q .
Hey all. I have had the same issue and after some trial&error I found out that the issue was fixed by upgrading the plugin (in my case it was a 3.x.x
-> 4.x.x
switch, so I suppose sth changed there). @kalote not sure if it's still an issue for you but anyways, for anybody that finds this thread, try running sls plugin install -n serverless-python-requirements
.
Added a label for visibility, please comment if you or anyone can replicate this with the latest release of the serverless framework and this plugin, otherwise will close.
I'm having a similar issue on 5.1.0.
I'm using poetry and Python 3.7.
i have very little relevant in my serverless file:
package:
include:
- "!./**"
- proj_dir/**
excludeDevDependencies: false
sls deploy
works just fine, but
sls deploy -f myFunc
Serverless: Generating requirements.txt from pyproject.toml...
Error --------------------------------------------------
Error: EEXIST: file already exists, link....
I'm having a similar issue on 5.1.0.
I'm using poetry and Python 3.7.
i have very little relevant in my serverless file:
package: include: - "!./**" - proj_dir/** excludeDevDependencies: false
sls deploy
works just fine, butsls deploy -f myFunc Serverless: Generating requirements.txt from pyproject.toml... Error -------------------------------------------------- Error: EEXIST: file already exists, link....
Having the same issue. serverless deploy
works fine, but serverless deploy function
fails. Also on 5.1.0
. Python 3.8
. Serverless 2.8.0
# serverless.yml
...
plugins:
- serverless-python-requirements
custom:
pythonRequirements:
layer: true
dockerizePip: true
serverless deploy function --function myfunction --stage mystage --verbose
Serverless: Generated requirements from /home/.../requirements.txt in /home/.../.serverless/requirements.txt...
Serverless: Using static cache of requirements found at /home/.../.cache/serverless-python-requirements/fec9a9359ad54bf436ce426e1c7d6e79abf302f9feb6c822783404a2ebf42d6f_slspyc ...
Serverless: Packaging function: myfunction...
Error --------------------------------------------------
Error: EEXIST: file already exists, symlink '/home/.../serverless-python-requirements/fec9a9359ad54bf436ce426e1c7d6e79abf302f9feb6c822783404a2ebf42d6f_slspyc' -> '/home/.../.serverless/requirements'
@sirfuzzalot Have you resolved this issue?
Having the same issue since upgrading to serverless v3 and serverless-python-requirements 5.4.0. (I may have been seeing the same issue earlier, but it didn't seem as fatal, somehow.)
Whoops, my error is most similar to @sirfuzzalot 's error, but a bit different:
Error: EEXIST: file already exists, symlink '/path/to/project/.requirements_cache/91e8d581ee3e2acc2fb3bc7d00d4788cce7c5e6ec79a1b55242428bcd67376a6_x86_64_slspyc.zip' -> '.serverless/pythonRequirements.zip'
Of course, now that I've posted this comment, I can't repro the issue. 🙃
Aaaand it's back.
Hello @brettdh - are you consistently running into this issue? If yes, do you maybe have a reproduction steps for it?
It happens intermittently when I try to deploy a single function, and then it goes away. The state is probably changing when I change something between deploys, but I'm not sure. I don't have reliable repro steps yet.
It seems to fail when I've recently run sls package
, which creates .serverless/pythonRequirements.zip
- but sls deploy function
is also attempting to write that file. If this is the case, I should be able to make a minimal repro project sometime soon.
I'm using this repo to show a minimal repro for a related, but different issue:
https://github.com/brettdh/serverless-layer-test
However, if you comment out the workaround mentioned in the README, it also serves as a reliable repro for this issue.
Forgot to mention - related issue is #700.