sechub: PDS: Log error stream output of failed job
Problem
In case a PDS job fails, no additional information about the failure is getting logged other then that the job failed.
Solution
In case a PDS job fails, SecHub should retrieve the job_stream_error
text of the PDS job and log parts of it. Only a summary should be logged as the job_stream_error
output can get very long. For example, the first 2500 characters.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 31 (31 by maintainers)
Commits related to this issue
- Setup debugging environment for #1606. — committed to zigfridus/sechub by zigfridus 2 years ago
- Get error and output streams from database and log them. #1606 — committed to zigfridus/sechub by zigfridus 2 years ago
- Add forgotten files of previous commit. #1606 — committed to zigfridus/sechub by zigfridus 2 years ago
- Remove new use case and some minor fixes. #1606 — committed to zigfridus/sechub by zigfridus 2 years ago
- Create tests for #1606. — committed to zigfridus/sechub by zigfridus 2 years ago
- Test readability improvement. #1606 — committed to zigfridus/sechub by zigfridus 2 years ago
- Add auxiliary methods for truncating streams and appropriate tests. #1606 — committed to zigfridus/sechub by zigfridus 2 years ago
- Add auxiliary methods for truncating streams and appropriate tests. #1606 — committed to zigfridus/sechub by zigfridus 2 years ago
- Modify code after merge for use the new PDSExecutionCallableServiceCollection class. #1606 — committed to zigfridus/sechub by zigfridus 2 years ago
- Minor correction in the test #1606 — committed to zigfridus/sechub by zigfridus a year ago
@Jeeppler Thank you for the tip for readability. I made an improvement. Please have a look at my PR.
With the first, we checked whether your debugger settings are working. Result: the debugger works well. With number two, we checked whether the job really failed and it did.
The issue is, no exception is thrown if the job failed. As you can see in
PDSExecutionCallable.call()#140
:Basically, in all instances, where
result.failed
is set totrue
(result.failed = true
), we want to have the stream error and stream output data logged.In
PDSExecutionCallable.call()#131
the workspace is cleared, therefore access to the stream error and output files is not possible anymore. As a result, you need to get both stream error and output from the db.I would try the following:
Add a check in line 147, just after the log info message (in Pseudo code):
This might or might not be a working solution. I did not dig too deep into the source code. Give it a try and look at the code to gain a better understanding.