ghostfolio-sync icon indicating copy to clipboard operation
ghostfolio-sync copied to clipboard

Help needed with setup: <Response [401]>

Open Egor-Li opened this issue 11 months ago • 2 comments

Hello, I'm getting this error in the logs:

[2025-12-05 08:52:11] Starting ghostfolio-sync Docker...
[2025-12-05 08:52:11] Crontab Not Present running one time now
2025-12-05 08:52:11,665 - __main__ - INFO - Starting sync for account 0: UXXXXX
2025-12-05 08:52:11,665 - SyncIBKR - INFO - Fetching Query
2025-12-05 08:52:12,475 - SyncIBKR - ERROR - Error getting currency from IBKR account statement: 'NoneType' object has no attribute 'currency'
2025-12-05 08:52:12,475 - SyncIBKR - INFO - Finding all accounts
Traceback (most recent call last):
  File "/usr/app/src/main.py", line 45, in <module>
    ghost.sync_ibkr()
  File "/usr/app/src/SyncIBKR.py", line 159, in sync_ibkr
    account_id = self.create_or_get_IBKR_accountId()
  File "/usr/app/src/SyncIBKR.py", line 379, in create_or_get_IBKR_accountId
    accounts = self.get_all_accounts()
  File "/usr/app/src/SyncIBKR.py", line 373, in get_all_accounts
    raise Exception(response)
Exception: <Response [401]>

I have setup up all the queries correctly and got the query ID and the token. What could be the issue?

This is my docker-compose.yml:

name: ghostfolio
services:
  ghostfolio:
    image: docker.io/ghostfolio/ghostfolio:latest
    container_name: ghostfolio
    restart: unless-stopped
    init: true
    cap_drop:
      - ALL
    security_opt:
      - no-new-privileges:true
    env_file:
      - ./.env
    ports:
      - 3333:3333
    depends_on:
      postgres:
        condition: service_healthy
      redis:
        condition: service_healthy
    healthcheck:
      test: ['CMD-SHELL', 'curl -f http://localhost:3333/api/v1/health']
      interval: 10s
      timeout: 5s
      retries: 5

  postgres:
    image: docker.io/library/postgres:15-alpine
    container_name: gf-postgres
    restart: unless-stopped
    cap_drop:
      - ALL
    cap_add:
      - CHOWN
      - DAC_READ_SEARCH
      - FOWNER
      - SETGID
      - SETUID
    security_opt:
      - no-new-privileges:true
    env_file:
      - ./.env
    healthcheck:
      test:
        ['CMD-SHELL', 'pg_isready -d "$${POSTGRES_DB}" -U $${POSTGRES_USER}']
      interval: 10s
      timeout: 5s
      retries: 5
    volumes:
      - ./postgres:/var/lib/postgresql/data

  redis:
    image: docker.io/library/redis:alpine
    container_name: gf-redis
    restart: unless-stopped
    user: '999:1000'
    cap_drop:
      - ALL
    security_opt:
      - no-new-privileges:true
    env_file:
      - ./.env
    command:
      - /bin/sh
      - -c
      - redis-server --requirepass "$${REDIS_PASSWORD:?REDIS_PASSWORD variable is not set}"
    healthcheck:
      test:
        ['CMD-SHELL', 'redis-cli --pass "$${REDIS_PASSWORD}" ping | grep PONG']
      interval: 10s
      timeout: 5s
      retries: 5

  ghostfolio-sync:
    image: agusalex/ghostfolio-sync
    container_name: gf-sync
    restart: unless-stopped
    depends_on:
      postgres:
        condition: service_healthy
      redis:
        condition: service_healthy
      ghostfolio:
        condition: service_healthy
    environment:
        - IBKR_QUERY=XXX
        - IBKR_TOKEN=XXX
        - GHOST_TOKEN=XXX
        - IBKR_ACCOUNT_ID=UXXX
        - GHOST_IBKR_PLATFORM=XXX
        - GHOST_CURRENCY=USD

Egor-Li avatar Dec 05 '25 08:12 Egor-Li

+1 - did you ever figure this out?

bucketphobia avatar Feb 19 '26 22:02 bucketphobia

+1 - did you ever figure this out?

Nope. I just gave up.

Egor-Li avatar Feb 20 '26 04:02 Egor-Li