We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Compass T.
11 years agoNew member | Level 1
Getting 500 Internal Server Error on a remote server only -- works fine locally.
Hi there :)
I am using the Ruby SDK to interface with the Dropbox Core API. Locally, I am having no issues using the API in any way. On my AWS server, however, the DB API returns a 500 internal server error every time. This is not a sporadic issue, as it has occurred consistently, across on multiple days.
For reference, here is some sample code which works locally, but results in a 500 error on my EC2 instance:
```
session = DropboxSession.new(<app key>, <app secret>)
session.set_access_token(<access token>, <access token secret>)
client = DropboxClient.new(session, 'dropbox')
client.account_info
```
The error I'm getting:
```
DropboxError: Dropbox Server Error: #<Net::HTTPInternalServerError:0x000000067f9cd8> - {"error": "Internal Server Error"}
```
Anyone see this before / have any insight into what is going on here? Would really appreciate some help on this :)
6 Replies
Replies have been turned off for this discussion
- Greg-DB11 years ago
Dropbox Community Moderator
[Cross-linking for reference: https://stackoverflow.com/questions/32809360/dropbox-core-api-500-internal-server-error-on-a-remote-server-only-works-fine ]
A few questions to help track this down:
- Does this occur for every account_info call you make for that user on the AWS server?
- Are the app key/secret and access token/secret the same on the AWS server as on your local machine?
- Compass T.11 years agoNew member | Level 1
Hi Gregory -- thanks for getting back to me!
To your questions:
- Does this occur for every account_info call you make for that user on the AWS server?
Yes, every time.
- Are the app key/secret and access token/secret the same on the AWS server as on your local machine?
Yes, they are. I have also tried re-running the auth flow from the server in question, and then using the "new" access token / access secret, with the same result.
Please let me know if this wasn't clear of if I can provide any more info. Thanks again!
EDIT: Also, happy to hop on the phone/skype/screen share/whatever, if it will help resolve the issue. Feel free to email me at matt < at > hellocompass.us to coordinate.
- Greg-DB11 years ago
Dropbox Community Moderator
Thanks! In that case, can you make this small edit to the Ruby SDK to enable some additional debugging output? Just add this third line (with set_debug_output) after http is defined in the self.do_http def in the Dropbox module in dropbox_sdk.rb:
def self.do_http(uri, request) # :nodoc:
http = Net::HTTP.new(uri.host, uri.port)
http.set_debug_output $stderrThen please run the failing method again and copy over the resulting output. Be sure to redact secret values (such as the app secret and access token secret, but please keep the keys showing).
Feel free to open an API ticket with it instead if you'd prefer to share privately:
- Compass T.11 years agoNew member | Level 1
Thanks again Gregory!
I did that, and threw the result on pastebin, here: http://pastebin.com/kaUTdNqk
NOTE: after adding the debug line and a trailing new line to the self.do_http method indropbox_sdk.rb, the line numbers in the stacktrace are off by 2, when compared to the unaltered dropbox_sdk.rb file.
Please let me know if I can provide any additional info.
Thanks!
EDIT: I got the same result using both token / token secret pairs (one that I generated and use successfully, locally, and one I generated on the server in question)
- Greg-DB11 years ago
Dropbox Community Moderator
Thanks! It looks like the issue is that you have an extra comma character after each piece of your tokens. I.e., your oauth_consumer_key has a value like "xxxxxxxxxxxxxxxx," instead of "xxxxxxxxxxxxxxxx". We'll look into fixing our parsing so that we don't error out on that, but to get it working on your side, just remove that extra ","s.
- Compass T.11 years agoNew member | Level 1
Wow -- can't believe I did that. Definitely a case of 'error between user and keyboard': had commas in the server config YML (but not in my local config), as if the data was a ruby hash rather than YML markup.
Thanks so much, Gregory!
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!