cioraneanu / firefly-pico

A delightful Firefly III companion web app for effortless transaction tracking
GNU Affero General Public License v3.0
257 stars 13 forks source link

[ISSUE] The provided endpoint + token is not correct. #1

Closed Teonyr closed 2 months ago

Teonyr commented 2 months ago

Issue

Hey, I'm trying to get pico up and running. Since I already have a firefly instance on docker, I used the docker-compose.pico.yml as a start.

But when entering my access token, I receive "The provided endpoint + token is not correct." grafik

No matter what I enter there, it always shows the same error.

docker-compose.yml

(Only the pico - part)

  firefly-pico:
    image: cioraneanu/firefly-pico:latest
    container_name: firefly-pico
    environment:
      - FIREFLY_URL=http://firefly-app
      - DB_CONNECTION=pgsql
      - DB_HOST=firefly-pico-postgresql
      - DB_PORT=5432
      - DB_DATABASE=firefly-pico
      - DB_USERNAME=firefly-pico
      - DB_PASSWORD=[REDACTED]
    depends_on:
      - firefly-pico-postgresql
    labels:
      traefik.enable: true
      traefik.http.routers.firefly-pico.entrypoints: web, websecure
      traefik.http.routers.firefly-pico.tls: true
      traefik.http.routers.firefly-pico.rule: (Host(`financepico.anubis.arpa`) )
      traefik.http.services.firefly-pico.loadbalancer.server.port: 80
      traefik.http.services.firefly-pico.loadbalancer.passHostHeader: true
    restart: unless-stopped
    networks:
      - backend
    ports:
      - 6976:80
  firefly-pico-postgresql:
    container_name: firefly-pico-postgresql
    image: postgres:latest
    environment:
      POSTGRES_DB: firefly-pico
      POSTGRES_USER: firefly-pico
      POSTGRES_PASSWORD: [REDACTED]
    volumes:
      - /persistent/firefly/pico:/var/lib/postgresql/data
    restart: unless-stopped
    networks:
      - backend
networks:
  backend:
    external: true

Log

