Serverless-python-requirements: EEXIST issue with sls deploy and dockerizePip

Created on 9 Nov 2018  Â·  11Comments  Â·  Source: UnitedIncome/serverless-python-requirements

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.

Docker waiting-on-response

All 11 comments

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:

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 notifications@github.com 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 notifications@github.com
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, but

sls 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'
Was this page helpful?
0 / 5 - 0 ratings

Related issues

sepulworld picture sepulworld  Â·  5Comments

bsamuel-ui picture bsamuel-ui  Â·  3Comments

chinalikai picture chinalikai  Â·  5Comments

doublemarked picture doublemarked  Â·  3Comments

ceefour picture ceefour  Â·  3Comments