amplify-cli: amplify push timeout: An error occured during the push operation: Your socket connection to the server was not read from or written to within the timeout period

Describe the bug

For the past few days, as the schema started growing it has been almost impossible to reliably push any changes via amplify push --yes

The “Updating resources in the cloud. This may take a few minutes…” message only appears for one in several push attempts.

Some more logs/status updates relating to what it does at every step between compiling the schema and updating the resources in the cloud would be helpful.

I’m not sure if it’s some sort of intermittent outage related to S3 or other resources amplify push might be using. This is not an internet problem on my end.

Running amplify api push results in a stack trace that mentions S3 as the reson for the timeout.

I have attached a screenshot below.

Error is: Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed. An error occured during the push operation: Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed.

Amplify CLI Version

4.18.0

Expected behavior

Pushing should not timeout.

Screenshots

image

Desktop (please complete the following information):

node -v: 13.7.0 Win10 with WSL2 (Ubuntu)

Additional context

This started happening yesterday, presumably related to schema changes but I’m not sure. The processing step before it starts “Updating resources in the cloud. This may take a few minutes…” has been taking longer and longer.

Has been reported several times but the issues are closed:

https://github.com/aws-amplify/amplify-cli/issues/462 https://github.com/aws-amplify/amplify-cli/issues/501 https://github.com/aws-amplify/amplify-cli/issues/2121

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 6
  • Comments: 50 (15 by maintainers)

Most upvoted comments

This is a pretty big issue since you are not able to deploy any complex app that has large set of changes.

So I was able to figure out what the issue was …

  • Amplify Push
  • Connections Opened ( S3/etc )
  • Amplify Build + Your Build
  • Build > S3 Socket Timeout time = Failure

@johnpc have you tried it with WSL2 (Ubuntu) with VS code? Although I have also seen it on Mac, but WSL2 produces it repeatedly. And it doesn’t have to be a complex app, a simple app built by following aws-amplify react tutorial will do the job. And it cannot be a internet speed issue.

I found the solution to the issue. I don’t usually give the solutions that take me a long time to figure out but this one’s on the house. Besides, its 2023 and even with the latest version of amplify this still occurs, and there’s no found solution, so let me explain. For those getting this error while trying to push an update via amplify, and who DO NOT have lambda functions within their app, because yes the node modules created by each lambda function will definitely cause this error being the size of each module. In fact I removed lambda from my direct project for that reason. Any lambda function I need to create, I do it from the console. But from the CLI the above error occurs when creating tables in the schema while already having many other tables created, especially complex tables, each referencing, and depending on other tables like the user table to a social media app. It seems to occur if you create too many properties on a new table or existing table at the same time. Especially properties with arrays/AWSJSON types. Amplify seems to rewrite the entire backend during each update. Try adding no more than a few properties at a time with String or Boolean types and only one property at a time with array types. This will solve the issue, but make sure after the fail happens that cloud formation is not in a suspended or still updating state. Easy fix after experiencing it many many many times. But you’re welcome, hope this helps

Having this issue – pushing just a few Lambdas with basic dependencies (total Amplify folder is 320 MB).

This issue is dramatically slowing down the development cycle. This issue seems to be persistent.

What resolution was there to this? We are encountering the same error. MicrosoftTeams-image (5)

@amcdnl are you available on our community Discord by chance? I can ping you there, or my user is @josef.

@johnpc - Make complex gql complile + codegen + builds amplify:typescript take >15s.