-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nvme-cli sometimes returns malformed JSON #215
Comments
Hi, I'm encountering the same issue with nvme-cli on Debian 11, so can't have nvme temp on the freon extension right now :( If I can help debugging, let me know |
This would most likely be an issue in nvme-cli, as we already only parse @BathoryPeter, what version of @Darcidride is the malformed data exactly the same? I ask because Debian 11 packages nvme-cli 1.12, and on that version By the way, it seems that particular check & error message have also been removed entirely in 1.15, which may also explain why I can't reproduce the problem on my system. Related: #184 |
nvme version 1.14 on Ubuntu 21.10 You are right, redirecting stderr solves the problem. What do you think about ignoring error messages in this way: |
That change shouldn't be necessary (I'm not even sure it's valid), since we're already only trying to parse the output in return JSON.parse(GLib.spawn_command_line_sync(`${nvme} ${argv} -o json`)[1].toString())
^^^
stdout Can you open Looking Glass—
Like I mentioned, I don't think the second one is valid, but I'm interested in seeing the output of both. Footnotes |
I see, thanks for linking the docs. Indeed, the output of the two command was the same. I did some experiment by adding some logging to getNvmeData(). global.log(`argv: "${argv}"`)
global.log(GLib.spawn_command_line_sync(`${nvme} ${argv} -o json`)[1].toString()); I got the following messages:
This is because smart-log requires sudo, but nvme-cli spams the stdout with non json error message. |
Oh, that makes sense.
That would be better, yes. It will probably still result in an exception, but a more specific one that's easier for the end user to interpret (and end up at #184). By the way, with Linux 5.11 (based on knowing that you're running Ubuntu 20.11), you shouldn't really need |
A controlled exception would be much better. A few weeks ago I tried to set the SSD temp display in preferences, without success. At next login Freon didn't want to load. I tried to reinstall, update, downgrade and a lot of other magic, and ended up in dconf editor, where I deleted drive-utility key, which solved the problem (but I still didn't have SSD temp). That's why I opened this issue. Does Freon use hwmon? I can't find it in the code. Seeing |
Yes, that's arguably the main source Freon gets its temperatures from. And the only one enabled by default. IIRC, Freon uses the output from And since Freon simply uses |
Oh, I get it! So on a regular install, selecting None in preferences must be enough. Then the preferences window is a bit misleading. I thought selecting None means HDD temperature querrying is switched off. Running
And really, Freon showed me Composite and Sensor 1 all the time. What bad names! |
When I select nvme-cli in settings, I get the following message in journal:
If I'm right, the mentioned code executes
nvme list -o json
. Running this command in terminal returns:Which cannot be parsed because the "Failed to" string.
The text was updated successfully, but these errors were encountered: