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 #1

Updated by tinita over 1 year ago

  • Description updated (diff)
Actions #2

Updated by dheidler over 1 year 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
Actions #3

Updated by mkittler over 1 year 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
Actions #4

Updated by okurz over 1 year ago

  • Status changed from Workable to In Progress
  • Assignee set to okurz
Actions #5

Updated by okurz over 1 year ago

  • Status changed from In Progress to Feedback
Actions #6

Updated by okurz over 1 year 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

Actions #7

Updated by livdywan over 1 year 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.

Actions #8

Updated by livdywan about 1 month 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

Also available in: Atom PDF