Opened 8 weeks ago

Closed 6 weeks ago

Last modified 6 weeks ago

#1898 closed defect (wontfix)

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

Reported by: Eaton Zveare Owned by:
Priority: minor Milestone:
Component: smartctl Version: 7.4
Keywords: json 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 (6)

comment:1 by Christian Franke, 8 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, 8 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, 8 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.

comment:4 by Eaton Zveare, 6 weeks ago

Sorry for the delay. I have now confirmed that using the non nc version of smartctl fixes the problem. I will just use that version now, so no action is required here. Thanks for the support!

comment:5 by Eaton Zveare, 6 weeks ago

Resolution: wontfix
Status: newclosed

comment:6 by Christian Franke, 6 weeks ago

Keywords: json added
Milestone: undecided
Note: See TracTickets for help on using tickets.