Opened 2 weeks ago

Last modified 2 weeks ago

#1898 new defect

JSON output is empty in rare cases (smartctl-nc)

Reported by: Eaton Zveare Owned by:
Priority: minor Milestone: undecided
Component: smartctl Version: 7.4
Keywords: Cc:

Description

I received a report from a user that basically indicates the JSON output from smartctl is completely empty. No opening/closing brackets or any other text is output to the command line.

Example command:

smartctl-nc --device={DeviceType} --info --get=security --json pd{PhysicalDeviceNum}

This is on Windows 11. I've reviewed the smartctl code, but can't find any clues. This is also a very isolated case and the first time I have seen it, so it may be some system configuration problem, but am hoping someone could point me in the right direction in diagnosing this.

Also, the non-JSON commands output without issue. This is strictly JSON related.

Change History (3)

comment:1 by Christian Franke, 2 weeks ago

Milestone: undecided
Summary: JSON output is empty in rare casesJSON output is empty in rare cases (smartctl-nc)

smartctl-nc output is only available if redirected. Try for example:
smartctl-nc ... | more

See the FAQ for the differences between smartctl-nc vs. smartctl.

comment:2 by Eaton Zveare, 2 weeks ago

I should clarify that I am indeed redirecting the output, so the usage is correct, and it works for 99% of users. Not sure why it's tripping up in this one case - any ideas?

comment:3 by Christian Franke, 2 weeks ago

  • Does it only fail with smartctl-nc.exe or also with smartctl.exe?
  • Does the problem persist if --get=security is removed?
  • Redirect stderr to a file (2>error.txt) and check its contents.
  • Try to run from Cygwin or MSYS2 "Terminal" (aka mintty) if available.
Note: See TracTickets for help on using tickets.