Skip to content
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

"Failed to upload" error #4

Open
AndrewSouthpaw opened this issue Feb 5, 2015 · 6 comments
Open

"Failed to upload" error #4

AndrewSouthpaw opened this issue Feb 5, 2015 · 6 comments

Comments

@AndrewSouthpaw
Copy link

I'm receiving a nondescript error in notifications after taking the screenshot:

Upload Failed <...>

There is no error output to the console. I have triple-checked my AWS key/secret, there's no error there. I also set the bucket policy as mentioned in the README. Am I missing anything else?

Here's my config.json:

{
  "watch": "/Users/asmith/Desktop",
  "matchCriteria": {
    "startsWith": "Screen Shot",
    "endsWith": ".png"
  },
  "aws": {
    "region": "Oregon",
    "accessKeyId": snip,
    "secretAccessKey": snip,
    "s3": {
      "bucket": "screenshots-andrew-smith",
      "keyPrefix": "screen-shots/"
    }
  }
}

@ltk
Copy link
Owner

ltk commented Feb 5, 2015

I suspect your error is caused by using the name of the AWS region instead of the region's code. I believe the code for the Oregon AWS region is us-west-2. Try swapping that out and let me know if it works.

Also be sure that the screen-shots directory already exists in your screenshots-andrew-smith bucket.

@AndrewSouthpaw
Copy link
Author

Excellent! Thanks for your help. I really like the idea of your service, and want to make it work. :)

Now I'm running into a different error... I've changed keyPrefix to be "". When I paste in the URL copied to my clipboard, I get this message:

screen shot 2015-02-05 at 12 00 24 pm

@AndrewSouthpaw
Copy link
Author

Solved the issue. Because mine is not in US standard, I need to change the endpoint to:

https://<bucket>.s3.amazonaws.com/<key>

It's a one-line fix, would you like a PR for configuring the service for non-US Standard?

@ltk
Copy link
Owner

ltk commented Feb 19, 2015

Yeah, that'd be great! Thanks.

@sundeepgupta
Copy link

I ran into the same issue, corrected it, but unable to push my branch up. Could you fix it:

diff --git a/lib/s3_object.js b/lib/s3_object.js
index d9f8278..0002240 100644
--- a/lib/s3_object.js
+++ b/lib/s3_object.js
@@ -3,7 +3,7 @@ var S3Object = function(s3, key, body, contentType) {
   this.contentType = contentType;
   this.key  = key;
   this.s3   = s3;
-  this.url  = 'https://s3.amazonaws.com/' + this.s3.config.params.Bucket + '/' + this.key;
+  this.url  = 'https://' + this.s3.config.params.Bucket + '.s3.amazonaws.com/' + this.key;
 };

 S3Object.prototype.upload = function(callback) {

@sundeepgupta
Copy link

Ah, never mind. I created pull request: #6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants