Project

General

Profile

Actions

action #121444

closed

logreport o3: Can't open file ".../details-gd.json": No such file or directory at OpenQA/Schema/Result/JobModules.pm line 95 size:M

Added by tinita over 1 year ago. Updated over 1 year ago.

Status:
Resolved
Priority:
High
Assignee:
Category:
Regressions/Crashes
Target version:
Start date:
2022-12-05
Due date:
2022-12-20
% Done:

0%

Estimated time:

Description

Observation

We saw the following error on o3 today:

[2022-12-05T10:45:55.571462Z] [error] [JBm0Hyi1i4oq] Can't open file
"/var/lib/openqa/testresults/01371/01371619-opensuse-Jump:15.2-DVD-ppc64le-Build39.13-extra_tests_in_textmode@ppc64le/
details-gd.json": No such file or directory at /usr/share/openqa/script/../lib/OpenQA/Schema/Result/JobModules.pm line
95.

It seems like the test got deleted because we have this in the access log:

[05/Dec/2022:10:45:50 +0000] "GET /tests/1371619 HTTP/1.1" 200

So the test was still there but when loading results it was already deleted, because now it returns a 404.

The according code is

 93     return {} unless -r (my $file = path($dir, "details-$name.json"));
 94 
 95     my $json_data = $file->slurp;
 96     die qq{Malformed JSON file "$file": $@} unless my $json = eval { decode_json($json_data) };

so not an atomic operation.

Acceptance criteria

  • AC1: A unit test ensures that a not readable test module result file is handled and gracefully returned to the web UI and no error in log
  • AC2: The handling is atomic, not "check if readable and then read"

Suggestions

  • Instead of trying to read and then fail we should handle the read attempt as we handle the exception in line 96 and return {} in case of error

Related issues 2 (0 open2 closed)

Related to openQA Project - action #121441: logreport o3: Can't call method "results" on an undefined value at /.../OpenQA/WebAPI/Controller/Test.pm line 735Resolveddheidler2022-12-05

Actions
Copied to openQA Project - action #159447: logreport o3: Can't open file ".../libssh-18.txt": No such file or directory at OpenQA/Schema/Result/JobModules.pm line 113 size:MResolvedmkittler2022-12-05

Actions
Actions

Also available in: Atom PDF