Skip to content

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

Merged
2403905 merged 1 commit into
owncloud:stable-8.0from
kobergj:fix/webdav-thumbnail-error-logging
Jul 28, 2026
Merged

2403905 merged 1 commit into
owncloud:stable-8.0from
kobergj:fix/webdav-thumbnail-error-logging

Conversation

@kobergj

@kobergj kobergj commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Description

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, which made diagnosis rely on reverse-engineering the response body size.

Changes:

  • All four thumbnail handlers (SpacesThumbnail, Thumbnail, PublicThumbnail, PublicThumbnailHead) now log the unmapped default: case at error level. Expected per-file outcomes (unsupported file type, file still processing, bad request, forbidden, rate limited) stay at debug level.
  • Thumbnail and PublicThumbnail logged via g.log instead of the request-scoped logger, so their messages carried no request id. Both now use logger.
  • codesEnum only mapped four status codes, so responses for every other code rendered an empty <s:exception></s:exception>. Added the missing entries for 403, 425 and 429, and unmapped codes now fall back to a generic exception name.

500 is deliberately left unmapped and handled by the fallback, mirroring reva, which has StatusInternalServerError commented out of its own sabreException map.

Related Issue

N/A

Motivation and Context

A preview outage in a production instance returned ~1700 HTTP 500s per day for six days while every backend service logged nothing, because the only log statement on that path was at debug level. Raising the severity of infrastructure failures makes this class of outage visible without a log-level change.

How Has This Been Tested?

  • go build ./services/webdav/... and go vet ./services/webdav/... clean
  • go test ./services/webdav/pkg/service/v0/... passes, including a new table test for newErrResponse covering every mapped code and unmapped codes (the package previously had no test file)
  • make -C services/webdav golangci-lint reports 50 pre-existing protogetter findings and times out both with and without these changes; verified by stashing that this PR introduces no new findings

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

🤖 Generated with Claude Code

@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.

@mzner
mzner self-requested a review July 28, 2026 07:30
mzner
mzner previously approved these changes Jul 28, 2026
deyankiteworks
deyankiteworks previously approved these changes Jul 28, 2026
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]>
@kobergj
kobergj dismissed stale reviews from deyankiteworks and mzner via a4382cb July 28, 2026 08:01
@kobergj
kobergj force-pushed the fix/webdav-thumbnail-error-logging branch from 691e626 to a4382cb Compare July 28, 2026 08:01
@mzner
mzner self-requested a review July 28, 2026 08:05
@2403905
2403905 merged commit 6950f47 into owncloud:stable-8.0 Jul 28, 2026
55 checks passed
@kobergj
kobergj deleted the fix/webdav-thumbnail-error-logging branch July 28, 2026 09:45
kobergj added a commit to kobergj/ocis that referenced this pull request Jul 28, 2026
…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)
2403905 pushed a commit that referenced this pull request Jul 28, 2026
…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]>
2403905 pushed a commit that referenced this pull request Jul 28, 2026
…12667)

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]>
2403905 pushed a commit that referenced this pull request Jul 28, 2026
…12666)

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]>
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]>
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.

6 participants