Opened 2 days ago
Last modified 2 days 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 , 2 days ago
Milestone: | → undecided |
---|---|
Summary: | JSON output is empty in rare cases → JSON output is empty in rare cases (smartctl-nc) |
comment:2 by , 2 days 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 , 2 days ago
- Does it only fail with
smartctl-nc.exe
or also withsmartctl.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.
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
.