06.05.2024 10:40:14 /docker-entrypoint.d/ is not empty, will attempt to perform configuration 06.05.2024 10:40:14 Looking for shell scripts in /docker-entrypoint.d/ 06.05.2024 10:40:14 Launching /docker-entrypoint.d/1-configure-php.sh 06.05.2024 10:40:14 Configure php 06.05.2024 10:40:14 Launching /docker-entrypoint.d/2-configure-php-opcache.sh 06.05.2024 10:40:14 Configure php opcache 06.05.2024 10:40:14 Launching /docker-entrypoint.d/3-configure-php-fpm.sh 06.05.2024 10:40:14 Configure php-fpm 06.05.2024 10:40:14 Launching /docker-entrypoint.d/4-configure-nginx.sh 06.05.2024 10:40:14 Configure nginx 06.05.2024 10:40:14 Launching /docker-entrypoint.d/5-configure-laravel-scheduler.sh 06.05.2024 10:40:14 Configure laravel scheduler 06.05.2024 10:40:14 Launching /docker-entrypoint.d/6-configure-laravel-horizon.sh 06.05.2024 10:40:14 Configure laravel horizon 06.05.2024 10:40:14 Launching /docker-entrypoint.d/10-configure-back.sh 06.05.2024 10:40:14 Configure app 06.05.2024 10:40:15 06.05.2024 10:40:15 INFO Nothing to migrate.
06.05.2024 10:40:15 06.05.2024 10:40:15 Configuration complete; ready for start up 06.05.2024 10:40:15 Running CMD: /bin/sh -c supervisord -c /etc/supervisord.conf 06.05.2024 10:40:15 2024-05-06 11:40:15,423 INFO Included extra file "/etc/supervisor.d/cron.ini" during parsing 06.05.2024 10:40:15 2024-05-06 11:40:15,423 INFO Included extra file "/etc/supervisor.d/nginx.ini" during parsing 06.05.2024 10:40:15 2024-05-06 11:40:15,423 INFO Included extra file "/etc/supervisor.d/node.ini" during parsing 06.05.2024 10:40:15 2024-05-06 11:40:15,423 INFO Included extra file "/etc/supervisor.d/php-fpm.ini" during parsing 06.05.2024 10:40:15 2024-05-06 11:40:15,424 INFO Set uid to user 0 succeeded 06.05.2024 10:40:15 2024-05-06 11:40:15,426 INFO RPC interface 'supervisor' initialized 06.05.2024 10:40:15 2024-05-06 11:40:15,426 CRIT Server 'unix_http_server' running without any HTTP authentication checking 06.05.2024 10:40:15 2024-05-06 11:40:15,426 INFO supervisord started with pid 1 06.05.2024 10:40:16 2024-05-06 11:40:16,428 INFO spawned: 'cron_00' with pid 43 06.05.2024 10:40:16 2024-05-06 11:40:16,429 INFO spawned: 'nginx_00' with pid 44 06.05.2024 10:40:16 2024-05-06 11:40:16,430 INFO spawned: 'node_00' with pid 45 06.05.2024 10:40:16 2024-05-06 11:40:16,432 INFO spawned: 'php-fpm_00' with pid 46 06.05.2024 10:40:16 [06-May-2024 11:40:16] NOTICE: fpm is running, pid 46 06.05.2024 10:40:16 [06-May-2024 11:40:16] NOTICE: ready to handle connections 06.05.2024 10:40:16 06.05.2024 10:40:16 > prod 06.05.2024 10:40:16 > node .output/server/index.mjs 06.05.2024 10:40:16 06.05.2024 10:40:16 Listening on http://[::]:3000 06.05.2024 10:40:17 2024-05-06 11:40:17,795 INFO success: cron_00 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 06.05.2024 10:40:17 2024-05-06 11:40:17,795 INFO success: nginx_00 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 06.05.2024 10:40:17 2024-05-06 11:40:17,795 INFO success: node_00 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 06.05.2024 10:40:17 2024-05-06 11:40:17,795 INFO success: php-fpm_00 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 06.05.2024 10:40:27 172.18.0.12 - - [06/May/2024:11:40:27 +0300] [0.118] [0.118] "GET / HTTP/1.1" 200 1990 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:124.0) Gecko/20100101 Firefox/124.0" "192.168.158.30" 06.05.2024 10:40:37 172.18.0.12 - - [06/May/2024:11:40:37 +0300] [0.007] [0.007] "GET /_nuxt/DZR9EdxA.js HTTP/1.1" 200 15474 "https://financepico.anubis.arpa/dashboard" "Mozilla/5.0 (X11; Linux x86_64; rv:124.0) Gecko/20100101 Firefox/124.0" "192.168.158.30" 06.05.2024 10:40:37 172.18.0.12 - - [06/May/2024:11:40:37 +0300] [0.007] [0.007] "GET /_nuxt/Bm1WTANA.js HTTP/1.1" 200 3308 "https://financepico.anubis.arpa/dashboard" "Mozilla/5.0 (X11; Linux x86_64; rv:124.0) Gecko/20100101 Firefox/124.0" "192.168.158.30" 06.05.2024 10:40:37 172.18.0.12 - - [06/May/2024:11:40:37 +0300] [0.007] [0.007] "GET /_nuxt/useList.xR_DZ-hU.css HTTP/1.1" 200 558 "https://financepico.anubis.arpa/dashboard" "Mozilla/5.0 (X11; Linux x86_64; rv:124.0) Gecko/20100101 Firefox/124.0" "192.168.158.30" 06.05.2024 10:40:37 172.18.0.12 - - [06/May/2024:11:40:37 +0300] [0.006] [0.006] "GET /_nuxt/CTQgxhJG.js HTTP/1.1" 200 5869 "https://financepico.anubis.arpa/dashboard" "Mozilla/5.0 (X11; Linux x86_64; rv:124.0) Gecko/20100101 Firefox/124.0" "192.168.158.30" 06.05.2024 10:40:37 172.18.0.12 - - [06/May/2024:11:40:37 +0300] [0.007] [0.006] "GET /_nuxt/list.CRCKH7wV.css HTTP/1.1" 200 2234 "https://financepico.anubis.arpa/dashboard" "Mozilla/5.0 (X11; Linux x86_64; rv:124.0) Gecko/20100101 Firefox/124.0" "192.168.158.30" 06.05.2024 10:40:56 172.18.0.12 - - [06/May/2024:11:40:56 +0300] [0.153] [0.153] "GET /api/user HTTP/1.1" 500 12487 "https://financepico.anubis.arpa/settings/app-config" "Mozilla/5.0 (X11; Linux x86_64; rv:124.0) Gecko/20100101 Firefox/124.0" "192.168.158.30" 06.05.2024 10:40:56 127.0.0.1 - 06/May/2024:11:40:56 +0300 "GET /index.php" 500

I would appreciate any help and happily provide additional info if you need it.

Thanks. :)

Teonyr commented 2 months ago

Okay, I found the issue: In my docker-compose.yml I set the environment variable "FIREFLY_URL" for the pico container to http://firefly-app. As it turns out, pico then tries to connect to firefly-app:80, but since firefly uses port 8080, this doesn't succeed.

Setting the port manually to 8080 fixes the issue: - FIREFLY_URL=firefly-app:8080

Cloufish commented 2 months ago

I have very similar issue

I run the app behind traefik, but that shouldn't be the reason. I already had fireflyiii installed

My config:

version: "3.5"

services:
  fireflypico:
    image: cioraneanu/firefly-pico:latest
    container_name: fireflypico
    ports:
      - "80"
    networks:
      - web
      - fireflypico
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Warsaw
      - FIREFLY_URL=https://fireflyiii.home
      - DB_CONNECTION=pgsql
      - DB_HOST=fireflypico_db
      - DB_PORT=5432
      - DB_DATABASE=firefly-pico
      - DB_USERNAME=firefly-pico
      - DB_PASSWORD=[REDACTED - SAME AS POSTGRES_PASSWORD]
    depends_on:
      - fireflypico_db
    deploy:
      labels:
        - "traefik.enable=true"
        - "traefik.http.routers.fireflypico.rule=Host(`fireflypico.home`)"
        - "traefik.http.services.fireflypico.loadbalancer.server.port=80"
        - "traefik.docker.network=web"
        - "io.portainer.accesscontrol.users=admin"
        - "traefik.http.routers.fireflypico.tls=true"
  fireflypico_db:
    image: postgres:latest
    container_name: fireflypico_db
    environment:
      - POSTGRES_DB=firefly-pico
      - POSTGRES_USER=firefly-pico
      - POSTGRES_PASSWORD=[REDACTED - SAME AS DB_PASSWORD]
    volumes:
      - /home/swarm/fireflypico/:/var/lib/postgresql/data
    networks:
      - fireflypico

networks:
  fireflypico:
    driver: overlay
    attachable: true
    name: fireflypico
  web:
    external: true
    name: web

volumes:
  fireflypico-volume:
    driver: local
PostgreSQL Database directory appears to contain a database; Skipping initialization
2024-05-07 10:11:30.538 UTC [1] LOG:  starting PostgreSQL 16.2 (Debian 16.2-1.pgdg120+2) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-05-07 10:11:30.539 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2024-05-07 10:11:30.539 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2024-05-07 10:11:30.543 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-05-07 10:11:30.549 UTC [29] LOG:  database system was interrupted; last known up at 2024-05-07 10:11:25 UTC
2024-05-07 10:11:30.615 UTC [29] LOG:  database system was not properly shut down; automatic recovery in progress
2024-05-07 10:11:30.617 UTC [29] LOG:  invalid record length at 0/19DAB38: expected at least 24, got 0
2024-05-07 10:11:30.617 UTC [29] LOG:  redo is not required
2024-05-07 10:11:30.623 UTC [27] LOG:  checkpoint starting: end-of-recovery immediate wait
2024-05-07 10:11:30.636 UTC [27] LOG:  checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.005 s, sync=0.003 s, total=0.016 s; sync files=2, longest=0.002 s, average=0.002 s; distance=0 kB, estimate=0 kB; lsn=0/19DAB38, redo lsn=0/19DAB38
2024-05-07 10:11:30.640 UTC [1] LOG:  database system is ready to accept connections
2024-05-07 10:16:30.713 UTC [27] LOG:  checkpoint starting: time
2024-05-07 10:16:30.928 UTC [27] LOG:  checkpoint complete: wrote 2 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.201 s, sync=0.005 s, total=0.216 s; sync files=2, longest=0.005 s, average=0.003 s; distance=2 kB, estimate=2 kB; lsn=0/19DB438, redo lsn=0/19DB400

image

Please help

cioraneanu commented 2 months ago

In the screenshot don't put any trailing "/" in the Pico backend URL.

If that's not it, you need to make sure that from your Pico container you can actually reach the Firefly API.

Ex. curl --location 'https://firefly.example.com/api/v1/about/user' --header 'authorization: Bearer xxxx' (replace firefly.example.com with your Firefly URL and xxxx with your personal token).