amplify-cli icon indicating copy to clipboard operation
amplify-cli copied to clipboard

Amplify push fails with Connection timed out after 120000ms

Open kimfucious opened this issue 6 years ago • 17 comments

Note: If your issue/bug is regarding the AWS Amplify Console service, please log it in the Amplify Console GitHub Issue Tracker

Describe the bug I just upgraded amplify cli to 4.30.0, from a few versions back, and now I am unable to perform an amplify push that I was able to do prior to the upgrade.

The following error is thrown:

Connection timed out after 120000ms
An error occurred during the push operation: Connection timed out after 120000ms

Amplify CLI Version 4.30.0

To Reproduce Upgrade to v 4.30.0 Run and amplify push

Expected behavior It should push without an error

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows 10 (PowerShell)
  • Node Version: v12.18.3

Additional context I'm gonna start rolling back to old versions, but it would be nice to know how to resolve this; thanks.

kimfucious avatar Oct 22 '20 11:10 kimfucious

FYI: rolling back to 4.26.0 got me back to pushability... I'll forward until it breaks and report back, time-permitting.

kimfucious avatar Oct 22 '20 15:10 kimfucious

Hi @kimfucious, do you have lambda layers configured in your project?

nikhname avatar Oct 22 '20 17:10 nikhname

@kimfucious Curious to know if there any other operation logs pre the connection timeout error. Did the CloudFormation deployment even start?

kaustavghosh06 avatar Oct 23 '20 00:10 kaustavghosh06

Hi @kimfucious, do you have lambda layers configured in your project?

Hi @nikhname, thanks for the quick response. I do not have lambda layers configured for this project.

kimfucious avatar Oct 23 '20 03:10 kimfucious

@kimfucious Curious to know if there any other operation logs pre the connection timeout error. Did the CloudFormation deployment even start?

Hi @kaustavghosh06, thanks for the follow up.

The process starts as normal, and asks (Y/N) if you want to do the push.

Then, and this was new with 4.30.0, I got a little spinner that said, "Uploading files 90%".

It stays like that for a while, (probably 2 mins/120K ms, I didn't time it), and then it throws the error noted above with nothing else logged to the console.

Please let me know if/how I can provide more info, if you need it.

kimfucious avatar Oct 23 '20 03:10 kimfucious

Hi @kaustavghosh06 & @nikhname,

This may be a non-issue. I upped the version incrementally from 4.26.0, doing pushes along the way.

And when I just pushed while on v.4.30.0, it worked without error.

I'll work with v.4.30.0 for a while to see if the issue presents itself, and will report back here with the results.

kimfucious avatar Oct 23 '20 04:10 kimfucious

@kimfucious Thanks for getting back to us on this. Closing this issue for now but please comment on this thread if you see this again.

kaustavghosh06 avatar Oct 23 '20 04:10 kaustavghosh06

Hi @kaustavghosh06,

This did reoccur. It didn't prior, I believe, as I was updating a different function than the one that apparently causes this error.

Here's the error that occurs when I run amplify push on the function in question:

PS D:\Users\Kim\Dev\Sites\workspace\slugbucket> amplify push
√ Successfully pulled backend environment dev from the cloud.

Current Environment: dev

| Category | Resource name                | Operation | Provider plugin   |
| -------- | ---------------------------- | --------- | ----------------- |
| Function | myCoolFunction               | Update    | awscloudformation |
...

? Are you sure you want to continue? Yes
× An error occurred when pushing the resources to the cloud

Connection timed out after 120000ms
An error occurred during the push operation: Connection timed out after 120000ms

There is an "Uploading files..." spinner that shows for two mins, but is removed once the error shows, so it doesn't show in the above. It looks like the below, until the error is thrown:

? Are you sure you want to continue? Yes
- Uploading Files...90%

This function is a bit larger that other functions that I've pushed before, which may be part of the problem:

  • The size of the dist directory for this function is: 22MB
  • The size of the src directory is: 127MB

Reverting to v4.26.0 seems to fix this issue for now. I'll work forward until it breaks and let you know.

kimfucious avatar Oct 23 '20 10:10 kimfucious

Hi @kaustavghosh06,

I'm sure you're busy, but I'm not sure you see comment activity once an issue is closed.

I've wait a bit and open a new ticket, if I don't hear back.

kimfucious avatar Oct 28 '20 11:10 kimfucious

I get this same issue as well. I have to use amplify push several times before cli gets passed "uploading files..." state. I am pretty sure it is a network / firewall issue since I never get this issue at Home, but when I am at my friends house I do. Not sure how to fix though

gabrielgrover avatar Dec 10 '20 20:12 gabrielgrover

Disabling firewall did not help me.

jaibatrik avatar Dec 12 '20 07:12 jaibatrik

So this problem is still persisting for me. The issue for me is that my project has a lot of lambda functions. When I use amplify push on a newly created environment i get timeouts because my upload speed is not the greatest. Maybe increase the timeout threshold?

gabrielgrover avatar Dec 18 '20 04:12 gabrielgrover

@gabrielgrover With the latest version of the CLI, we've optimized what we upload to the S3 deployment bucket - previously we were uploading the node_modules for the functions, increasing the wait times and causing connection timeouts. Could you please give this another shot and let us know if the problem still persists. If it does, would love to know your project size and the resources you've added to your project.

kaustavghosh06 avatar Mar 19 '21 20:03 kaustavghosh06

Hi @kaustavghosh06 and @kimfucious

I'm facing the same issue right now... I did a bash script to build my Node.js lambda, once they were coded using Typescript I needed to do it. But when I run "amplify push -y" I'm always getting the error below:

Connection timed out after 120000ms
An error occurred during the push operation: Connection timed out after 120000ms

image

But the weird thing is that if I just update one resource like my API Gateway, so then I don't get any error, and it works fine!

Amplify CLI Version Screen Shot 2021-03-30 at 18 44 51

Any help guys ?

wellmmer avatar Mar 30 '21 21:03 wellmmer

Sometimes the error is this one below...

image

wellmmer avatar Mar 30 '21 21:03 wellmmer

Hello @kaustavghosh06 this is also happening to me consistently. I'm using:

  • Node version: v14.15.4
  • Amplify CLI version: @aws-amplify/[email protected] (latest, AFAIK)
$ amplify push
✔ Successfully pulled backend environment dev from the cloud.

Current Environment: dev

| Category | Resource name         | Operation | Provider plugin   |
| -------- | --------------------- | --------- | ----------------- |
| Storage  | dynamo47866d4f        | Create    | awscloudformation |
| Function | reactamplify2829389a6 | Create    | awscloudformation |
| Auth     | cognito4693ee74       | Create    | awscloudformation |
| Api      | apie323780f           | Create    | awscloudformation |
? Are you sure you want to continue? Yes
✖ An error occurred when pushing the resources to the cloud

Connection timed out after 120000ms
An error occurred during the push operation: Connection timed out after 120000ms

I have checked my internet connection and tried this multiple times but it's always the same. Shall we reopen the issue?

jazu-dev avatar May 13 '21 17:05 jazu-dev

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.

github-actions[bot] avatar Jun 12 '21 18:06 github-actions[bot]