When running either command:
sudo serverless package or sudo serverless deploy
Error: ERROR: Exception: Traceback (most recent call last): File “/var/lang/lib/python3.6/shutil.py”, line 550, in move os.rename(src, real_dst) OSError: [Errno 18] Invalid cross-device link: ‘/tmp/pip-target-wqc5grcw/lib/python/setuptools’ -> ‘/var/task/setuptools’
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File “/var/lang/lib/python3.6/site-packages/pip/_internal/cli/base_command.py”, line 228, in _main status = self.run(options, args) File “/var/lang/lib/python3.6/site-packages/pip/_internal/cli/req_command.py”, line 182, in wrapper return func(self, options, args) File “/var/lang/lib/python3.6/site-packages/pip/_internal/commands/install.py”, line 456, in run options.target_dir, target_temp_dir, options.upgrade File “/var/lang/lib/python3.6/site-packages/pip/_internal/commands/install.py”, line 514, in _handle_target_dir target_item_dir File “/var/lang/lib/python3.6/shutil.py”, line 561, in move symlinks=True) File “/var/lang/lib/python3.6/shutil.py”, line 321, in copytree os.makedirs(dst) File “/var/lang/lib/python3.6/os.py”, line 220, in makedirs mkdir(name, mode) PermissionError: [Errno 13] Permission denied: ‘/var/task/setuptools’
I’ve created several different projects and they work locally but they never progress beyond this invalid cross-link device Error when trying to deploy or package.
What are my options?
While working on your Serverless app on AWS, you might notice that some of the errors can be really hard to debug. It can either be an obscure AWS error or it might just have a misleading error message. At Seed, we’ve had a chance to help a lot of our users work through some of these issues. We decided to catalogue the errors and their fixes.
Common Serverless Errors is a compilation of some of the most common Serverless Framework AWS errors and how to fix them. Available as an open source GitHub repo, edits and contributions are welcome! Service files not changed. Skipping deployment. No matching handler found. Check your service definition.
The CloudFormation stack is in an invalid state for preparation (DELETE_FAILED). The CloudFormation stack name is '<stack-name>--'. Please resolve the issue then attempt preparation again. This situation often arises when a deployed stack's subsequent deployment fails, along with the stack rollback or deletion.
The most common error I see our users encounter is when a deploy fails because a previous deploy was unsuccessful. I can relate to this one because I've encountered it myself many times! The state returned from AWS CloudFormation is usually UPDATE_ROLLBACK_FAILED or DELETE_FAILED, and the error will look something like this:
Edit: I tried nuking my virtualenv, uninstalling/re-installing serverless-python-requirements
, deleting/re-pulling the lambci/lambda
Docker image, no dice.
Then, I stumbled on this GH issue. As hinted in it, the experimental Docker feature Use gRPC FUSE for file sharing seems to be the cause. I've switched it off in the Docker Preferences for now and deploys are successful.
I just had a similar problem. See this issue for a possible solution.
In summary,
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With