deg0nz / MMM-PublicTransportBerlin

MagicMirror module to display public transport in Berlin and Brandenburg with BVG Hafas data.
MIT License
40 stars 20 forks source link

HCI Core: Invalid client version #225

Closed ahaupt closed 2 months ago

ahaupt commented 3 months ago

Since a few days module is not working any more. Already fetched the latest commits without any changes. Log says this:

pi@raspi3b:~ $ journalctl _SYSTEMD_UNIT=magic-mirror.service | grep 'Aug 10 09:20:34'
Aug 10 09:20:34 raspi3b node[29907]: [10.08.2024 09:20.34.710] [ERROR] Error initializing fetcher: Error: CLIENTVERSION: HCI Core: Invalid client version
Aug 10 09:20:34 raspi3b node[29907]: [10.08.2024 09:20.34.723] [ERROR] HafasError: CLIENTVERSION: HCI Core: Invalid client version
Aug 10 09:20:34 raspi3b node[29907]:     at checkIfResponseIsOk (file:///home/pi/software/MagicMirror/modules/MMM-PublicTransportBerlin/node_modules/hafas-client/lib/request.js:103:9)
Aug 10 09:20:34 raspi3b node[29907]:     at Object.request (file:///home/pi/software/MagicMirror/modules/MMM-PublicTransportBerlin/node_modules/hafas-client/lib/request.js:206:2)
Aug 10 09:20:34 raspi3b node[29907]:     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Aug 10 09:20:34 raspi3b node[29907]:     at async Object.stop (file:///home/pi/software/MagicMirror/modules/MMM-PublicTransportBerlin/node_modules/hafas-client/index.js:492:25)
Aug 10 09:20:34 raspi3b node[29907]:     at async BvgFetcher.getStationName (/home/pi/software/MagicMirror/modules/MMM-PublicTransportBerlin/BvgFetcher.js:28:21)
Aug 10 09:20:34 raspi3b node[29907]:     at async Class.createFetcher (/home/pi/software/MagicMirror/modules/MMM-PublicTransportBerlin/node_helper.js:37:29) {
Aug 10 09:20:34 raspi3b node[29907]:   isHafasError: true,
Aug 10 09:20:34 raspi3b node[29907]:   code: null,
Aug 10 09:20:34 raspi3b node[29907]:   isCausedByServer: false,
Aug 10 09:20:34 raspi3b node[29907]:   hafasCode: 'CLIENTVERSION',
Aug 10 09:20:34 raspi3b node[29907]:   request: Request {
Aug 10 09:20:34 raspi3b node[29907]:     size: 0,
Aug 10 09:20:34 raspi3b node[29907]:     timeout: 0,
Aug 10 09:20:34 raspi3b node[29907]:     follow: 20,
Aug 10 09:20:34 raspi3b node[29907]:     compress: true,
Aug 10 09:20:34 raspi3b node[29907]:     counter: 0,
Aug 10 09:20:34 raspi3b node[29907]:     agent: Agent {
Aug 10 09:20:34 raspi3b node[29907]:       _events: [Object: null prototype],
Aug 10 09:20:34 raspi3b node[29907]:       _eventsCount: 2,
Aug 10 09:20:34 raspi3b node[29907]:       _maxListeners: undefined,
Aug 10 09:20:34 raspi3b node[29907]:       defaultPort: 443,
Aug 10 09:20:34 raspi3b node[29907]:       protocol: 'https:',
Aug 10 09:20:34 raspi3b node[29907]:       options: [Object: null prototype],
Aug 10 09:20:34 raspi3b node[29907]:       requests: [Object: null prototype] {},
Aug 10 09:20:34 raspi3b node[29907]:       sockets: [Object: null prototype] {},
Aug 10 09:20:34 raspi3b node[29907]:       freeSockets: [Object: null prototype],
Aug 10 09:20:34 raspi3b node[29907]:       keepAliveMsecs: 1000,
Aug 10 09:20:34 raspi3b node[29907]:       keepAlive: true,
Aug 10 09:20:34 raspi3b node[29907]:       maxSockets: Infinity,
Aug 10 09:20:34 raspi3b node[29907]:       maxFreeSockets: 256,
Aug 10 09:20:34 raspi3b node[29907]:       scheduling: 'lifo',
Aug 10 09:20:34 raspi3b node[29907]:       maxTotalSockets: Infinity,
Aug 10 09:20:34 raspi3b node[29907]:       totalSocketCount: 2,
Aug 10 09:20:34 raspi3b node[29907]:       maxCachedSessions: 100,
Aug 10 09:20:34 raspi3b node[29907]:       _sessionCache: [Object],
Aug 10 09:20:34 raspi3b node[29907]:       [Symbol(kCapture)]: false
Aug 10 09:20:34 raspi3b node[29907]:     },
Aug 10 09:20:34 raspi3b node[29907]:     [Symbol(Body internals)]: {
Aug 10 09:20:34 raspi3b node[29907]:       body: <Buffer 7b 22 6c 61 6e 67 22 3a 22 64 65 22 2c 22 73 76 63 52 65 71 4c 22 3a 5b 7b 22 6d 65 74 68 22 3a 22 4c 6f 63 44 65 74 61 69 6c 73 22 2c 22 72 65 71 22 ... 193 more bytes>,
Aug 10 09:20:34 raspi3b node[29907]:       disturbed: false,
Aug 10 09:20:34 raspi3b node[29907]:       error: null
Aug 10 09:20:34 raspi3b node[29907]:     },
Aug 10 09:20:34 raspi3b node[29907]:     [Symbol(Request internals)]: {
Aug 10 09:20:34 raspi3b node[29907]:       method: 'POST',
Aug 10 09:20:34 raspi3b node[29907]:       redirect: 'follow',
Aug 10 09:20:34 raspi3b node[29907]:       headers: [Headers],
Aug 10 09:20:34 raspi3b node[29907]:       parsedURL: [Url],
Aug 10 09:20:34 raspi3b node[29907]:       signal: null
Aug 10 09:20:34 raspi3b node[29907]:     }
Aug 10 09:20:34 raspi3b node[29907]:   },
Aug 10 09:20:34 raspi3b node[29907]:   response: Response {
Aug 10 09:20:34 raspi3b node[29907]:     size: 0,
Aug 10 09:20:34 raspi3b node[29907]:     timeout: 0,
Aug 10 09:20:34 raspi3b node[29907]:     [Symbol(Body internals)]: { body: [Gunzip], disturbed: true, error: null },
Aug 10 09:20:34 raspi3b node[29907]:     [Symbol(Response internals)]: {
Aug 10 09:20:34 raspi3b node[29907]:       url: 'https://bvg-apps-ext.hafas.de/bin/mgate.exe?',
Aug 10 09:20:34 raspi3b node[29907]:       status: 200,
Aug 10 09:20:34 raspi3b node[29907]:       statusText: 'OK',
Aug 10 09:20:34 raspi3b node[29907]:       headers: [Headers],
Aug 10 09:20:34 raspi3b node[29907]:       counter: 0
Aug 10 09:20:34 raspi3b node[29907]:     }
Aug 10 09:20:34 raspi3b node[29907]:   },
Aug 10 09:20:34 raspi3b node[29907]:   url: 'https://bvg-apps-ext.hafas.de/bin/mgate.exe?',
Aug 10 09:20:34 raspi3b node[29907]:   hafasResponseId: 'ipi83n8s2ewjg4wg',
Aug 10 09:20:34 raspi3b node[29907]:   hafasMessage: 'HCI Core: Invalid client version'
Aug 10 09:20:34 raspi3b node[29907]: }
Aug 10 09:20:34 raspi3b node[29907]: [10.08.2024 09:20.34.775] [LOG]   MMM-DWD-Pollen: Success loading
Aug 10 09:20:34 raspi3b node[29907]: [10.08.2024 09:20.34.869] [LOG]   Error while fetching departures (for module instance module_7_MMM-PublicTransportBerlin): Error: CLIENTVERSION: HCI Core: Invalid client version
deg0nz commented 3 months ago

Hm... this error originates in HAFAS, this is out of our control.

Ping @derhuerst: Have you seen this before? (We are currently using hafas-client@6.3.0)

derhuerst commented 3 months ago

This should be fixed once I pull the changes from https://github.com/public-transport/transport-apis/pull/84 into hafas-client.

deg0nz commented 3 months ago

Nice, thank you for the quick answer!

Edit: @ahaupt we will update the module as soon as the fix is available :)

OldGuyBerlin commented 3 months ago

I applied the changes manually in node_modules\hafas-client\p\bvg\base.json and it works like charm!

kenzo94 commented 3 months ago

I applied the changes manually in node_modules\hafas-client\p\bvg\base.json and it works like charm!

Works for me too !

flo269 commented 2 months ago

Hi @deg0nz, the mentioned PR seems to have been merged into hafas-client. Any chance for a new release? ;-) Thanks for all your work!

KristjanESPERANTO commented 2 months ago

Any chance for a new release?

At npm is still the old version 6.3.0 of hafas-client. We have to wait until @derhuerst will publish a new version.

KristjanESPERANTO commented 2 months ago

I just added a temporary solution to the module:

  1. Update the module:
      cd ~/MagicMirror/modules/MMM-PublicTransportBerlin
      git pull
      npm ci
  2. Replace file in hafas_client:
      cp base.json node_modules/hafas-client/p/bvg/base.json
flo269 commented 2 months ago

I just added a temporary solution to the module:

This worked great. Thank you!! :-)

OldGuyBerlin commented 2 months ago

Works like charm! Good job!

KristjanESPERANTO commented 2 months ago

hafas-client got an update :rocket: With #232 I've updated it in this module and removed the workaround.

matze548 commented 1 week ago

Hey, I still have troubles with this. Could it be because I use the docker version of the MagicMirror? If so how could this be solved?

KristjanESPERANTO commented 1 week ago

Hey, I still have troubles with this. Could it be because I use the docker version of the MagicMirror? If so how could this be solved?

I think it would be best if you opened a new issue and provided more information such as node version, which version of the module you are using and error messages in the console.

The system information at the top of MM the console might also be helpful. It looks like this:

[2024-11-17 16:03:20.159] [INFO]  System information:
### SYSTEM:   manufacturer: Notebook; model: N650DU; virtual: false
### OS:       platform: linux; distro: Debian GNU/Linux; release: 12; arch: x64; kernel: 5.10.0-20-amd64
### VERSIONS: electron: 32.2.2; used node: 20.18.0; installed node: 23.1.0; npm: 10.9.0; pm2: 5.4.2
### OTHER:    timeZone: Europe/Berlin; ELECTRON_ENABLE_GPU: undefined