-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
Occasionally getting struct.error
exception on fresh sync
#3
Comments
struct.error: unpack requires a buffer of 1 bytes
on fresh sync
struct.error: unpack requires a buffer of 1 bytes
on fresh syncstruct.error
excpetion on fresh sync
struct.error
excpetion on fresh syncstruct.error
exception on fresh sync
This might be the fix: Evernote/evernote-sdk-python3@9219222 |
This fix is already applied to the SDK version that I use. It seems like a recurring problem on the side of the Evernote server. I think I can fix it by making the request retry a couple of times before failing. Does it happen on random notes? Is the traceback the same every time? |
Yes it seems to be inconsistent. If I try again in a few hours, sometimes it completes successfully. I think retries would likely address the issue. However even with retries, I think the more important solution would be to catch the error and help the user understand what to do about it. In particular, whether the sync data (database) has been left in an inconsistent state and perhaps needs a full fresh sync, or whether simply restarting the |
The problem is that server returns 4xx or 5xx error instead of expected binary data due to some overload issues. Yes, I should make it more clear to the user when things go south and what to do about it. As for consistency, the database stays safe in case of any remote server errors. You can just run the sync again and it will download all notes that it missed when an exception occurred. Network exceptions happen before anything is written to the database and every commit to the database is atomic, so nothing to worry about. You don't have to rebuild from scratch. |
Check out the new version. Now it will retry when the server sends bad data. |
So far so good, although I'm not sure if I'd be able to tell whether this exception-retry mechanism kicked in during my tests. If this sporadic bad data situation occurs, will it still show up in the |
Yes, you will see "Remote server returned bad data while downloading note [xxx], retrying..." messages in the log. |
Confirmed. I ran 6 full fresh syncs over the past 2 days and on two occasions it caught and recovered from the bad data exception. Well done! |
Ran a full fresh sync overnight and ran into this failure:
This looks to be related to Evernote/evernote-sdk-python3#27. That issue is open, but in the discussion thread it looks like Evernote may have patched it earlier this year in a recent build of the Python3 SDK?
The text was updated successfully, but these errors were encountered: