[Docker / Container] echodevice

Begonnen von Sidey, 12 April 2026, 16:56:20

Vorheriges Thema - Nächstes Thema

FlatTV

THX Sidey,
ich lass das jetzt mal einige Zeit laufen...

[2026-06-10T17:44:40,736 Europe/Berlin] [INFO] Alexa-Cookie: Response (200)
[2026-06-10T17:44:40,738 Europe/Berlin] [INFO] Alexa-Cookie: Add Cookie csrf = -xxxxxx
[2026-06-10T17:44:40,738 Europe/Berlin] [INFO] Alexa-Cookie: Result: csrf=-xxxxxx, Cookie=...
...
[2026-06-10T17:44:40,740 Europe/Berlin] [INFO] Refresh finished (api) in 2586 ms
[2026-06-10T17:44:40,826 Europe/Berlin] [INFO] Refresh request handled in 2673 ms (saveTarget=44result.json)
[2026-06-10T17:44:40,827 Europe/Berlin] [INFO] 172.27.0.2 - - [10/Jun/2026:15:44:40 +0000] "POST /api/cookie/refresh?save=44result.json HTTP/1.0" 200 4376 "-" "fhem"
[2026-06-10T17:44:40,830 Europe/Berlin] [INFO] Cookie export written to /opt/fhem/cache/alexa-cookie/44result.json

Grüße
Jörg
Raspi4 - im wesentlichen mit Phoscon, HomeMatic ( aktuell über debmatic), CUL, BOSE-ST und Alexa (Connector)

rabehd

Ich bin leider kein Systemadmin und taste mich oft an Dinge ran.
Ich nutze FHEM im Docker. Bisher funktioniert echodrive. Ich halte diesen Container für langfristig besser.
Also habe ich das mal im Stack eingefügt.

########################
  FHEM:
    container_name: fhem_main
    hostname: fhem_main
    image: ghcr.io/fhem/fhem-docker:4-bullseye
    restart: always
    networks:
      fhem-network:
        ipv4_address: 172.31.31.60
    ports:
      - 8083:8083
      - 1883:1883 # MQTT
      - 3002:3002
    environment:
    - FTP_PASSIVE=1
    volumes:
    - /docker/fhem:/opt/fhem/
    - /docker/fhem-backup/MAIN:/backup
    - /docker/Logs:/log
    - /var/run/docker.sock:/var/run/docker.sock
    depends_on:
      - FHEM-DB
      - FHEM-alexa
      - FHEM-Homematic

########################
  alexa-cookie-service:
    image: ghcr.io/fhem/alexa-cookie-service:0.3.1
    container_name: fhem_alexa_cookie_service
    volumes:
      - /docker/alexa-cookie-data:/data
      - /docker/fhem/cache/alexa-cookie:/opt/fhem/cache/alexa-cookie
    environment:
      AUTH_TOKEN: change-me
      COOKIE_EXPORT_DIR: /opt/fhem/cache/alexa-cookie
      PROXY_PUBLIC_HOST: 192.168.31.60
    ports:
      - "58090:58090"
    networks:
    fhem-network:
        ipv4_address: 172.31.31.63
    restart: unless-stopped
    user: "6061:6061"     

Der Container startet und geht dann auf unhealthy.
Ist das erstmal ok? Vermutlich nicht.

Zitat[2026-06-10T16:03:45,958 UTC] [INFO] 127.0.0.1 - - [10/Jun/2026:16:03:45 +0000] "GET /healthz HTTP/1.1" 503 141 "-" "-"

Danke
Auch funktionierende Lösungen kann man hinterfragen.

Sidey

Zitat von: rabehd am 10 Juni 2026, 18:14:09Der Container startet und geht dann auf unhealthy.
Ist das erstmal ok? Vermutlich nicht.


Nein, das ist nicht in Ordnung. Kannst Du bitte einmal das komplette log vom alexa-cookie-service container bereitstellen, wenn er startet?

Grüße Sidey
Signalduino, Homematic, Raspberry Pi, Mysensors, MQTT, Alexa, Docker, AlexaFhem,zigbee2mqtt

Maintainer von: SIGNALduino, fhem-docker, alexa-fhem-docker, fhempy-docker, WebAuth, fhem-mcp

FlatTV

Zitat von: FlatTV am 10 Juni 2026, 17:50:16,
ich lass das jetzt mal einige Zeit laufen...

Hmmm, so sah der Auto-Refresh aus.
[2026-06-10T22:59:23,143 Europe/Berlin] [INFO] Starting refresh (api)
[2026-06-10T22:59:23,143 Europe/Berlin] [INFO] Alexa-Cookie: Use as Login-Amazon-URL: amazon.de
[2026-06-10T22:59:23,144 Europe/Berlin] [INFO] Alexa-Cookie: Use as Base-Amazon-URL: amazon.com
[2026-06-10T22:59:23,144 Europe/Berlin] [INFO] Alexa-Cookie: Use as Device-App-Name: FHEM EchoDevice Cookie Service
[2026-06-10T22:59:23,144 Europe/Berlin] [INFO] Alexa-Cookie: Use as User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36
[2026-06-10T22:59:23,144 Europe/Berlin] [INFO] Alexa-Cookie: Use as Accept-Language: de-DE
[2026-06-10T22:59:23,144 Europe/Berlin] [INFO] Alexa-Cookie: Proxy-Mode enabled if needed: 192.168.178.188:58090 to listen on 0.0.0.0
[2026-06-10T22:59:23,146 Europe/Berlin] [INFO] Alexa-Cookie: Refresh Token
...
[2026-06-10T22:59:23,603 Europe/Berlin] [INFO] Alexa-Cookie: Response (200)
[2026-06-10T22:59:23,609 Europe/Berlin] [INFO] Refresh Token Response:...
...
[2026-06-10T22:59:23,875 Europe/Berlin] [INFO] Alexa-Cookie: Add Cookie session-id = xxx-xxxx-xxxx
[2026-06-10T22:59:23,876 Europe/Berlin] [INFO] Alexa-Cookie: Add Cookie session-id-time = 2411845163l
[2026-06-10T22:59:23,876 Europe/Berlin] [INFO] Alexa-Cookie: Add Cookie ubid-main = xxx-xxxx-xxxx
[2026-06-10T22:59:23,877 Europe/Berlin] [INFO] Alexa-Cookie: Add Cookie session-token = xxxx
...
[2026-06-10T22:59:23,879 Europe/Berlin] [INFO] Alexa-Cookie: Add Cookie sess-at-main = "xxxxxx="
[2026-06-10T22:59:23,880 Europe/Berlin] [INFO] Handle token registration Start: {...
...
[2026-06-10T22:59:23,881 Europe/Berlin] [INFO] Alexa-Cookie: Register App
[2026-06-10T22:59:23,882 Europe/Berlin] [INFO] {"host":"api.amazon.com",...
...
[2026-06-10T22:59:23,883 Europe/Berlin] [INFO] Alexa-Cookie: Sending Request with {"host":"api.amazon.com","path...
...
[2026-06-10T22:59:24,041 Europe/Berlin] [INFO] Alexa-Cookie: Response (400)
[2026-06-10T22:59:24,042 Europe/Berlin] [INFO] Register App Response: {"response":{"error":{"code":"InvalidToken","index":"xxxxxxg==","message":"Auth time of the token is expired."}},"request_id":"xxxxxxx"}
[2026-06-10T22:59:24,045 Europe/Berlin] [ERROR] Refresh request failed: No tokens in Register response
[2026-06-10T22:59:24,046 Europe/Berlin] [INFO] 172.27.0.2 - - [10/Jun/2026:20:59:24 +0000] "POST /api/cookie/refresh?save=44result.json HTTP/1.0" 500 42 "-" "fhem"
[2026-06-10T22:59:24,069 Europe/Berlin] [INFO] 172.27.0.2 - - [10/Jun/2026:20:59:24 +0000] "GET /api/status HTTP/1.0" 200 4435 "-" "fhem"

Grüße
Jörg
Raspi4 - im wesentlichen mit Phoscon, HomeMatic ( aktuell über debmatic), CUL, BOSE-ST und Alexa (Connector)

FlatTV

Was mir gerade aufgefallen ist.
[2026-06-11T04:53:29,536 Europe/Berlin] [INFO] 172.27.0.2 - - [11/Jun/2026:02:53:29 +0000] "POST /api/cookie/refresh?save=44result.json HTTP/1.0" 200 4355 "-" "fhem"
im Verzeichnis Cache liegt aber ein altes Cookie mit der NR 45
Raspi4 - im wesentlichen mit Phoscon, HomeMatic ( aktuell über debmatic), CUL, BOSE-ST und Alexa (Connector)

rabehd

#20
Zitat von: Sidey am 10 Juni 2026, 21:37:50Nein, das ist nicht in Ordnung. Kannst Du bitte einmal das komplette log vom alexa-cookie-service container bereitstellen, wenn er startet?
Reicht das?
> alexa-cookie-service@0.3.1 start
> node src/server.js
[2026-06-11T06:04:36,531 UTC] [INFO] alexa-cookie-service listening on 0.0.0.0:58080
[2026-06-11T06:04:36,575 UTC] [INFO] Log timestamps use timezone UTC
[2026-06-11T06:04:40,729 UTC] [INFO] 127.0.0.1 - - [11/Jun/2026:06:04:40 +0000] "GET /healthz HTTP/1.1" 503 141 "-" "-"
[2026-06-11T06:04:45,820 UTC] [INFO] 127.0.0.1 - - [11/Jun/2026:06:04:45 +0000] "GET /healthz HTTP/1.1" 503 141 "-" "-"
[2026-06-11T06:04:50,896 UTC] [INFO] 127.0.0.1 - - [11/Jun/2026:06:04:50 +0000] "GET /healthz HTTP/1.1" 503 141 "-" "-"
[2026-06-11T06:04:55,992 UTC] [INFO] 127.0.0.1 - - [11/Jun/2026:06:04:55 +0000] "GET /healthz HTTP/1.1" 503 141 "-" "-"
[2026-06-11T06:05:26,067 UTC] [INFO] 127.0.0.1 - - [11/Jun/2026:06:05:26 +0000] "GET /healthz HTTP/1.1" 503 141 "-" "-"
[2026-06-11T06:05:56,165 UTC] [INFO] 127.0.0.1 - - [11/Jun/2026:06:05:56 +0000] "GET /healthz HTTP/1.1" 503 141 "-" "-"
[2026-06-11T06:06:26,321 UTC] [INFO] 127.0.0.1 - - [11/Jun/2026:06:06:26 +0000] "GET /healthz HTTP/1.1" 503 141 "-" "-"
[2026-06-11T06:06:56,411 UTC] [INFO] 127.0.0.1 - - [11/Jun/2026:06:06:56 +0000] "GET /healthz HTTP/1.1" 503 141 "-" "-"
[2026-06-11T06:07:26,493 UTC] [INFO] 127.0.0.1 - - [11/Jun/2026:06:07:26 +0000] "GET /healthz HTTP/1.1" 503 141 "-" "-"
[2026-06-11T06:07:56,567 UTC] [INFO] 127.0.0.1 - - [11/Jun/2026:06:07:56 +0000] "GET /healthz HTTP/1.1" 503 141 "-" "-"
[2026-06-11T06:08:26,712 UTC] [INFO] 127.0.0.1 - - [11/Jun/2026:06:08:26 +0000] "GET /healthz HTTP/1.1" 503 141 "-" "-"
[2026-06-11T06:08:56,810 UTC] [INFO] 127.0.0.1 - - [11/Jun/2026:06:08:56 +0000] "GET /healthz HTTP/1.1" 503 141 "-" "-"
[2026-06-11T06:09:26,909 UTC] [INFO] 127.0.0.1 - - [11/Jun/2026:06:09:26 +0000] "GET /healthz HTTP/1.1" 503 141 "-" "-"
Wie gesagt, ich habe nur den Container angelegt und im bestehenden System nichts angepasst.
Auch funktionierende Lösungen kann man hinterfragen.

FlatTV

#21
Zitat von: FlatTV am 11 Juni 2026, 04:57:43Was mir gerade aufgefallen ist.
[2026-06-11T04:53:29,536 Europe/Berlin] [INFO] 172.27.0.2 - - [11/Jun/2026:02:53:29 +0000] "POST /api/cookie/refresh?save=44result.json HTTP/1.0" 200 4355 "-" "fhem"
im Verzeichnis Cache liegt aber ein altes Cookie mit der NR 45


Das Problem liegt beim Speichern des alexa_cookie_service_export_name im Klartext.
Hier wird der ,,alte" verschlüsselte Eintrag genommen

alexa_cookie_service_export_name:56result.json
HTTPMOD_AlexaCookieService_alexa_cookie_service_export_name:56531657401655151a09155d0b

//Edit
Das ist aber noch nicht alles.
Im Log sieht es dann richtig aus
[2026-06-11T18:50:02,039 Europe/Berlin] [INFO] 172.27.0.2 - - [11/Jun/2026:16:50:02 +0000] "POST /api/cookie/refresh?save=56result.json HTTP/1.0" 200 4380 "-" "fhem"
[2026-06-11T18:50:02,047 Europe/Berlin] [INFO] Cookie export written to /opt/fhem/cache/alexa-cookie/56result.json
[2026-06-11T18:50:08,267 Europe/Berlin] [INFO] 127.0.0.1 - - [11/Jun/2026:16:50:08 +0000] "GET /healthz HTTP/1.1"
Gespeichert wird aber nix
I have no name!@46db69a954c5:/app$ ls -lisa /opt/fhem/cache/alexa-cookie/             
total 8
657271 4 drwxr-x--- 2 6061 6061 4096 Jun 11 18:50 .
668597 4 drwxr-xr-x 3 root root 4096 Jun 11 18:45 ..
I have no name!@46db69a954c5:/app$
Das ging aber schon mal.
Raspi4 - im wesentlichen mit Phoscon, HomeMatic ( aktuell über debmatic), CUL, BOSE-ST und Alexa (Connector)