instantlinux / docker-tools

Docker tools for developer productivity & entertainment
Apache License 2.0
272 stars 89 forks source link

nut-upsd connection lost #67

Open poliant opened 3 years ago

poliant commented 3 years ago

I'm using nut-upsd image on a RPI4 for a tecnoware Era Plus 1100 and evything works fine except in the following cases: 1) in case I disconnect and reconnect the USB on RPI 2) UPS for some strange reason loses serial connection for a while

I both case the port changes (e.g. from /dev/bus/usb/00X/00Z to /dev/bus/usb/00Y/00W). In order to have always the same port I've created a rule so that the usb port is always mapped to /dev/myUPS and I've configured such port on my dockerfile:

  nut-upsd:
    container_name: nut-upsd
    image: instantlinux/nut-upsd
    volumes:
      - "/home/antonio/nut-upsd-pwd:/run/secrets/nut-upsd-password"
    environment:
    - "PORT=/dev/myUPS"
    - "NAME=tecnoware"
    - "DESCRIPTION=Technoware Era Plus 1100"
    - "DRIVER=blazer_usb"
    - "API_USER=master"
    network_mode: host
    privileged: true
    restart: always

Also with such configuration I lose the connection to UPS in both cases I reported above... of course the first case is not real, meaning I used for testing... of course I've checked that when the USB is reconnected and/or the UPS re-establish the connection, symbolik link to usb port is updated correctly.

Thanks for support

KC-inDomus commented 2 years ago

+1

akela-it commented 2 years ago

+1

hellcry37 commented 10 months ago

Hello, I am using your docker container that worked well til the latest update or so. I am guessing is the same as the author, I did not want to hijack his tread.

version docker tag used: latest = 2.8.1-r0

  nut-server:
    image: instantlinux/nut-upsd:latest
    container_name: nut-server
    restart: unless-stopped
    privileged: true
    environment:
      SERIAL: xxxxxxxxxxxx
      DRIVER: usbhid-ups
      NAME: CP1500EPFCLCD
      DESCRIPTION: Cyber Power CP1500 AVR UPS
    ports:
      - 3493:3493
    networks:
      - smarthome
    secrets:
      - nut-upsd-password

also have this alert if it helps checkmk:

dockers (dockers)
⚠️ SERVICE PROBLEM

Number of threads
State changed from OK to WARN
2001 (warn/crit at 2000/4000)(!)

after a while:

33968.169374    Poll UPS [CP1500EPFCLCD@localhost] failed - Data stale
33973.169865    Poll UPS [CP1500EPFCLCD@localhost] failed - Data stale
33978.170490    Poll UPS [CP1500EPFCLCD@localhost] failed - Data stale
33983.171079    Poll UPS [CP1500EPFCLCD@localhost] failed - Data stale
33988.171785    Poll UPS [CP1500EPFCLCD@localhost] failed - Data stale
33993.172246    Poll UPS [CP1500EPFCLCD@localhost] failed - Data stale
33998.172700    Poll UPS [CP1500EPFCLCD@localhost] failed - Data stale
34003.173292    Poll UPS [CP1500EPFCLCD@localhost] failed - Data stale
34008.173541    Poll UPS [CP1500EPFCLCD@localhost] failed - Data stale
34013.174100    Poll UPS [CP1500EPFCLCD@localhost] failed - Data stale
34018.174301    Poll UPS [CP1500EPFCLCD@localhost] failed - Data stale
34023.174886    Poll UPS [CP1500EPFCLCD@localhost] failed - Data stale
34028.175143    Poll UPS [CP1500EPFCLCD@localhost] failed - Data stale
34033.175663    Poll UPS [CP1500EPFCLCD@localhost] failed - Data stale
34038.175878    Poll UPS [CP1500EPFCLCD@localhost] failed - Data stale
34043.176376    Poll UPS [CP1500EPFCLCD@localhost] failed - Data stale
34048.176594    Poll UPS [CP1500EPFCLCD@localhost] failed - Data stale

after more time:

34878.245858    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
Error while connecting to NUT server localhost, disconnect
34883.249626    UPS [CP1500EPFCLCD@localhost]: connect failed: Server disconnected
34883.249644    UPS CP1500EPFCLCD@localhost is unavailable
sh: wall: not found
34888.250321    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
Error while connecting to NUT server localhost, disconnect
34893.253477    UPS [CP1500EPFCLCD@localhost]: connect failed: Server disconnected
34898.253745    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
Error while connecting to NUT server localhost, disconnect
34903.255366    UPS [CP1500EPFCLCD@localhost]: connect failed: Server disconnected
34908.255462    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
Error while connecting to NUT server localhost, disconnect
34913.257664    UPS [CP1500EPFCLCD@localhost]: connect failed: Server disconnected
34918.257764    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
Error while connecting to NUT server localhost, disconnect
34923.261468    UPS [CP1500EPFCLCD@localhost]: connect failed: Server disconnected
34928.261587    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
Error while connecting to NUT server localhost, disconnect
34933.265438    UPS [CP1500EPFCLCD@localhost]: connect failed: Server disconnected
34938.265570    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
Error while connecting to NUT server localhost, disconnect
34943.269462    UPS [CP1500EPFCLCD@localhost]: connect failed: Server disconnected
34948.269659    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
Error while connecting to NUT server localhost, disconnect
34953.273986    UPS [CP1500EPFCLCD@localhost]: connect failed: Server disconnected
34958.274146    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
Error while connecting to NUT server localhost, disconnect
34963.277593    UPS [CP1500EPFCLCD@localhost]: connect failed: Server disconnected
34968.277760    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
Error while connecting to NUT server localhost, disconnect
34973.281455    UPS [CP1500EPFCLCD@localhost]: connect failed: Server disconnected
34978.281641    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
Error while connecting to NUT server localhost, disconnect
34983.285572    UPS [CP1500EPFCLCD@localhost]: connect failed: Server disconnected
34988.285742    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
Error while connecting to NUT server localhost, disconnect
34993.289447    UPS [CP1500EPFCLCD@localhost]: connect failed: Server disconnected
34998.289576    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
35128.629388    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
35133.629556    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
35263.797530    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
35263.797564    UPS CP1500EPFCLCD@localhost is unavailable
sh: wall: not found
35268.798151    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
35398.965383    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
35403.965921    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
35534.133356    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
35539.133502    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
35669.301573    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
35669.301609    UPS CP1500EPFCLCD@localhost is unavailable
sh: wall: not found
35674.302301    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
35804.469380    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
35809.469594    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
35939.637215    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
35944.637331    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
36074.805422    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
36074.805448    UPS CP1500EPFCLCD@localhost is unavailable
sh: wall: not found
36079.806017    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
36209.973627    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
36214.973848    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
36345.141509    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
36350.141702    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
36480.309532    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
36480.309570    UPS CP1500EPFCLCD@localhost is unavailable
sh: wall: not found
36485.310455    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
36615.481305    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
36620.481467    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
36750.645526    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
36755.645956    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
36885.813408    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
36885.813433    UPS CP1500EPFCLCD@localhost is unavailable
sh: wall: not found
36890.814059    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
37020.985332    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
37025.985519    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
37156.149442    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
37161.149643    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
37291.317462    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
37291.317498    UPS CP1500EPFCLCD@localhost is unavailable
sh: wall: not found
37296.318272    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
37426.485552    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
37431.485799    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
37561.657356    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
37566.657559    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
37696.821835    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
37696.821958    UPS CP1500EPFCLCD@localhost is unavailable
sh: wall: not found
37701.822826    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
37831.989418    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
37836.989619    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
37967.157551    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
37972.157704    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
38102.325449    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
38102.325489    UPS CP1500EPFCLCD@localhost is unavailable
sh: wall: not found
38107.326213    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
38237.493525    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
38242.493763    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
38372.661607    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
38377.661729    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
38507.833244    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
38507.833258    UPS CP1500EPFCLCD@localhost is unavailable
sh: wall: not found
38512.833675    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
38643.001273    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
38648.001480    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
38778.165293    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
38783.165406    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
38913.337251    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
38913.337260    UPS CP1500EPFCLCD@localhost is unavailable
sh: wall: not found
38918.337620    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
39048.501214    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
39053.501386    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
39183.669339    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
39188.669464    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
39318.837428    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
39318.837458    UPS CP1500EPFCLCD@localhost is unavailable
sh: wall: not found
39323.838081    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
39454.005565    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
39459.005832    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
39589.173563    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
39594.173725    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
39724.341495    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
39724.341524    UPS CP1500EPFCLCD@localhost is unavailable
sh: wall: not found
39729.342210    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
39859.509375    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
39864.509605    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
39994.681381    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
39999.681514    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
40129.849391    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
40129.849443    UPS CP1500EPFCLCD@localhost is unavailable
sh: wall: not found
40134.850080    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
40265.013573    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
40270.013823    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
40400.181703    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
40405.181914    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
40535.349541    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
40535.349582    UPS CP1500EPFCLCD@localhost is unavailable
sh: wall: not found
40540.350371    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
40670.517592    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
40675.517824    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
40805.685525    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
40810.685712    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
40940.853443    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
40940.853473    UPS CP1500EPFCLCD@localhost is unavailable
sh: wall: not found
40945.854128    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
41076.021541    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
41081.021918    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
41211.189400    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
41216.189570    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
41346.357511    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
41346.357548    UPS CP1500EPFCLCD@localhost is unavailable
sh: wall: not found
41351.358270    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
41481.525308    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
41486.525485    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
41616.693546    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
41621.693693    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
41751.861425    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
41751.861466    UPS CP1500EPFCLCD@localhost is unavailable
sh: wall: not found
41756.862113    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
41887.033389    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
41892.033587    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
42022.197548    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
42027.197667    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
42157.365371    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
42157.365408    UPS CP1500EPFCLCD@localhost is unavailable
sh: wall: not found
42162.366112    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
42292.533602    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
42297.533873    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
42427.701328    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
42432.701463    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
42562.869532    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
42562.869574    UPS CP1500EPFCLCD@localhost is unavailable
sh: wall: not found
42567.870333    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
42698.037399    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
42703.037632    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
42833.209258    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
42838.209377    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
42968.373415    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
42968.373446    UPS CP1500EPFCLCD@localhost is unavailable
sh: wall: not found
42973.373979    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
43103.545475    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
43108.545707    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
43238.709267    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
43243.709390    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
43373.877279    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
43373.877289    UPS CP1500EPFCLCD@localhost is unavailable
sh: wall: not found
43378.877688    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
43509.049464    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
43514.049646    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
43644.213587    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
43649.213791    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
43779.385443    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
43779.385480    UPS CP1500EPFCLCD@localhost is unavailable
sh: wall: not found
43784.386233    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
43914.549276    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
43919.549417    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
44049.717424    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
44054.717573    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
44184.885539    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
44184.885577    UPS CP1500EPFCLCD@localhost is unavailable
sh: wall: not found
44189.886422    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
44320.053645    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
44325.053813    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
44455.221579    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
44460.221722    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
44590.393402    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
44590.393439    UPS CP1500EPFCLCD@localhost is unavailable
sh: wall: not found
44595.394155    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
44725.557464    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
44730.557714    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
44860.725445    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
44865.725635    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
44995.893528    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
44995.893561    UPS CP1500EPFCLCD@localhost is unavailable
sh: wall: not found
45000.894103    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
45131.061689    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
45136.061879    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
45266.229543    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
45271.229765    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
45401.397336    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
45401.397370    UPS CP1500EPFCLCD@localhost is unavailable
sh: wall: not found
45406.398156    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
45536.569401    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
45541.569609    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
45671.733604    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
45676.733781    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
45806.901546    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
45806.901584    UPS CP1500EPFCLCD@localhost is unavailable
sh: wall: not found
45811.902397    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
45942.069553    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
45947.069802    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
46077.237354    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
46082.237504    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
46212.405544    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
46212.405583    UPS CP1500EPFCLCD@localhost is unavailable
sh: wall: not found
46217.406391    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
46347.573403    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
46352.573662    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
46482.741541    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
46487.741732    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
46617.909489    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
46617.909534    UPS CP1500EPFCLCD@localhost is unavailable
sh: wall: not found
46622.910207    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
46753.077482    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
46758.077923    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
46888.245413    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
46893.245554    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
47023.413403    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
47023.413435    UPS CP1500EPFCLCD@localhost is unavailable
sh: wall: not found
47028.414230    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
47158.581315    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
47163.581472    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
47293.753342    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
47298.753474    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
47428.917265    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
47428.917282    UPS CP1500EPFCLCD@localhost is unavailable
sh: wall: not found
47433.917583    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
47564.089333    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
47569.089527    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
47699.253521    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
47704.253745    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
47834.421593    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
47834.421628    UPS CP1500EPFCLCD@localhost is unavailable
sh: wall: not found
47839.422360    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
47969.589244    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
47974.589438    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
48104.757549    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
48109.757741    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
48239.925547    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
48239.925601    UPS CP1500EPFCLCD@localhost is unavailable
sh: wall: not found
48244.926421    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
48375.093593    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
48380.093784    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
48510.261493    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
48515.261625    [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
48645.429351    UPS [CP1500EPFCLCD@localhost]: connect failed: Connection failure: Address not available
48645.429395    UPS CP1500EPFCLCD@localhost is unavailable
sh: wall: not found
instantlinux commented 10 months ago

What is the output of this command (part of Dockerfile's HEALTHCHECK) directive, when this happens with your UPS model, from a docker exec -it <id> sh shell? (Make sure $NAME env is set to ups, which is default for latest image).

echo $NAME
upsc $NAME@localhost:3493 2>&1

An important assumption is that the upsc command output will include the word stale, and cause the container to restart: but evidently the output is vendor-specific, so the pattern to be matched needs updating. Please help out by providing the output for the Cyber Power.

hellcry37 commented 10 months ago

Hello,

Here is the required information:

used: latest = 2.8.1-r0

/ # echo $NAME
CP1500EPFCLCD
/ # upsc $CP1500EPFCLCD@localhost:3493 2>&1
upscli_splitname: got empty upsname string
Error: invalid UPS definition.
Required format: upsname[@hostname[:port]]
hellcry37 commented 10 months ago

I want to mention that nut-upsd:2.8.0-r4 works ok and has the following output:

/ # echo $NAME
CP1500EPFCLCD
/ # upsc $CP1500EPFCLCD@localhost:3493 2>&1
Init SSL without certificate database
Error: Unknown UPS
instantlinux commented 10 months ago

The command output I want to see is

upsc $NAME@localhost:3493 2>&1

which expands the variable $NAME, not expanding a non-existent variable $CP1500EPFCLCD, below is incorrect:

upsc $CP1500EPFCLCD@localhost:3493 2>&1

Someone reported a bug with there being two $$ characters in the healthcheck: this was corrected in the 2.8.1-r0 tag; I've yet to fully confirm whether the fix (PR #140) is proper. To confirm, you can do docker history instantlinux/nut-upsd:<tag> for that tag or others that are present on your host.

Does the symptom still appear when you comment out the NAME: CP1500EPFCLCD environment variable in docker-compose.yml?

hellcry37 commented 10 months ago

old 2.8.0-r4:

/ # upsc $NAME@localhost:3493 2>&1
Init SSL without certificate database
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 20
battery.mfr.date: CPS
battery.runtime: 3150
battery.runtime.low: 300
battery.type: PbAcid
battery.voltage: 24.0
battery.voltage.nominal: 24
device.mfr: CPS
device.model: CP1500EPFCLCD
device.serial: xxx
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.parameter.serial: xxx
driver.parameter.synchronous: auto
driver.version: 2.8.0
driver.version.data: CyberPower HID 0.6
driver.version.internal: 0.47
driver.version.usb: libusb-1.0.26 (API: 0x1000109)
input.transfer.high: 260
input.transfer.low: 170
input.voltage: 232.0
input.voltage.nominal: 230
output.voltage: 232.0
ups.beeper.status: enabled
ups.delay.shutdown: 20
ups.delay.start: 30
ups.load: 13
ups.mfr: CPS
ups.model: CP1500EPFCLCD
ups.productid: 0501
ups.realpower.nominal: 900
ups.serial: xxx
ups.status: OL
ups.test.result: No test initiated
ups.timer.shutdown: -60
ups.timer.start: -60
ups.vendorid: 0764

new latest 2.8.0-r0:

/ # upsc $NAME@localhost:3493 2>&1
Init SSL without certificate database
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 20
battery.mfr.date: CPS
battery.runtime: 3120
battery.runtime.low: 300
battery.type: PbAcid
battery.voltage: 24.0
battery.voltage.nominal: 24
device.mfr: CPS
device.model: CP1500EPFCLCD
device.serial: xxx
device.type: ups
driver.debug: 0
driver.flag.allow_killpower: 0
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.parameter.serial: xxx
driver.parameter.synchronous: auto
driver.state: quiet
driver.version: 2.8.1
driver.version.data: CyberPower HID 0.8
driver.version.internal: 0.52
driver.version.usb: libusb-1.0.26 (API: 0x1000109)
input.transfer.high: 260
input.transfer.low: 170
input.voltage: 230.0
input.voltage.nominal: 230
output.voltage: 230.0
ups.beeper.status: enabled
ups.delay.shutdown: 20
ups.delay.start: 30
ups.load: 13
ups.mfr: CPS
ups.model: CP1500EPFCLCD
ups.productid: 0501
ups.realpower.nominal: 900
ups.serial: xxx
ups.status: OL
ups.test.result: No test initiated
ups.timer.shutdown: -60
ups.timer.start: -60
ups.vendorid: 0764
hellcry37 commented 10 months ago

I'll test this now.

Does the symptom still appear when you comment out the NAME: CP1500EPFCLCD environment variable in docker-compose.yml?
hellcry37 commented 10 months ago

comment out the NAME: CP1500EPFCLCD in docker compose

after not even a few minutes:

logs: docker logs nut-server

Network UPS Tools - UPS driver controller 2.8.1
Network UPS Tools - Generic HID driver 0.52 (2.8.1)
Using subdriver: CyberPower HID 0.8
USB communication driver (libusb 1.0) 0.46
WARNING: Needed to fix group access to filesystem socket of this driver, but failed; run the driver with more debugging to see how exactly.
Consumers of the socket, such as upsd data server, can fail to interact with the driver and represent the device: /var/run/nut/usbhid-ups-ups
Ignoring invalid pid number 0
Network UPS Tools upsd 2.8.1
listening on 0.0.0.0 port 3493
Connected to UPS [ups]: usbhid-ups-ups
Found 1 UPS defined in ups.conf
Network UPS Tools upsmon 2.8.1
   0.000000     Ignoring invalid pid number 0
   0.000028     [D1] Just failed to send signal, no daemon was running
   0.000189     Using power down flag file /etc/killpower
   0.000365     UPS: ups@localhost (primary) (power value 1)
   0.000396     [D1] debug level is '1'
   0.000621     [D1] Saving PID 25 into /run/upsmon.pid
   0.000789     [D1] Succeeded to become_user(nut): now UID=100 GID=101
Init SSL without certificate database
   0.001894     upsnotify: failed to notify about state 2: no notification tech defined, will not spam more about it
   0.001904     [D1] Trying to connect to UPS [ups@localhost]
   0.002217     [D1] Logged into UPS ups@localhost
 565.061320     Poll UPS [ups@localhost] failed - Data stale
 565.061394     Communications with UPS ups@localhost lost
sh: wall: not found
 570.062669     Poll UPS [ups@localhost] failed - Data stale
 575.063161     Poll UPS [ups@localhost] failed - Data stale
 580.063387     Poll UPS [ups@localhost] failed - Data stale
 585.063580     Poll UPS [ups@localhost] failed - Data stale
 590.064142     Poll UPS [ups@localhost] failed - Data stale
 595.064605     Poll UPS [ups@localhost] failed - Data stale
 600.065096     Poll UPS [ups@localhost] failed - Data stale
 605.065808     Poll UPS [ups@localhost] failed - Data stale
 610.066411     Poll UPS [ups@localhost] failed - Data stale
 615.066849     Poll UPS [ups@localhost] failed - Data stale
 620.067402     Poll UPS [ups@localhost] failed - Data stale
 625.067720     Poll UPS [ups@localhost] failed - Data stale
 630.068213     Poll UPS [ups@localhost] failed - Data stale
 635.068767     Poll UPS [ups@localhost] failed - Data stale
 640.069205     Poll UPS [ups@localhost] failed - Data stale

when error happens:

/ # upsc $NAME@localhost:3493 2>&1
Init SSL without certificate database
Error: Data stale

when i restart the container, right before it errors out:

/ # upsc $NAME@localhost:3493 2>&1
Init SSL without certificate database
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 20
battery.mfr.date: CPS
battery.runtime: 13950
battery.runtime.low: 300
battery.type: PbAcid
battery.voltage: 24.0
battery.voltage.nominal: 24
device.mfr: CPS
device.model: CP1500EPFCLCD
device.serial: xxx
device.type: ups
driver.debug: 0
driver.flag.allow_killpower: 0
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.parameter.serial: xxx
driver.parameter.synchronous: auto
driver.state: quiet
driver.version: 2.8.1
driver.version.data: CyberPower HID 0.8
driver.version.internal: 0.52
driver.version.usb: libusb-1.0.26 (API: 0x1000109)
input.transfer.high: 260
input.transfer.low: 170
input.voltage: 237.0
input.voltage.nominal: 230
output.voltage: 237.0
ups.beeper.status: enabled
ups.delay.shutdown: 20
ups.delay.start: 30
ups.load: 0
ups.mfr: CPS
ups.model: CP1500EPFCLCD
ups.productid: 0501
ups.realpower.nominal: 900
ups.serial: xxx
ups.status: OL
ups.test.result: No test initiated
ups.timer.shutdown: -60
ups.timer.start: -60
ups.vendorid: 0764

Let me know if anything else is needed, I'll help no problem.

instantlinux commented 10 months ago

@hellcry37 @poliant @KC-inDomus please invoke docker pull instantlinux/nut-upsd:latest (or tag 2.8.1-r0 to update if you use this tag) and confirm the two changes I've made. The first change is to ensure that the container takes itself down for restart if data goes stale, and the second is to add the MAXAGE parameter. If you're using Cyberpower model, add this to your docker-compose file in the nut-server -> environment section:

    environment:
      ...
      MAXAGE: 25

Other users: if this causes unwanted restarts for other UPS units, please make me aware of it here or in a new issue. This latest change is a bit risky so I might have to add protective logic for the default case.

hellcry37 commented 10 months ago

Does this fix the issue or just restarts when "Data stale" is detected? If the issue is not fixed that means container will restart in a loop at some point (that will not help)

what is that MAXAGE: 25 do?

instantlinux commented 10 months ago

If the issue is caused by the UPS unit taking longer than 15 seconds, the default value of MAXAGE, to report its data: it will be fixed. Please change that parameter and see if the container stays running without restarts. Googling for this problem is inconclusive.

hellcry37 commented 10 months ago

will change it now and come back

hellcry37 commented 10 months ago

Til now it seem to work ok.

However we have a warning I dont know if is of any importance:

WARNING: Needed to fix group access to filesystem socket of this driver, but failed; run the driver with more debugging to see how exactly.

I'll come back tomorrow to tell you if this worked as it should. Thank you for all your hard work and your patience!

hellcry37 commented 10 months ago

Ahhh too soon it just failed again container restarted:

74afb66911c9   instantlinux/nut-upsd:latest             "/bin/sh -c /usr/loc…"   29 minutes ago   Up 59 seconds (healthy)   0.0.0.0:3493->3493/tcp, :::3493->3493/tcp      nut-server
docker logs nut-server
Network UPS Tools - UPS driver controller 2.8.1
Network UPS Tools - Generic HID driver 0.52 (2.8.1)
Using subdriver: CyberPower HID 0.8
USB communication driver (libusb 1.0) 0.46
WARNING: Needed to fix group access to filesystem socket of this driver, but failed; run the driver with more debugging to see how exactly.
Consumers of the socket, such as upsd data server, can fail to interact with the driver and represent the device: /var/run/nut/usbhid-ups-CP1500EPFCLCD
Network UPS Tools upsd 2.8.1
Ignoring invalid pid number 0
listening on 0.0.0.0 port 3493
Connected to UPS [CP1500EPFCLCD]: usbhid-ups-CP1500EPFCLCD
Found 1 UPS defined in ups.conf
Network UPS Tools upsmon 2.8.1
   0.000000     Ignoring invalid pid number 0
   0.000028     [D1] Just failed to send signal, no daemon was running
   0.000403     Using power down flag file /etc/killpower
   0.000758     UPS: CP1500EPFCLCD@localhost (primary) (power value 1)
   0.000792     [D1] debug level is '1'
   0.001066     [D1] Saving PID 26 into /run/upsmon.pid
   0.001247     [D1] Succeeded to become_user(nut): now UID=100 GID=101
Init SSL without certificate database
   0.002293     upsnotify: failed to notify about state 2: no notification tech defined, will not spam more about it
   0.002301     [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
   0.002624     [D1] Logged into UPS CP1500EPFCLCD@localhost
1695.185795     Poll UPS [CP1500EPFCLCD@localhost] failed - Data stale
1695.185828     Communications with UPS CP1500EPFCLCD@localhost lost
sh: wall: not found
1700.186960     Poll UPS [CP1500EPFCLCD@localhost] failed - Data stale
1705.187683     Poll UPS [CP1500EPFCLCD@localhost] failed - Data stale
1710.188270     Poll UPS [CP1500EPFCLCD@localhost] failed - Data stale
1715.188906     Poll UPS [CP1500EPFCLCD@localhost] failed - Data stale
1718.291046     Signal 15: exiting
1718.292958     upsmon parent: read
Network UPS Tools - UPS driver controller 2.8.1
Network UPS Tools - Generic HID driver 0.52 (2.8.1)
Using subdriver: CyberPower HID 0.8
USB communication driver (libusb 1.0) 0.46
WARNING: Needed to fix group access to filesystem socket of this driver, but failed; run the driver with more debugging to see how exactly.
Consumers of the socket, such as upsd data server, can fail to interact with the driver and represent the device: /var/run/nut/usbhid-ups-CP1500EPFCLCD
Ignoring invalid pid number 0
Network UPS Tools upsd 2.8.1
listening on 0.0.0.0 port 3493
Connected to UPS [CP1500EPFCLCD]: usbhid-ups-CP1500EPFCLCD
Found 1 UPS defined in ups.conf
Network UPS Tools upsmon 2.8.1
   0.000000     Ignoring invalid pid number 0
   0.000068     [D1] Just failed to send signal, no daemon was running
   0.000312     Using power down flag file /etc/killpower
   0.000451     UPS: CP1500EPFCLCD@localhost (primary) (power value 1)
   0.000494     [D1] debug level is '1'
   0.000929     [D1] Saving PID 19 into /run/upsmon.pid
   0.001216     [D1] Succeeded to become_user(nut): now UID=100 GID=101
Init SSL without certificate database
   0.002909     upsnotify: failed to notify about state 2: no notification tech defined, will not spam more about it
   0.002927     [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
   0.003618     [D1] Logged into UPS CP1500EPFCLCD@localhost
 125.016864     Poll UPS [CP1500EPFCLCD@localhost] failed - Data stale
 125.016908     Communications with UPS CP1500EPFCLCD@localhost lost
sh: wall: not found
 130.017894     Poll UPS [CP1500EPFCLCD@localhost] failed - Data stale
 135.018449     Poll UPS [CP1500EPFCLCD@localhost] failed - Data stale
 140.019069     Poll UPS [CP1500EPFCLCD@localhost] failed - Data stale
 145.019420     Poll UPS [CP1500EPFCLCD@localhost] failed - Data stale
 150.019670     Poll UPS [CP1500EPFCLCD@localhost] failed - Data stale
 150.633707     Signal 15: exiting
 150.635504     upsmon parent: read
Network UPS Tools - UPS driver controller 2.8.1
Network UPS Tools - Generic HID driver 0.52 (2.8.1)
USB communication driver (libusb 1.0) 0.46
Using subdriver: CyberPower HID 0.8
WARNING: Needed to fix group access to filesystem socket of this driver, but failed; run the driver with more debugging to see how exactly.
Consumers of the socket, such as upsd data server, can fail to interact with the driver and represent the device: /var/run/nut/usbhid-ups-CP1500EPFCLCD
Ignoring invalid pid number 0
Network UPS Tools upsd 2.8.1
listening on 0.0.0.0 port 3493
Connected to UPS [CP1500EPFCLCD]: usbhid-ups-CP1500EPFCLCD
Found 1 UPS defined in ups.conf
   0.000000     Ignoring invalid pid number 0
Network UPS Tools upsmon 2.8.1
   0.000062     [D1] Just failed to send signal, no daemon was running
   0.000482     Using power down flag file /etc/killpower
   0.000698     UPS: CP1500EPFCLCD@localhost (primary) (power value 1)
   0.000770     [D1] debug level is '1'
   0.001433     [D1] Saving PID 19 into /run/upsmon.pid
   0.001898     [D1] Succeeded to become_user(nut): now UID=100 GID=101
Init SSL without certificate database
   0.004543     upsnotify: failed to notify about state 2: no notification tech defined, will not spam more about it
   0.004565     [D1] Trying to connect to UPS [CP1500EPFCLCD@localhost]
   0.005634     [D1] Logged into UPS CP1500EPFCLCD@localhost

So atm it will restart in a loop. Work, fail, restart, work, fail, restart, ...

instantlinux commented 10 months ago

In the container under directory /etc/nut, you'll find the config files. Copy those off into a directory on your local host (docker cp <container> /etc/nut/* ~/my-test-dir or something like that) and then add a mount definition for that path:

  services:
    app:
      ...
      volumes:
      - ~/my-test-dir:/etc/nut/local

Check that the value of MAXAGE in upsd.conf is set to your desired value (if the entrypoint script didn't work, it'll still be defaulted to 15 instead of overridden to 25). Once you're running with files in the local override path, then you can experiment with values such as POLLFREQ and DEADTIME which I don't try to manage with the current input variables (which work fine for APC and some other models, but now we're trying to get CyberPower working).

How often is the restart happening, after the first hour or so of running? If changes to some of those other variables have any effect, can you get it to stay stable for longer than several hours at a time? I'll be happy to add support for more variables once this is confirmed.

hellcry37 commented 10 months ago

I did not see a point in modify so much the docker to make a volume and add files there, I did all this in the container to get data for you.

docker exec -it nut-server sh / # cd /etc/nut/ /etc/nut # cat upsd.conf

# =======================================================================
# MAXAGE <seconds>
MAXAGE 25

So from here we conclude the MAXAGE var works fine.

Container restarts onece per 1h - 6h is not a well defined time tbh. In HA it dropped on: 16:41 19:39 20:32 23:40 05:09

As you can see not a well defined pattern :)

hellcry37 commented 10 months ago

switched to local config files mode! What should I test next?

instantlinux commented 10 months ago

I can't think of what specific changes might address the problem. Searching online, I found a few discussions about the CyberPower stale-data problem posted over the past several years:

Those, along with comments found in the distributed config files under /etc/nut, should help point you to the solutions others have found. Once you can get it stable 24hrs, post the resulting values here. Thanks!

hellcry37 commented 10 months ago

Whatever I do still fails, I'll just use the old one and move on with my life

instantlinux commented 10 months ago

OK fair enough. Hopefully the restart logic is now stable enough to use, and that others will post their successful parameter values for this model or others that don't behave the same way as APC.

tabertantrum commented 9 months ago

Hello @instantlinux, I've been facing the stale-data issue with two CyberPower UPS. The MAXAGE parameter does not appear to be working for me when creating the container. The upsd.conf file only includes: LISTEN 0.0.0.0 after the commented sections from NUT.

I am mounting a custom ups.conf and upsmon.conf file to configure both UPS devices in one container, which has been working fine aside from the stale-data issue.

By creating and mounting a upsd.conf with this:

MAXAGE 60
LISTEN 0.0.0.0

Both of the UPS devices have been running for 36 hours continuously without issue. I may try to lower the MAXAGE value defined in the upsd.conf file, but I'm not familiar enough with shell to know why the if block in the entrypoint.sh for MAXAGE appears to be ignored.

Here's the relevant details of my compose file in case this is helpful.

nut-upsd:
    image: instantlinux/nut-upsd
    container_name: nut-upsd
    volumes:
      - /opt/nut:/etc/nut/local
    devices:
      - /dev/bus/usb
    environment:
      API_PASSWORD: "XXXXXXXXX"
      MAXAGE: 60
    restart: unless-stopped

I'd be happy to test this out further with you to confirm the MAXAGE variable is resolving the issue.