Skip to content

fix(webdav): log unmapped thumbnail errors at error level (#12663) - #12668

Merged
2403905 merged 1 commit into
owncloud:masterfrom
kobergj:forwardport/master/webdav-thumbnail-error-logging
Jul 28, 2026
Merged

2403905 merged 1 commit into
owncloud:masterfrom
kobergj:forwardport/master/webdav-thumbnail-error-logging

Conversation

@kobergj

@kobergj kobergj commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Forward port of #12663 to master. Companions: #12666 (stable-8.1), #12667 (stable-8.2).

Failures of the thumbnails service were logged at debug level only, so errors which are not a property of the requested file — such as the thumbnails service being unreachable — were invisible at production log levels. A complete preview outage produced HTTP 500 responses without a single log line explaining them.

Unmapped errors are now logged at error level, while expected per-file outcomes such as an unsupported file type or a file still being processed stay at debug level. Thumbnail and PublicThumbnail previously logged at error level for every failure, including expected 404s for unsupported file types, and did so via g.log so the message carried no request id — both now log only in the default: branch, using the request-scoped logger.

Also adds the missing codesEnum entries for 403, 425 and 429 and falls back to a generic exception name for any remaining unmapped status code, so error responses no longer render an empty <s:exception></s:exception>. newErrResponse previously did a bare map lookup, so any unmapped code produced an empty exception element.

Conflict resolution: the cherry-pick needed manual resolution because master already renders the sanitized message errInternalError("could not get thumbnail") instead of err.Error(). That line is context directly below the insertion point, so git could not place the hunk. The sanitized message is kept unchanged; the added and removed lines are byte-identical to #12667.

Adds services/webdav/pkg/service/v0/service_test.go — the package had no test file before.

🤖 Generated with Claude Code

…2663)

Failures of the thumbnails service were logged at debug level only, so
errors which are not a property of the requested file — such as the
thumbnails service being unreachable — were invisible at production log
levels. A complete preview outage produced HTTP 500 responses without a
single log line explaining them.

Unmapped errors are now logged at error level, while expected per-file
outcomes such as an unsupported file type or a file still being processed
stay at debug level. Two of the four thumbnail handlers also logged
without the request context, so their messages carried no request id.

Also add the missing codesEnum entries for 403, 425 and 429 and fall back
to a generic exception name for any remaining unmapped status code, so
error responses no longer render an empty <s:exception></s:exception>.

Co-authored-by: Claude Opus 5 <[email protected]>
(cherry picked from commit 6950f47)
@kobergj
kobergj requested a review from a team as a code owner July 28, 2026 14:00
@kw-security

kw-security commented Jul 28, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@2403905
2403905 merged commit 0450a0d into owncloud:master Jul 28, 2026
68 checks passed
kavitagautam pushed a commit to kavitagautam/ocis-fork that referenced this pull request Jul 29, 2026
…2663) (owncloud#12668)

Failures of the thumbnails service were logged at debug level only, so
errors which are not a property of the requested file — such as the
thumbnails service being unreachable — were invisible at production log
levels. A complete preview outage produced HTTP 500 responses without a
single log line explaining them.

Unmapped errors are now logged at error level, while expected per-file
outcomes such as an unsupported file type or a file still being processed
stay at debug level. Two of the four thumbnail handlers also logged
without the request context, so their messages carried no request id.

Also add the missing codesEnum entries for 403, 425 and 429 and fall back
to a generic exception name for any remaining unmapped status code, so
error responses no longer render an empty <s:exception></s:exception>.


(cherry picked from commit 6950f47)

Co-authored-by: Claude Opus 5 <[email protected]>
@kobergj
kobergj deleted the forwardport/master/webdav-thumbnail-error-logging branch July 29, 2026 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants