-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
S3 upload fails with "Need to rewind the stream" error #68
Comments
Same here 😞 |
Hm, can you check if this still happens in version-minus-point-one? I merged in a PR yesterday, perhaps that's causing this. |
yes Installing collected packages: zappa
Found existing installation: zappa 0.17.5
Uninstalling zappa-0.17.5:
Successfully uninstalled zappa-0.17.5
Successfully installed zappa-0.17.4
(env)Johannness-MacBook-Air-2:lex-zapa johannes$ zappa deploy prod
Updating zappa-permissions policy on ZappaLambdaExecution IAM Role.
Packaging project as zip...
Uploading zip (13.1MiB)...
0%| | 0.00/13.8M [00:00<?, ?it/s]Failed to upload lex-zapa-prod-1461607365.zip to lex-zappa/lex-zapa-prod-1461607365.zip: Need to rewind the stream <boto3.s3.transfer.ReadFileChunk object at 0x107a1cf50>, but stream is not seekable.
An error occurred (InvalidParameterValueException) when calling the CreateFunction operation: Error occurred while GetObject. S3 Error Code: NoSuchKey. S3 Error Message: The specified key does not exist. |
works on 0.16.0 |
I had this issue today too, but apparently the problem was with aws_region. Make sure you haven't already created the bucket, and if you did, make sure it's in the region you expect it to be. |
What was the problem with aws_region? It should warn about that. I'm worried this is related to dependencies. It also shows the problems of using placebo for our testing! :[ |
Not able to reproduce with latest code and deps. Can you please give the command you used (deploy? update?) and your zappa_settings so that I can diagnose? |
|
@bennybauer isn't S3 region independent? |
Hm, can't reproduce. Are you using any other zappa_settings? |
I also tried with 0.16.0 and verified it working. This is my zappa_settings: |
Hmm. Interesting. I tried from version 1.17.0 to 1.17.5 and it works with all versions now. I can't repro it anymore. |
Weird. Maybe it was related to an AWS outage? |
I'm going to leave this ticket open until we can resolve the source of the issue, but I hope that things are working well for you now. Thanks for using Zappa, please let me know if there's anything else we can do to improve it! |
@codingjoe S3 has regions and us-east-1 is the default. You can choose it when you create the bucket. More here: http://aws.amazon.com/s3/faqs/#regions |
@bennybauer and @codingjoe - can you confirm that this problem has resolved itself? |
@Miserlou I don't know if it was related, but it started working only when region in zappa_settings.json was set to 'us-east-1'. |
@Miserlou I was able to reproduce:
|
Ah! Excellent! Okay, great, thanks for reporting steps. Looks like it's not respecting the aws_region setting when creating the Lambda function. |
Do you have multiple profiles in your AWS credentials file? |
Yes :) |
Okay, this one ended up being super weird. I honestly still don't know what's happening here since here, but I've opened an upstream ticket to hopefully explain this. I haven't actually fixed the bug, but I have implemented a workaround. The drawback is that there won't be a progress bar for some S3 regions, but that's not the end of the world. Fix pushed in 0.17.6. |
For the record, I had only one profile in AWS config while executing the command. |
I encountered the following error while playing with zappa:
Packaging project as zip...
Uploading zip (15.1MiB)...
0%| | 0.00/15.9M [00:00<?, ?it/s]Failed to upload zappa-beta-1461586412.zip to scoop-lambda/zappa-beta-1461586412.zip: Need to rewind the stream <boto3.s3.transfer.ReadFileChunk object at 0x1070a2690>, but stream is not seekable.
I manually tried to upload a file to the same bucket using AWS CLI tool and it worked without any issue. Is this a known problem?
The text was updated successfully, but these errors were encountered: