agusalex / ghostfolio-sync

Sync Ghostfolio with IBKR
30 stars 9 forks source link

Failed download statements #16

Closed rodriguestiago0 closed 2 months ago

rodriguestiago0 commented 7 months ago

Hey,

Getting an error trying to sync between IBKR and self-hosted ghostfolio.

Traceback (most recent call last):
  File "/usr/app/src/main.py", line 22, in <module>
    ghost.sync_ibkr()
  File "/usr/app/src/SyncIBKR.py", line 69, in sync_ibkr
    response = client.download(self.ibkrtoken, self.ibkrquery)
  File "/usr/local/lib/python3.9/site-packages/ibflex/client.py", line 114, in download
    stmt_access = request_statement(token, query_id)
  File "/usr/local/lib/python3.9/site-packages/ibflex/client.py", line 142, in request_statement
    raise ResponseCodeError(

Request

docker run -e GHOST_TOKEN="token "-e IBKR_TOKEN=token -e IBKR_QUERY=Ghostfolio -e GHOST_HOST=localhost agusalex/ghostfolio-sync
agusalex commented 7 months ago

I think the error part got cut, isn't it ? what comes after raise ResponseCodeError( ?

rodriguestiago0 commented 7 months ago
Traceback (most recent call last):
  File "/usr/app/src/main.py", line 22, in <module>
    ghost.sync_ibkr()
  File "/usr/app/src/SyncIBKR.py", line 69, in sync_ibkr
    response = client.download(self.ibkrtoken, self.ibkrquery)
  File "/usr/local/lib/python3.9/site-packages/ibflex/client.py", line 114, in download
    stmt_access = request_statement(token, query_id)
  File "/usr/local/lib/python3.9/site-packages/ibflex/client.py", line 142, in request_statement
    raise ResponseCodeError(
ibflex.client.ResponseCodeError: Code=1020: Invalid request or unable to validate request.

full error

agusalex commented 7 months ago

So it seems IBKR itself is not validating the request. I just updated IBFlex lib, I suggest that you try again downloading the latest image. If this keeps happening, check token and ID and then if the issue persists this one is actually for https://github.com/csingley/ibflex