Skip to content
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

Error parsing the power_data.json from Scaphandre #49

Closed
lcanagui opened this issue May 6, 2024 · 3 comments
Closed

Error parsing the power_data.json from Scaphandre #49

lcanagui opened this issue May 6, 2024 · 3 comments

Comments

@lcanagui
Copy link

lcanagui commented May 6, 2024

Hello,

I get this error with the 0.0.8 of boagent:

File "/home/boagent/./boagent/api/api.py", line 193, in metrics get_metrics( File "/home/boagent/./boagent/api/api.py", line 467, in get_metrics power_data = get_power_data(start_time, end_time) File "/home/boagent/./boagent/api/api.py", line 605, in get_power_data data = json.loads(formatted_data) File "/usr/local/lib/python3.10/json/init.py", line 346, in loads return _default_decoder.decode(s) File "/usr/local/lib/python3.10/json/decoder.py", line 340, in decode raise JSONDecodeError("Extra data", s, end) json.decoder.JSONDecodeError: Extra data: line 1 column 3292 (char 3291)

It may be a problem while parsing this power_data.json generated by Scaphandre.
power_data.json

@bdromard
Copy link
Collaborator

bdromard commented May 7, 2024

Hello @lcanagui !

I just tried to recreate the bug by querying the Boagent API (through the /query endpoint), and indeed I got the same error as yours with the latest docker-compose version for Boagent. Turned out the Docker image for scaphandre:dev I was using was an old version. After deleting it and downloading the latest Scaphandre Docker image (hubblo/scaphandre:dev), I get a 200 OK response from the Boagent API.

If you were using Boagent in a similar way, could you check your version of the Scaphandre Docker image you are using, delete it and download its latest version ?

Thanks in advance!

@demeringo
Copy link
Collaborator

Hi @bdromard and thank you.

We are now using scaphandre:dev

I mention another issue here (as this is likely related to @lcanagui tests as we are using the same physical host and account).
I noticed that we have to run the scaph container in privileged mode to access the powercap files.

hubblo-org/scaphandre#386

@bdromard
Copy link
Collaborator

Good to hear that it seems that your issue has been resolved!

Closing this issue now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants