Australian cloud for business software — built and run in Sydney since 2002

NetLeverage
NetLeverage

NUT upsc "Error: Data stale" or "Driver not connected": find out whether the driver is missing or has lost the UPS

Technical article
Troubleshooting

About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.

When upsc prints Error: Driver not connected, the NUT data server (upsd) is up but cannot reach the driver for that UPS. When it prints Error: Data stale, upsd is connected to the driver, but the driver has stopped providing fresh readings. NUT's network protocol document describes the first as a driver that is not running or a wrong ups.conf, and the second as a driver that has lost communication with the hardware. Check the driver before touching upsd or upsmon.

What the error means

upsc prints Error: followed by the client library's text. In the NUT source, upsclient.c defines the strings Data stale and Driver not connected, and upsc.c prints failures as Error: %s. upsmon logs the same two phrases when it cannot poll a device. The upsmon manual says it "normally reports polling failures for each device that are in place for each POLLFREQ loop (e.g. "Data stale" or "Driver not connected") to system log".

The network protocol document gives the server-side meaning of each:

  • DRIVER-NOT-CONNECTED: "This usually means that the driver is not running, or if it is, the ups.conf is misconfigured."
  • DATA-STALE: "This generally means that the driver is running, but it has lost communications with the hardware. Check the physical connection to the equipment."

The upsd manual adds the mechanism: "upsd expects the drivers to either update their status regularly or at least answer periodic queries, called pings. If a driver doesn't answer, upsd will declare it "stale" and no more information will be provided to the clients." The MAXAGE setting in upsd.conf documents the allowance: "upsd usually allows a driver to stop responding for up to 15 seconds before declaring the data "stale"."

Likely causes

Cause What you see How to confirm
The driver is not running Driver not connected upsdrvctl status shows no running process for that UPS
upsd was started before the driver Data stale or Driver not connected right after boot The upsd manual says to "make sure that you start your driver(s) before starting upsd"
Wrong driver, port or section name in ups.conf The driver exits at start, or upsc names a UPS the server does not list upsc -l localhost does not list the name you query; the log shows the driver's complaint
The driver lost the UPS (cable, USB, serial, network) Data stale that began at a known time The log shows driver messages; the USB device is missing from lsusb; for an SNMP UPS the network path is down
USB permission problem The driver fails at start with Got EPERM: Operation not permitted That text appears in the log when the driver starts
A UPS that answers slowly at the default polling rate Repeating timeouts in the log The usbhid-ups manual describes "Repetitive timeout and staleness" and says to raise pollinterval

Prove the cause before changing anything

All of these only read.

1. Ask the server which UPS names it knows. The upsc manual documents -l host as listing "all UPS names configured at host".

upsc -l localhost

The name you pass to upsc ups@host must be on this list. A good result lists your UPS. A missing name points at ups.conf or at upsd not having loaded it.

2. Query the UPS.

upsc rackups@localhost

A good result prints the variable list. Driver not connected or Data stale is the symptom.

3. Ask whether the driver is running. The upsdrvctl manual says status "reports more information — also the driver name, the PID if it is running, and result of a signal probe to check it is responding".

upsdrvctl status

The status command is in the 2.8.5.1898 manual; a reading of drivers/upsdrvctl.c finds no status command at tag v2.8.2 and one at tag v2.8.3, so on an older release this command is not available. The upsdrvctl manual documents no other way to see whether a driver process is running; use your distribution's service tool for the driver. A running, responding driver shows a process ID. A missing process means cause 1.

4. See what the driver start would do, without doing it. The upsdrvctl manual says testing mode (-t) makes it "display the actions it would execute without actually doing them".

upsdrvctl -t start rackups

This shows the driver program and options taken from ups.conf. Read them against the hardware.

5. Read the system log. The upsd manual says that when data goes stale because the driver cannot talk to the UPS, "the driver should also provide diagnostic information in the syslog".

journalctl -b

Look for lines from upsd or the driver around the time the readings stopped. The journalctl manual documents -b for the current boot.

6. Check the UPS is visible to the operating system. For a USB UPS, the usbhid-ups manual points to lsusb(8) to see vendor and product identifiers.

lsusb

If the UPS is absent, the cause is the cable, port, hub or power, not NUT.

7. Read the section in ups.conf. The file lives in your NUT configuration directory. The upsd manual gives /usr/local/ups/etc as the usual built-in default ("often") when NUT_CONFPATH is not set; packaged installs often use another directory.

cat /etc/nut/ups.conf

Check driver, port and the section name. For USB drivers the usbhid-ups manual says a port value must be set, "typically auto".

Fix

Start the driver, then upsd

The upsdrvctl manual warns that service instances prepared by nut-driver-enumerator "can conflict with manual execution of drivers", so on a system that manages drivers as services, use your distribution's service documentation to start the driver. The steps below are for a system without such units, and need upsdrvctl status (NUT 2.8.3 or later) for the saved state.

First save the current driver status:

upsdrvctl status > /root/nut-drivers-before.2026-12-01.txt

Risk: the next command starts a driver that opens the UPS port or USB device and talks to the hardware. If the device has a configuration fault, the driver may stop again, and a running upsmon may report the UPS as unreachable until it succeeds.

