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

Agent error while installing tools (installed.json corruption) #977

Closed
Xayton opened this issue Jul 26, 2024 · 2 comments · Fixed by #983
Closed

Agent error while installing tools (installed.json corruption) #977

Xayton opened this issue Jul 26, 2024 · 2 comments · Fixed by #983
Assignees
Labels
conclusion: resolved Issue was resolved criticality: high Of high impact topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Milestone

Comments

@Xayton
Copy link
Contributor

Xayton commented Jul 26, 2024

Environment details: macOS, Agent 1.6.0
Reported by @charlesbones

The agent starts and the closes immediately with a panic, with the following logs:

ERRO[0001] Error downloading serial-discovery: invalid character ‘y’ after top-level value
panic: invalid character ‘y’ after top-level value
goroutine 69 [running]:
main.(*SerialPortList).runSerialDiscovery(0x1400027ecc0?)
	/Users/runner/work/arduino-create-agent/arduino-create-agent/serial.go:130 +0x568
main.(*SerialPortList).Run(0x140001a0180?)
	/Users/runner/work/arduino-create-agent/arduino-create-agent/serial.go:118 +0x2c
created by main.loop in goroutine 50
	/Users/runner/work/arduino-create-agent/arduino-create-agent/main.go:410 +0x1244

Looking at the message, this might be a installed.json corruption problem. See also this previous issue: #635

Here is the content of the JSON file on the same machine (note the wrong data at the end):

{"arduino-fwuploader":"/Users/carlos/.arduino-create/arduino/arduino-fwuploader/2.4.1","arduino-fwuploader-2.4.1":"/Users/carlos/.arduino-create/arduino/arduino-fwuploader/2.4.1","bossac":"/Users/carlos/.arduino-create/arduino/bossac/1.7.0","bossac-1.7.0":"/Users/carlos/.arduino-create/arduino/bossac/1.7.0","bossac-1.9.1-arduino5":"/Users/carlos/.arduino-create/arduino/bossac/1.9.1-arduino5","fwupdater":"/Users/carlos/.arduino-create/arduino/fwupdater/0.1.12","fwupdater-0.1.12":"/Users/carlos/.arduino-create/arduino/fwupdater/0.1.12","rp2040tools":"/Users/carlos/.arduino-create/arduino/rp2040tools/1.0.6","rp2040tools-1.0.6":"/Users/carlos/.arduino-create/arduino/rp2040tools/1.0.6","serial-discovery":"/Users/carlos/.arduino-create/builtin/serial-discovery/1.4.1","serial-discovery-1.4.0":"/Users/carlos/.arduino-create/builtin/serial-discovery/1.4.0","serial-discovery-1.4.1":"/Users/carlos/.arduino-create/builtin/serial-discovery/1.4.1"}y/1.4.1"}

Additional context

Additional reports

@Xayton Xayton added this to the 1.7.0 milestone Jul 26, 2024
@Xayton Xayton added type: imperfection Perceived defect in any part of project criticality: high Of high impact labels Jul 26, 2024
@umbynos
Copy link
Contributor

umbynos commented Aug 1, 2024

This affects other OS too, like windows. And causes this error too:

get location of {runtime.tools.bossac-1.9.1-arduino5.path}: invalid character '\\' after top-level value

A mitigation for now it to reinstall the agent, which causes a deletion of the corrupted json file.

image

@MatteoPologruto MatteoPologruto self-assigned this Aug 1, 2024
@MatteoPologruto MatteoPologruto linked a pull request Aug 1, 2024 that will close this issue
2 tasks
@per1234 per1234 added the topic: code Related to content of the project itself label Aug 3, 2024
@Xayton Xayton changed the title Agent cannot start due to an error while starting or installing "serial-discovery" Agent while installing tools (installed.json corruption) Aug 5, 2024
@Xayton Xayton changed the title Agent while installing tools (installed.json corruption) Agent error while installing tools (installed.json corruption) Aug 5, 2024
@Xayton
Copy link
Contributor Author

Xayton commented Aug 5, 2024

The problem has been fixed by improving the locking code (to avoid file corruption) and by handling the case of an existing installed.json file that is already corrupted.

@per1234 per1234 added the conclusion: resolved Issue was resolved label Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved criticality: high Of high impact topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants