serverless: Serverless exits 0 after failing to upload service zip file

This is a Bug Report

Description

See this console log:

Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading artifacts...
Serverless: Uploading service .zip file to S3 (17.45 MB)...
Serverless: Recoverable error occurred (write EPIPE), sleeping for 5 seconds. Try 1 of 4
git:feature/teams* >> echo $status
0
git:feature/teams* >> sls version
1.32.0
git:feature/teams* >>

It seems the “recoverable” error was improperly recovered from. Serverless should exit non-zero if the deploy does not complete.

Additional Data

  • Serverless Framework Version you’re using: 1.32.0
  • Operating System: MacOS 10.14

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Comments: 29 (6 by maintainers)

Most upvoted comments

Hello @pgrzesik - I’m able to reproduce that issue on mac os 11.4 with very simple serverless.yml

service: testsls

provider:
  name: aws
  runtime: python3.8
  stage: dev
  region: us-east-1
  lambdaHashingVersion: 20201221


functions:
  hello:
    handler: handler.hello

This is my version of serverless:

sls --version
Framework Core: 2.51.0
Plugin: 5.4.3
SDK: 4.2.3
Components: 3.13.3

And here is the output of the command with debug:

sls deploy
Serverless: To ensure safe major version upgrades ensure "frameworkVersion" setting in service configuration (recommended setup: "frameworkVersion: ^2.51.0")

Serverless: Load command interactiveCli
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command config:tabcompletion
Serverless: Load command config:tabcompletion:install
Serverless: Load command config:tabcompletion:uninstall
Serverless: Load command create
Serverless: Load command install
Serverless: Load command package
Serverless: Load command deploy
Serverless: Load command deploy:function
Serverless: Load command deploy:list
Serverless: Load command deploy:list:functions
Serverless: Load command invoke
Serverless: Load command invoke:local
Serverless: Load command info
Serverless: Load command logs
Serverless: Load command metrics
Serverless: Load command print
Serverless: Load command remove
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command slstats
Serverless: Load command plugin
Serverless: Load command plugin
Serverless: Load command plugin:install
Serverless: Load command plugin
Serverless: Load command plugin:uninstall
Serverless: Load command plugin
Serverless: Load command plugin:list
Serverless: Load command plugin
Serverless: Load command plugin:search
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command upgrade
Serverless: Load command uninstall
Serverless: Load command login
Serverless: Load command logout
Serverless: Load command generate-event
Serverless: Load command test
Serverless: Load command dashboard
Serverless: Load command output
Serverless: Load command output:get
Serverless: Load command output:list
Serverless: Load command param
Serverless: Load command param:get
Serverless: Load command param:list
Serverless: Load command studio
Serverless: Skipping variables resolution with old resolver (new resolver reported no more variables to resolve)
Serverless: Invoke deploy
Serverless: Invoke package
Serverless: Invoke aws:common:validate
Serverless: Invoke aws:common:cleanupTempDir
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Invoke aws:package:finalize
Serverless: Invoke aws:common:moveArtifactsToPackage
Serverless: Invoke aws:common:validate
Serverless: Invoke aws:deploy:deploy
Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading artifacts...
Serverless: Uploading service testsls.zip file to S3 (3.86 MB)...
Serverless: Recoverable error occurred (Error: write EPIPE
    at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:94:16)
----------------------------------------------------------------------------------------------------), sleeping for ~5 seconds. Try 1 of 4

As soon as the zip to be uploaded is bigger than 1mb, i’m facing that error. On version 2.49, it was exiting after the error, on 2.51 it’s getting stuck on that error message forever. I tried multiple version of node: same issue.

Sometimes i’m getting small variation of that error:

Serverless: Recoverable error occurred (TimeoutError: socket hang up
    at connResetException (internal/errors.js:628:14)
    at TLSSocket.socketOnEnd (_http_client.js:499:23)
    at TLSSocket.emit (events.js:387:35)
    at TLSSocket.emit (domain.js:470:12)
    at endReadableNT (internal/streams/readable.js:1317:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)
----------------------------------------------------------------------------------------------------), sleeping for ~6 seconds. Try 1 of 4

But the behaviour is exactly the same, it’s getting stuck there.

I was also able to reproduce on a colleague mac running 11.4, same error as above.

Why is this closed? It’s clearly an open issue, and until there are clear instructions to people stuck on MacOS (even if they don’t require fixes to serverless.com framework itself) it should remain open. Many of your users will be in the same boat. Otherwise, update your supported versions and indicate clearly that serverless.com does not work with and does not support the latest MacOS versions.

We’re seeing this as an intermittent issue (which makes it a lot harder to debug) in Github Actions (so less likely to be speed)

Serverless version 3.34.0

OK thank you for the update, let’s close this for now then. If anyone is still stuck and has more details, let’s reopen!

Serverless: Packaging service… Serverless: Excluding development dependencies… Serverless: Uploading CloudFormation file to S3… Serverless: Uploading artifacts... Serverless: Uploading service sqs-triggers-demo.zip file to S3 (15.13 MB)… Serverless: Recoverable error occurred (write EPIPE), sleeping for ~7 seconds. Try 1 of 4``

I have it too:

Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Excluding development dependencies...
Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading artifacts...
Serverless: Uploading service googlenews.zip file to S3 (5.22 KB)...
Serverless: Uploading service commonLibs.zip file to S3 (29.22 MB)...
Serverless: Recoverable error occurred (write EPIPE), sleeping for ~5 seconds. Try 1 of 4
$ sls version
Framework Core: 1.67.3
Plugin: 3.6.6
SDK: 2.3.0
Components: 2.29.1