andreafabrizi / Dropbox-Uploader

Dropbox Uploader is a BASH script which can be used to upload, download, list or delete files from Dropbox, an online file sharing, synchronization and backup service.
https://www.andreafabrizi.it/2016/01/01/Dropbox-Uploader/
GNU General Public License v3.0
6.56k stars 1.08k forks source link

'An error occurred requesting /upload\n' #335

Closed genemoore42 closed 7 years ago

genemoore42 commented 7 years ago

I just re-installed dropbox_uploader on a fresh install of Raspbian (on a Pi2). The upload functionality is throwing an error. (Please note: I can use other uploader.sh functions such as list to gain access to my dropbox folder so am assuming there is not problem with my auth token). Any suggestions for correcting this problem would be appreciated. Also, is there a way to input a new auth token for a newly created app on dropbox? when I removed the folder (sudo rm -r Dropbox-Uploader) and re-installed it did not prompt me for a new access token.

Content of -d debug output:

sudo ./dropbox_uploader.sh -d -p upload /home/krishna/Pictures/image1.jpg image1.jpg 1.0 Linux harekrishna 4.4.26-v7+ #915 SMP Thu Oct 20 17:08:44 BST 2016 armv7l GNU/Linux Raspbian GNU/Linux 8 \n \l

Content of /tmp/du_resp/debug:

HTTP/1.1 100 Continue

HTTP/1.1 500 Internal Server Error Server: nginx Date: Wed, 26 Oct 2016 22:56:30 GMT Content-Type: text/plain; charset=utf-8 Transfer-Encoding: chunked Connection: keep-alive X-Dropbox-Request-Id: 9b7b47b561a8c62bd61962af8ec1f97b X-Robots-Tag: noindex, nofollow, noimageindex

barbalex commented 7 years ago

@genemoore42 I have same error message. You closed this issue. Why? How could you resolve the issue?

bob10818 commented 6 years ago

I have exactly the same issue. Python program was working fine previously before the APIv2 upgrade. Loaded new Pi 2 with latest Raspian, loaded latest Dropbox-Uploader, ran .dropbox_uploader.sh and got Access Token as requested. Ran test .dropbox_uploader.sh upload ...., which worked fine - test file on Dropbox as expected. But when I call the shell from my Python program I get the message "An error occurred requesting /upload". Debug file attached. I am trying to send a jpg file to a new (to be created) folder on dropbox, which worked before.

debug file.txt

In the previous incarnation, I was asked for the Access key and Secret key when I first ran the program. That doesn't happen any more. But the "Authorization: Bearer ....." looks like one of those keys, but not one I have seen before.

bob10818 commented 6 years ago

DB Uploader debug.txt This is driving me mad. It started working perfectly yesterday. Now today it fails every time. Attached the latest debug output. If I run dropbox_uploader.sh or dropShell.sh from the command line, it works fine, so I assume the access token is OK. But when I run dropbox_uploader.sh through a subprocess call in my Python program, it fails. But it worked yesterday!!! I've tried rebooting the computer, reloaded Dropbox-Uploader, deleted the ~/.dropbox-uploader file with the Auth Key, created a new App and reset the key. Interestingly, if I run from the shell after deleting the Auth key, it asks to create a new app and key, but not if run through the Python program. Is there another config file or something I need to delete and rebuild?

bob10818 commented 6 years ago

Ah, I think I have the answer - I had trailing spaces in some of the directory names. Either Dropbox or the Uploader didn't like this, and it now works with the spaces stripped out. I have to say, the error message is not entirely helpful. I spent ages trying to resolve authentication and all kinds of other issues which didn't exist.