Skip to content

EEXIST issue with sls deploy and dockerizePip #278

@kalote

Description

@kalote

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.

Activity

AndrewFarley

AndrewFarley commented on Nov 9, 2018

@AndrewFarley
Contributor

Can you post your serverless config file please?

kalote

kalote commented on Nov 9, 2018

@kalote
Author
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
kalote

kalote commented on Nov 9, 2018

@kalote
Author

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...

dschep

dschep commented on Nov 12, 2018

@dschep
Contributor

Could you try rm -rf .serverless and re running (i think the pythonBin route is preferable in your case

kalote

kalote commented on Nov 12, 2018

@kalote
Author
dschep

dschep commented on Nov 12, 2018

@dschep
Contributor

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?

kalote

kalote commented on Nov 13, 2018

@kalote
Author
raethlo

raethlo commented on Mar 20, 2019

@raethlo

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.

AndrewFarley

AndrewFarley commented on Feb 28, 2020

@AndrewFarley
Contributor

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.

petergaultney

petergaultney commented on May 30, 2020

@petergaultney

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....
sirfuzzalot

sirfuzzalot commented on Oct 24, 2020

@sirfuzzalot

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'
amediantsev

amediantsev commented on Dec 2, 2021

@amediantsev

@sirfuzzalot Have you resolved this issue?

brettdh

brettdh commented on May 24, 2022

@brettdh

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.)

8 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Dockerwaiting-on-responseIf an issue goes without response for a while, close it.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @brettdh@AndrewFarley@miketheman@petergaultney@dschep

        Issue actions

          EEXIST issue with sls deploy and dockerizePip · Issue #278 · serverless/serverless-python-requirements