binoculars/aws-lambda-ffmpeg

AWS Timeout

jeffkile opened this issue · 10 comments

Hi I'm getting a timeout when I run aws:default any ideas?

[22:19:33] 'aws:build-upload' errored after 57 s
[22:19:33] RequestTimeout in plugin 'run-sequence(aws:upload)'
Message:
    Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed.
Details:
    code: RequestTimeout
    region: null
    time: Mon May 29 2017 22:19:33 GMT-0700 (PDT)
    requestId: A0946E4F4CBC832A
    extendedRequestId: RH8XRBlPdmAI1BPvsYVTaQqnmg3MLGtR+/vej23V1gXBbIBReVGRTGs8KDOHAEIZNJ6LgxfUpBjO+UJkY+lyAANxNfiu0HSd
    cfId: undefined
    statusCode: 400
    retryable: true
Stack:
RequestTimeout: Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed.
    at Request.extractError (/Users/jeff/video-toad/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/services/s3.js:539:35)
    at Request.callListeners (/Users/jeff/video-toad/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/sequential_executor.js:105:20)
    at Request.emit (/Users/jeff/video-toad/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
    at Request.emit (/Users/jeff/video-toad/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/request.js:673:14)
    at Request.transition (/Users/jeff/video-toad/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/Users/jeff/video-toad/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /Users/jeff/video-toad/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/Users/jeff/video-toad/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/Users/jeff/video-toad/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/request.js:675:12)
    at Request.callListeners (/Users/jeff/video-toad/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/sequential_executor.js:115:18)

Looks like the upload to S3 timed out. I haven't seen that before. Are you uploading to a bucket in the region closest to you?

It doesn't look like region is being set:

[09:53:33] 'aws:build-upload' errored after 1.53 min
[09:53:33] RequestTimeout in plugin 'run-sequence(aws:upload)'
Message:
    Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed.
Details:
    code: RequestTimeout
    region: null
    time: Sun Jun 04 2017 09:53:33 GMT-0700 (PDT)
     cfId: undefined
    statusCode: 400
    retryable: true

I print out my process.env and I see it in there:
AWS_REGION: 'us-west-1',

I experience the same problem. My region is eu-west-1.

Do you have the right credentials and permissions for that region? Also, any firewall restrictions?

You have to have created the function bucket and have permissions to upload to it as well.

@binoculars Is the upload function using AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY from the environment variables? My user have full access to everything.

🤷‍♂️

Ok, I found the problem. My bucket was in the wrong region 🙃

👍 I can see how that is difficult to figure out from the error. Glad you were able to find it though.

Same, I had us-west-1 and us-west-2 mixed up. Thanks