Start the driver for one UPS. The manual says start takes an optional UPS name from ups.conf, and by default waits up to maxstartdelay, 75 seconds:

upsdrvctl start rackups

To undo it: first print the saved status and check that the driver was not running before:

cat /root/nut-drivers-before.2026-12-01.txt

Run the next command only if the saved file shows no running process for rackups. The manual says stop "does not send commands to the UPS".

upsdrvctl stop rackups

Correct ups.conf, or slow the polling

First save the current file:

cp -p /etc/nut/ups.conf /etc/nut/ups.conf.2026-12-01

Disruptive step: the next edit and the driver restart after it interrupt monitoring of this UPS, so no readings, alerts or shutdown decisions are available for that UPS until the driver is back. Do it only while mains power is on and no shutdown is pending.

Edit the section for the UPS. Fix driver, port or the section name, or, for the repeating-timeout case in the usbhid-ups manual, set a higher pollinterval; the manual suggests "a higher value (such as 10 seconds)" and says that beyond 10 or 15 seconds you might also want to increase pollfreq by the same factor. Then restart the driver, and make upsd re-read its configuration, which the upsd manual says you can do by starting it again with -c reload (or with your distribution's reload action):

upsdrvctl stop rackups
upsdrvctl start rackups
upsd -c reload

To undo it: restore the saved file under its original name, then restart the driver, reload upsd and check.

cp -p /etc/nut/ups.conf.2026-12-01 /etc/nut/ups.conf
upsdrvctl stop rackups
upsdrvctl start rackups
upsd -c reload
upsc rackups@localhost

Cable, USB, port or network path

If lsusb does not list the UPS, or the log shows the driver losing it, the fix is outside NUT: reseat or replace the cable, try another port, and for an SNMP UPS check the network path, as the upsd manual says. For Got EPERM: Operation not permitted, the usbhid-ups manual says "You have forgotten to install the hotplug files" and that you need to "restart hotplug" so the change applies.

Example (illustrative): on db01, ups.conf has a [rackups] section with driver = usbhid-ups and port = auto. After a reboot, upsc rackups@localhost prints Error: Driver not connected. upsc -l localhost lists rackups, so upsd loaded the file. upsdrvctl status shows no process for rackups, and lsusb lists the UPS. The driver simply was not started. The engineer saves the status, runs upsdrvctl start rackups, and upsc rackups@localhost then prints the variable list.

Confirm the fix

  1. upsdrvctl status shows the driver running and responding.
  2. upsc rackups@localhost prints the variables instead of an error.
  3. The log no longer shows new Data stale or Driver not connected lines from upsmon.
  4. Repeat the query after a minute: the 15-second MAXAGE default in the upsd.conf manual means that a driver which updates only occasionally would be declared stale again; the page does not say this directly.

What to watch afterwards

  • Make sure drivers start before upsd after a reboot. The upsd manual says to start them first.
  • If a UPS is expected to be away for long periods, POLLFAIL_LOG_THROTTLE_MAX in upsmon.conf reduces repeated log lines; the upsmon manual describes it.

Risks and limits

  • These commands have not been run or lab-tested.
  • The manual pages used here describe a NUT development snapshot (2.8.5.1898); an older packaged release may differ in options and unit names.
  • upsdrvctl and upsdrvsvcctl suit different installs. Use the one your distribution's service units expect.
  • Do not run upsdrvctl shutdown; the manual warns it "will probably power off your computers".
  • Data stale can come from the UPS itself, for example a firmware or battery fault. NUT cannot repair that.

Sources

  • upsd(8) — Network UPS Tools, page footer 2026-11-28 (NUT 2.8.5.1898), accessed 1 December 2026
  • upsc(8) — Network UPS Tools, page footer 2026-11-28 (NUT 2.8.5.1898), accessed 1 December 2026
  • upsd.conf(5) — Network UPS Tools, page footer 2026-11-28 (NUT 2.8.5.1898), accessed 1 December 2026
  • ups.conf(5) — Network UPS Tools, page footer 2026-11-28 (NUT 2.8.5.1898), accessed 1 December 2026
  • upsdrvctl(8) — Network UPS Tools, page footer 2026-11-28 (NUT 2.8.5.1898), accessed 1 December 2026
  • upsmon(8) — Network UPS Tools, page footer 2026-11-28 (NUT 2.8.5.1898), accessed 1 December 2026
  • usbhid-ups(8) — Network UPS Tools, page footer 2026-11-28 (NUT 2.8.5.1898), accessed 1 December 2026
  • Network protocol information — Network UPS Tools source repository, tag v2.8.5, no date shown, accessed 1 December 2026
  • upsclient.c — Network UPS Tools source repository, tag v2.8.5, no date shown, accessed 1 December 2026
  • upsc.c — Network UPS Tools source repository, tag v2.8.5, no date shown, accessed 1 December 2026
  • upsdrvctl.c, tag v2.8.2 — Network UPS Tools source repository, tag v2.8.2, no date shown, accessed 1 December 2026
  • upsdrvctl.c, tag v2.8.3 — Network UPS Tools source repository, tag v2.8.3, no date shown, accessed 1 December 2026
  • journalctl(1) — Debian Manpages, bookworm, source updated 2025-03-06, accessed 1 December 2026