Actions
action #121444
closedlogreport o3: Can't open file ".../details-gd.json": No such file or directory at OpenQA/Schema/Result/JobModules.pm line 95 size:M
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
Updated by dheidler about 2 years ago
- Related to action #121441: logreport o3: Can't call method "results" on an undefined value at /.../OpenQA/WebAPI/Controller/Test.pm line 735 added
Updated by mkittler about 2 years ago
- Subject changed from logreport o3: Can't open file ".../details-gd.json": No such file or directory at OpenQA/Schema/Result/JobModules.pm line 95 to logreport o3: Can't open file ".../details-gd.json": No such file or directory at OpenQA/Schema/Result/JobModules.pm line 95 size:M
- Description updated (diff)
- Status changed from New to Workable
Updated by okurz about 2 years ago
- Status changed from Workable to In Progress
- Assignee set to okurz
Updated by okurz about 2 years ago
- Status changed from In Progress to Feedback
Updated by okurz about 2 years ago
- Due date set to 2022-12-20
https://github.com/os-autoinst/openQA/pull/4948 merged.
We can wait until tomorrow to see if there is any strongly-related problematic outcome. Otherwise I would resolve
Updated by livdywan almost 2 years ago
- Status changed from Feedback to Resolved
I think tomorrow has passend, more than a week even and we've seen no surprising side effects.
Updated by livdywan 8 months ago
- Copied to 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:M added
Actions