arduino_ci: Build failure and cryptic error when arduino binary fails to list its preferences
System
- OS: GitLab/Linux
ruby -v
:ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]
bundle -v
:Bundler version 1.16.1
bundle info arduino_ci
:Installing arduino_ci 0.2.0
- Arduino IDE version:
java -version
:- URL of failing CI job: https://gitlab.com/robotics_fun/DC_motors/-/jobs/260929416
- URL of your Arduino project: https://gitlab.com/robotics_fun/DC_motors
Issue Summary
Originally posted as part of #127
You can get the error get_pref': undefined method
[]’ for nil:NilClass` when trying to launch the CI script.
$ bundle exec arduino_ci_remote.rb
Attempting to download Arduino package with open-uri...[note: elipses elided]...
Extracting archive with tar
Located Arduino binary... /root/arduino_ci_ide/arduino
/var/lib/gems/2.5.0/gems/arduino_ci-0.2.0/lib/arduino_ci/arduino_cmd.rb:106:in `get_pref': undefined method `[]' for nil:NilClass (NoMethodError)
from /var/lib/gems/2.5.0/gems/arduino_ci-0.2.0/lib/arduino_ci/arduino_cmd.rb:78:in `lib_dir'
from /var/lib/gems/2.5.0/gems/arduino_ci-0.2.0/exe/arduino_ci_remote.rb:176:in `perform_unit_tests'
from /var/lib/gems/2.5.0/gems/arduino_ci-0.2.0/exe/arduino_ci_remote.rb:383:in `<top (required)>'
from /usr/local/bin/arduino_ci_remote.rb:23:in `load'
from /usr/local/bin/arduino_ci_remote.rb:23:in `<main>'
This happens when arduino --get-pref
fails, as no settings are parsed.
$ /root/arduino_ci_ide/arduino --get-pref
Picked up JAVA_TOOL_OPTIONS:
Loading configuration...
Initializing packages...
cc.arduino.contributions.SignatureVerificationFailedException: package_index.json file signature verification failed
at cc.arduino.contributions.packages.ContributionsIndexer.parseIndex(ContributionsIndexer.java:91)
at processing.app.BaseNoGui.initPackages(BaseNoGui.java:483)
at processing.app.Base.<init>(Base.java:262)
at processing.app.Base.main(Base.java:145)
Expected behavior
The code should react immediately to the failure of the arduino binary, and print a helpful error message. It should also raise some form of exception and abort (as nothing can be salvaged).
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 18
https://gitlab.com/robotics_fun/DC_motors/-/jobs/272742857