timoschlueter / nightscout-librelink-up

Script written in TypeScript that uploads CGM readings from LibreLink Up to Nightscout.
MIT License
192 stars 246 forks source link

504 Gateway Time-out #67

Closed PythonFZ closed 1 year ago

PythonFZ commented 1 year ago

Since this morning I'm getting 504 Gateway Time-out when synchronizing data to my nightscout instance.

[info]: Upload of 0 measurements to NightScout succeeded
npm notice 
npm notice New minor version of npm available! 8.12.1 -> 8.19.2
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v8.19.2>
npm notice Run `npm install -g npm@8.19.2` to update!
npm notice 
npm ERR! path /usr/src/app
npm ERR! command failed
npm ERR! signal SIGTERM
npm ERR! command sh -c node index.js
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-09-24T09_29_54_139Z-debug-0.log
> nightscout-librelink-up@1.8.1 start
> node index.js
...
[info]: -> The following connection will be used: XXX XXX (Patient-ID: xxxxxxxxx)
[info]: Received blood glucose measurement items
[error]: "<html>\r\n<head><title>504 Gateway Time-out</title></head>\r\n<body>\r\n<center><h1>504 Gateway Time-out</h1></center>\r\n<hr><center>openresty</center>\r\n</body>\r\n</html>\r\n"

All Services run on a self-hosted docker container based on docker-compose.yaml. I'm using the xDrip+ App together with Nighscout as well and synchronizing data from XDrip+ -> Nightscout still works. I did not make any recent changes or update that could have caused this.

Do you have any idea or need any further logs that could help you?

EDIT: I build a new librelink-up container on a different machine and received the same error message.

npm log file

0 verbose cli /usr/local/bin/node /usr/local/bin/npm
1 info using npm@8.12.1
2 info using node@v18.5.0
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 1ms
6 timing config:load:builtin Completed in 1ms
7 timing config:load:cli Completed in 2ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:/usr/src/app/.npmrc Completed in 0ms
10 timing config:load:project Completed in 4ms
11 timing config:load:file:/root/.npmrc Completed in 0ms
12 timing config:load:user Completed in 0ms
13 timing config:load:file:/usr/local/etc/npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:credentials Completed in 1ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 12ms
19 timing npm:load:configload Completed in 13ms
20 timing npm:load:mkdirpcache Completed in 1ms
21 timing npm:load:mkdirplogs Completed in 1ms
22 verbose title npm start
23 verbose argv "start"
24 timing npm:load:setTitle Completed in 1ms
25 timing config:load:flatten Completed in 3ms
26 timing npm:load:display Completed in 4ms
27 verbose logfile logs-max:10 dir:/root/.npm/_logs
28 verbose logfile /root/.npm/_logs/2022-09-24T09_29_54_139Z-debug-0.log
29 timing npm:load:logFile Completed in 5ms
30 timing npm:load:timers Completed in 0ms
31 timing npm:load:configScope Completed in 0ms
32 timing npm:load Completed in 25ms
33 silly logfile done cleaning log files
34 http fetch GET 200 https://registry.npmjs.org/npm 729ms (cache updated)
35 http fetch GET 200 https://registry.npmjs.org/npm 763ms (cache updated)
36 timing command:run-script Completed in 275221ms
37 timing command:start Completed in 275224ms
38 notice
38 notice New minor version of npm available! 8.12.1 -> 8.19.2
38 notice Changelog: <https://github.com/npm/cli/releases/tag/v8.19.2>
38 notice Run `npm install -g npm@8.19.2` to update!
38 notice
39 verbose stack Error: command failed
39 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:63:27)
39 verbose stack     at ChildProcess.emit (node:events:537:28)
39 verbose stack     at maybeClose (node:internal/child_process:1091:16)
39 verbose stack     at ChildProcess._handle.onexit (node:internal/child_process:302:5)
40 verbose pkgid nightscout-librelink-up@1.8.1
41 verbose cwd /usr/src/app
42 verbose Linux 5.15.0-46-generic
43 verbose node v18.5.0
44 verbose npm  v8.12.1
45 error path /usr/src/app
46 error command failed
47 error signal SIGTERM
48 error command sh -c node index.js
49 verbose exit 1
50 timing npm Completed in 275256ms
51 verbose code 1
52 error A complete log of this run can be found in:
52 error     /root/.npm/_logs/2022-09-24T09_29_54_139Z-debug-0.log

docker-compose.yaml

version: '3'

volumes:
  data:

services:
  db:
    image: mongo:latest
    restart: always
    volumes:
      - data:/data/db
    networks:
      - npm-net

  app:
    image: nightscout/cgm-remote-monitor:latest
    container_name: nightscout
    restart: always
    networks:
      - npm-net
    depends_on:
      - db
    environment:
      ### Variables for the container
      NODE_ENV: production
      TZ: Etc/UTC

      INSECURE_USE_HTTP: 'true'
      MONGO_CONNECTION: mongodb://db:27017/nightscout
      API_SECRET: xxxxxxxxxxxxxxx

      ENABLE: careportal basal dbsize rawbg iob maker bridge cob bwp cage iage sage boluscalc pushover treatmentnotify mmconnect loop pump profile food openaps bage alexa override cors

      AUTH_DEFAULT_ROLES: denied
      TIME_FORMAT: 24

  libre-link:
    image: timoschlueter/nightscout-librelink-up
    container_name: nightscout-libre-link
    restart: always
    environment:
      LINK_UP_USERNAME: xxxxxx
      LINK_UP_PASSWORD: xxxxxxxx
      LINK_UP_TIME_INTERVAL: 1
      LINK_UP_REGION: DE
      NIGHTSCOUT_URL: xxxxxx
      NIGHTSCOUT_API_TOKEN: xxxxxxx
      LOG_LEVEL: "info"

networks:
  npm-net:
    external: true
PythonFZ commented 1 year ago

I checked the LibreLinkUp App and there wasn't any data either. Restarting the Libre3 app solved the issues. Closed as duplicate of #58 / #65 for better log messages.