jakajancar/DropboxUploader

Sporadic ERROR: Cannot extract token! (form action=https://dl-web.dropbox.com/upload)

hakre opened this issue · 11 comments

A sporadic (two out of three)

ERROR: Cannot extract token! (form action=https://dl-web.dropbox.com/upload)

has been reported ca. 2013-01-09T00:00:00+00:00.

There is probably a mismatch with either the HTML or the token-pattern (most likely the later).

Same issue here

@dexigner I just tried to reproduce this but was not able to. The error really looks sporadic. Please also try to reproduce and report when this occurred and how often. Because if it does not solve on it's own (e.g. problem on the end of dropbox), this would require adding logging to the class to better troubleshoot the issue.

Happens to me for 1-2 months, totally random. 3 distinct errors in last 24 hours.

dropbox-uploader.php(86): DropboxUploader->extractToken('HTTP/1.1 503 Se...', 'https://dl-web....')
dropbox-uploader.php(86): DropboxUploader->extractToken('HTTP/1.1 502 Ba...', 'https://dl-web....')
PHP Fatal error: Uncaught exception 'Exception' with message 'Curl error: (#52) Empty reply from server'

extractToken('HTTP/1.1 503                                       
extractToken('HTTP/1.1 502
                       5XX

The status codes from the 5XX range signal a server-error on the other end. So this is a problem the class has no influence on - however the error reporting or handling can probably be improved.

Is there any kind of error message or handling you would suggest in case there is a distinct error on the remote side?

It would be nice to have an option to retry (once more with delay), if the uploader couldn't extract a token.

Please suggest a useful "default" retry/delay time combination.

2 retries with 30 second delay?

I'm yet not sure if this sort of transaction management should go in. Another reporter is running into curl error 52 as well and has shared some feedback in the just referenced issue. First improvement is to make the HTTP status line visible with the error message probably (if there was one). If this not even needs to make use of curl's verbose mode for debugging purposes.

I just got tonigh a sporadic (1/3)

ERROR: Login unsuccessful

For the first of three upload transactions.

Upload transactions should be able to verify via the activity feed (if not disabled in options).

@Dexinger: The DropboxUploader class now has a retry() method in the upload-retry development branch.

You can now catch the Exception and based on the new error codes you can decide to retry or not. For your timing needs the number of retries in form of microtimestamps are collected as well and you can get them with getRetries().

I close this ticket for now, feel free to re-open it when you provide feedback.