Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When calling /tasks/{id}/details Octopus returns a HTTP 500 error (An error occured reading the log file) #8171

Closed
david-staniec-octopus opened this issue May 30, 2023 · 2 comments
Assignees
Labels
kind/bug This issue represents a verified problem we are committed to solving

Comments

@david-staniec-octopus
Copy link

david-staniec-octopus commented May 30, 2023

Severity

Not causing deployment failures, but can cause TeamCity builds to fail due to the error code from the REST endpoint

Version

This was reported on 2022.3.10863, but can see similar reports of this on older versions. Another issue added retries to reduce occurrences of this error. However, it is still possible to experience the issue if the file is not healed before this query returns the result to the caller.

Latest Version

I could reproduce the problem in the latest build

What happened?

Octopus Server returned an error: An error occured reading the log file. This does not affect the deployment. This usually indicates a problem with the storage interface if using a SAN, or the network if using NAS or DFS. See #3550
Unexpected character encountered while parsing number: T. Path '', line 1533, position 2608.
Error from Octopus Server (HTTP 500 InternalServerError)

I would have expected to instead have the valid results up to the invalid log entry be returned.

Reproduction

Call the /tasks/{id}/details REST endpoint after editing the task log to invalidate the JSON. e.g. remove an opening bracket on one of the log lines.

Error and Stacktrace

Error will differ based on where the issue in JSON document is, but will look similar to the following:

Error from Octopus Server (HTTP 500 InternalServerError)
{
  "ErrorMessage": "An error occured reading the log file. This does not affect the deployment. This usually indicates a problem with the storage interface if using a SAN, or the network if using NAS or DFS. See https://github.com/OctopusDeploy/Issues/issues/3550.\r\nJsonToken EndArray is not valid for closing JsonType None. Path '', line 6, position 178."
}

More Information

No response

Workaround

No response

@david-staniec-octopus david-staniec-octopus added the kind/bug This issue represents a verified problem we are committed to solving label May 30, 2023
@david-staniec-octopus david-staniec-octopus self-assigned this May 30, 2023
@david-staniec-octopus david-staniec-octopus changed the title When calling /tasks/{id}/details Octopus returns an error (An error occured reading the log file. This does not affect the deployment. This usually indicates a problem with the storage interface if using a SAN, or the network if using NAS or DFS) When calling /tasks/{id}/details Octopus returns a HTTP 500 error (An error occured reading the log file) May 30, 2023
@octoreleasebot
Copy link

octoreleasebot commented May 31, 2023

Release Note: Calling the tasks/{id}/details REST endpoint will now return all valid log entries before invalid JSON is detected in a log file. This fix also ensures Task Log Aggregation does not aggregate task log files that contain invalid JSON entries, and leaves related task logs in their original unaggregated form.

@Octobob
Copy link
Member

Octobob commented Aug 22, 2023

🎉 The fix for this issue has been released in:

Release stream Release
2023.2 2023.2.12206
2023.3 2023.3.3099
2023.4+ all releases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug This issue represents a verified problem we are committed to solving
Projects
None yet
Development

No branches or pull requests

3 participants