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

Download Doc fails with API error #19

Closed
christianst1984 opened this issue Jan 12, 2022 · 4 comments
Closed

Download Doc fails with API error #19

christianst1984 opened this issue Jan 12, 2022 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@christianst1984
Copy link

christianst1984 commented Jan 12, 2022

Description of the bug
When downloading all docs from timeline, it fails always around the same area.

To Reproduce
Steps to reproduce the behavior:

  1. Go to /Users/Christian/Documents/TR/pdf
  2. Ran the command pytr dl_docs ./
  3. Wait for documents to load
  4. See error

Expected behavior
All documents download, eventually (API-) failing documents are ignored and outputted to the end (e.g. for manual validation via app).

Error log

21:48:46 573/757: Verkauf [redacted]
21:48:46 Received error message: '600 E {"errors":[{"errorCode":"UNKNOWN_ERROR","errorField":null,"errorMessage":"Unknown error","meta":{"source":"PLATFORM"}}]}'
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.10/bin/pytr", line 8, in <module>
    sys.exit(main())
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pytr/main.py", line 130, in main
    asyncio.get_event_loop().run_until_complete(dl.dl_loop())
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py", line 641, in run_until_complete
    return future.result()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pytr/dl.py", line 39, in dl_loop
    _subscription_id, subscription, response = await self.tr.recv()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pytr/api.py", line 345, in recv
    raise TradeRepublicError(subscription_id, subscription, payload)
pytr.api.TradeRepublicError: ('600', {'type': 'timelineDetail', 'id': '[redacted]'}, {'errors': [{'errorCode': 'UNKNOWN_ERROR', 'errorField': None, 'errorMessage': 'Unknown error', 'meta': {'source': 'PLATFORM'}}]})
Christians-MacBook-Air:pdf Christian$ 

Environment

  • OS: Mac OS 10.15.7 Darwin Christians-MacBook-Air.local 19.6.0 Darwin Kernel Version 19.6.0: Tue Nov 10 00:10:30 PST 2020; root:xnu-6153.141.10~1/RELEASE_X86_64 x86_64
  • pytr version: 0.0.18

Additional context
Download works until reaching the same time area via e.g.
pytr dl_docs --last_days 65 ./

@christianst1984 christianst1984 added the bug Something isn't working label Jan 12, 2022
@marzzzello
Copy link
Collaborator

Do you know what kind of document it tries to download?

@christianst1984
Copy link
Author

I assume* it's a "Gutschrift" (credit voucher) with a negative value (i.e. cost for me) on dividends.
It's not opening in the app, too, and I've now opened a support case with TR on this.

  • narrowed this down to a date by playing with last_days parameter until it repeatedly fails, following by trying all documents manually in app where one fails as well.

Need to find out if it's possible to ignore a certain timeline ID so it does not try to fetch it via API.
(After the error pytr does not immediately terminate, but does not create add. output or downloads any files if it occurs.)

@marzzzello
Copy link
Collaborator

Yes, I need to implement some better error handling

@achisto
Copy link

achisto commented Feb 5, 2022

I ran into the same problem and was also able to narrow it down to what I believe is the cause, just as with @christianst1984 I have one entry that doesn't open inside my app, although it's not a "Gutschrift" but an entry related to a merger of two companies.

Is there some way to tell the script to only download UNTIL a certain date? I really need to bulk download everything from 2020 but the only code I was able to find was something for the LAST days, for example pytr dl_docs --last_days 85 .

If there was another command that I don't yet know this could help "solve" the problem of the script's error handling for now.

@marzzzello marzzzello self-assigned this Feb 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants