serverless-python-requirements icon indicating copy to clipboard operation
serverless-python-requirements copied to clipboard

invalid cross-device link when using sls deploy

Open jdrylewicz opened this issue 5 years ago • 4 comments

Hi, I am able to run your most basic example (packaging the Flask dependency only). When I add more modules in my requirements.txt I am running into issues. I tried everything i could find on forums so far without luck.

Traceback (most recent call last): File "/var/lang/lib/python3.7/shutil.py", line 566, in move os.rename(src, real_dst) OSError: [Errno 18] Invalid cross-device link: '/tmp/pip-target-kj_jmr6f/lib/python/cycler-0.10.0.dist-info' -> '/var/task/cycler-0.10.0.dist-info'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/var/lang/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 228, in _main status = self.run(options, args) File "/var/lang/lib/python3.7/site-packages/pip/_internal/cli/req_command.py", line 182, in wrapper return func(self, options, args) File "/var/lang/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 456, in run org: haystock options.target_dir, target_temp_dir, options.upgrade File "/var/lang/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 514, in _handle_target_dir target_item_dir File "/var/lang/lib/python3.7/shutil.py", line 577, in move symlinks=True) File "/var/lang/lib/python3.7/shutil.py", line 368, in copytree raise Error(errors) shutil.Error: [('/tmp/pip-target-kj_jmr6f/lib/python/cycler-0.10.0.dist-info/DESCRIPTION.rst', '/var/task/cycler-0.10.0.dist-info/DESCRIPTION.rst', '[Errno 5] Input/output error')]

  at /Users/johandrylewicz/node_modules/serverless-python-requirements/lib/pip.js:325:13
  at Array.forEach (<anonymous>)
  at installRequirements (/Users/johandrylewicz/node_modules/serverless-python-requirements/lib/pip.js:312:28)
  at installRequirementsIfNeeded (/Users/johandrylewicz/node_modules/serverless-python-requirements/lib/pip.js:556:3)
  at ServerlessPythonRequirements.installAllRequirements (/Users/johandrylewicz/node_modules/serverless-python-requirement

s/lib/pip.js:635:29) at ServerlessPythonRequirements.tryCatcher (/Users/johandrylewicz/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/Users/johandrylewicz/node_modules/bluebird/js/release/promise.js:547:31) at Promise._settlePromise (/Users/johandrylewicz/node_modules/bluebird/js/release/promise.js:604:18) at Promise._settlePromise0 (/Users/johandrylewicz/node_modules/bluebird/js/release/promise.js:649:10) at Promise._settlePromises (/Users/johandrylewicz/node_modules/bluebird/js/release/promise.js:729:18) at _drainQueueStep (/Users/johandrylewicz/node_modules/bluebird/js/release/async.js:93:12) at _drainQueue (/Users/johandrylewicz/node_modules/bluebird/js/release/async.js:86:9) at Async._drainQueues (/Users/johandrylewicz/node_modules/bluebird/js/release/async.js:102:5) at Immediate.Async.drainQueues [as _onImmediate] (/Users/johandrylewicz/node_modules/bluebird/js/release/async.js:15:14) at processImmediate (internal/timers.js:456:21) at process.topLevelDomainCallback (domain.js:137:15)

 For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.

Get Support -------------------------------------------- Docs: docs.serverless.com Bugs: github.com/serverless/serverless/issues Issues: forum.serverless.com

Your Environment Information --------------------------- Operating System: darwin Node Version: 12.18.1 Framework Version: 2.13.0 (standalone) Plugin Version: 4.1.2 SDK Version: 2.3.2 Components Version: 3.4.2

Also attaching my serverless.yml:

org: test app: flaskapp service: flask-api-2

provider: name: aws runtime: python3.7

functions: app: handler: wsgi_handler.handler events: - http: ANY / - http: 'ANY {proxy+}'

custom: wsgi: app: app.app pythonBin: python3 # Some systems with Python3 may require this packRequirements: false pythonRequirements: dockerizePip: true

plugins:

  • serverless-wsgi
  • serverless-python-requirements

jdrylewicz avatar Nov 26 '20 22:11 jdrylewicz

I observed the same issue today. I am running the example from https://www.serverless.com/blog/serverless-python-packaging

serverless.yml service: numpy-test

provider: name: aws runtime: python3.8

plugins:

  • serverless-python-requirements

custom: pythonRequirements: dockerizePip: non-linux

functions:

hello: handler: handler.hello_

handler:

import numpy as np

def main(event, context): a = np.arange(15).reshape(3, 5)

print("Your numpy array:")
print(a)

if name == "main": main('', '')_

mgijsbertihodenpijl avatar Dec 01 '20 07:12 mgijsbertihodenpijl

ok, this fixed the issue: https://github.com/UnitedIncome/serverless-python-requirements/issues/556#issuecomment-728226895

And now bumping immediately in another issue.

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received undefined at readFile (fs.js:320:10) at go$readFile (/usr/local/lib/node_modules/serverless/node_modules/graceful-fs/graceful-fs.js:118:14)

mgijsbertihodenpijl avatar Dec 01 '20 07:12 mgijsbertihodenpijl

ok, this fixed the issue: #556 (comment)

And now bumping immediately in another issue.

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received undefined at readFile (fs.js:320:10) at go$readFile (/usr/local/lib/node_modules/serverless/node_modules/graceful-fs/graceful-fs.js:118:14)

Did you find a way to fix it? I'm getting the same error here :/

jonathanabila avatar Jul 20 '21 17:07 jonathanabila

Hi, still have this problem, i tried turning off "Use gRPC FUSE for file sharing" but still with the issue. I don't know what to do.

SOLVED: Just make a "sudo npm install --save serverless-python-requirements"

sebamacchia avatar Jul 23 '21 18:07 sebamacchia