getsentry / sentry-cli

A command line utility to work with Sentry.
https://docs.sentry.io/cli/
BSD 3-Clause "New" or "Revised" License
896 stars 222 forks source link

Unable to Upload Debug Information Due to `.res` File Encoding Error #2124

Closed obrigadu closed 2 weeks ago

obrigadu commented 1 month ago

CLI Version

2.33.1

Operating System and Architecture

Operating System Version

Windows 11

Link to reproduction repository

No response

CLI Command

sentry-cli.exe --log-level=debug debug-files upload --project <project-name> --include-sources "<path/to/pdb>"

Exact Reproduction Steps

  1. Create a Console Application project using Visual Studio 2019.
  2. Add a version resource to the generated project.
  3. Build the project.
  4. Run the previously mentioned command, targeting the generated PDB file.

Expected Results

The .res file should either be ignored by the CLI, as it is not a debug information file, or handled appropriately without causing an encoding error.

Actual Results

The upload process fails with an error indicating that the .res file cannot be read as UTF-8.

Logs

INFO 2024-08-14 16:06:14.683870300 +09:00 Loaded config from path\to\.sentryclirc DEBUG 2024-08-14 16:06:14.685208 +09:00 sentry-cli version: 2.33.1, platform: "windows", architecture: "x86_64" INFO 2024-08-14 16:06:14.686004100 +09:00 sentry-cli was invoked with the following command line: "sentry-cli.exe" "--log-level=debug" "debug-files" "upload" "--project" "<project-name>" "--include-sources" "C:\sources\Solution1\Debug\ConsoleApplication1.pdb"

...

DEBUG 2024-08-14 16:21:16.165731200 +09:00 searching location C:\sources\Solution1\Debug\ConsoleApplication1.pdb DEBUG 2024-08-14 16:21:16.173171300 +09:00 trying to process ConsoleApplication1.pdb DEBUG 2024-08-14 16:21:16.173552900 +09:00 trying to parse dif ConsoleApplication1.pdb DEBUG 2024-08-14 16:21:16.173958100 +09:00 finished location C:\sources\Solution1\Debug > Found 1 debug information file DEBUG 2024-08-14 16:21:16.174907200 +09:00 trying to collect sources for ConsoleApplication1.pdb DEBUG 2024-08-14 16:21:16.176066800 +09:00 Trying to add source file: C:\sources\Solution1\ConsoleApplication1\Debug\ConsoleApplication1.res error: file could not be read as UTF-8 caused by: stream did not contain valid UTF-8 INFO 2024-08-14 16:21:16.184029400 +09:00 Skipping update nagger update check

szokeasaurusrex commented 3 weeks ago

This is likely a duplicate of https://github.com/getsentry/symbolic/issues/860. We are already working on a fix upstream, and will bump the dependency in Sentry CLI once the fix is released