action #75346
closedt/api/08-jobtemplates.t started failing in OBS checks
Description
Observation¶
https://build.opensuse.org/package/live_build_log/devel:openQA/openQA/openSUSE_Factory/x86_64
showing
[ 1037s] [error] Can't call method "server" on an undefined value at /usr/lib/perl5/vendor_perl/5.30.3/Mojo/Server/Daemon.pm line 55.
[ 1037s] [debug] [TcEtNGMg] 400 Bad Request (0.008405s, 118.977/s)
[ 1037s] ok 18 - POST /api/v1/job_templates_scheduling/1001
[ 1037s] ok 19 - 400 Bad Request
[ 1037s] not ok 20 - specified schema not found
[ 1037s] 1..20
[ 1037s] not ok 33 - Schema handling
...
[ 1074s] ./t/api/08-jobtemplates.t (Wstat: 256 Tests: 66 Failed: 1)
[ 1074s] Failed test: 33
[ 1074s] Non-zero exit status: 1
also observed in devel:openQA:tested/openQA in openSUSE_Factory/x86_64 as well as
openSUSE:Factory/openQA in standard/x86_64
Steps to reproduce¶
- As OBS can reproduce it likely we can locally given the right package set :)
Problem¶
Might be related to upgrades of any dependencies in openSUSE:Factory
Updated by okurz about 4 years ago
- Related to action #75370: unstable/flaky/sporadic t/full-stack.t failing on master (circleCI) "worker did not propagate URL for os-autoinst cmd srv within 1 minute" added
Updated by tinita about 4 years ago
Since it was time for me to do an update, I just tested a bit and JSON::Validator seems to be the problem, but not yet sure why:
JSON::Validator 4.09: ok
JSON::Validator 4.10: fail
Updated by tinita about 4 years ago
It just tries several methods to load the schema file:
https://github.com/mojolicious/json-validator/blob/master/lib/JSON/Validator/Store.pm#L50
sub load {
return
$_[0]->_load_from_url($_[1])
|| $_[0]->_load_from_data($_[1])
|| $_[0]->_load_from_text($_[1])
|| $_[0]->_load_from_file($_[1])
|| $_[0]->_load_from_app($_[1])
|| $_[0]->get($_[1])
|| raise 'JSON::Validator::Exception', "Unable to load schema $_[1]";
}
When _load_from_file
returns undef
(e.g. when the file does not exist), it calls _load_from_app
:
https://github.com/mojolicious/json-validator/blob/master/lib/JSON/Validator/Store.pm#L56
which fails on this line:
my $tx = $self->ua->get($url);
Updated by tinita about 4 years ago
An easy workaround for us would be to check file existance/readability ourselves before passing it to JSON::Validator.
Updated by tinita about 4 years ago
- Status changed from Workable to In Progress
- Assignee set to tinita
The previous version 4.09 had a check for $self->ua->server->app
before loading from a url that does not start with http.
Updated by tinita about 4 years ago
Reproducable also when changing the test in t/16-utils-job-templates.t
from
$errors = validate_data(schema_file => 'does-not-exist', data => $template);
to
$errors = validate_data(schema_file => '/does-not-exist', data => $template);
Updated by tinita about 4 years ago
Reported issue: https://github.com/mojolicious/json-validator/issues/231
Updated by tinita about 4 years ago
PR for workaround: https://github.com/os-autoinst/openQA/pull/3491
Updated by tinita about 4 years ago
- Status changed from In Progress to Resolved
PR merged, build fixed