Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Use EscapeUriString instead of EscapeDataString #258

Merged
merged 1 commit into from
Feb 15, 2021

Conversation

am11
Copy link
Member

@am11 am11 commented Feb 13, 2021

It seems like due to the recent change at the storage side, the escaped index component of URL is not working anymore.

Before

$ dotnet symbol --symbols mysinglefilehostapp1 --timeout 20
Downloading from http://msdl.microsoft.com/download/symbols/
ERROR: Not Found: singlefilehost.dbg - 'http://msdl.microsoft.com/download/symbols/_.debug%2Felf-buildid-sym-27997343859af70e0bfc5e50a4d1059b3513a1c4%2F_.debug'

http://msdl.microsoft.com/download/symbols/_.debug%2Felf-buildid-sym-27997343859af70e0bfc5e50a4d1059b3513a1c4%2F_.debug is returning 404.

Replacing %2F with / fixes the issue: http://msdl.microsoft.com/download/symbols/_.debug/elf-buildid-sym-27997343859af70e0bfc5e50a4d1059b3513a1c4/_.debug is valid.

After

$ dotnet symbol --symbols mysinglefilehostapp1 --timeout 20
Downloading from http://msdl.microsoft.com/download/symbols/
Writing: ./singlefilehost.dbg

To reproduce it on machine with pre-downloaded symbol, rename ~/.dotnet/symbolcache directory temporarily to force the re-download (or try it in a new VM).

Fixes dotnet/diagnostics#1978.

@hoyosjs
Copy link
Member

hoyosjs commented Feb 13, 2021

Thanks for the quick patch @am11 ☺️. Let me think about this, because this codepath gets used by sos, dotnet-dump, the symbol uploader, and dotnet-symbol. I'd like to verify that it's compatible with all the versions that we have used to upload product bits. If anything, I'm suspecting the metadata store for symbols wasn't all that smart and we were just matching upload and download. I'll need to take a quick look when I can.

@am11 am11 changed the title Remove escaping from index component of URL Use EscapeUriString instead of EscapeDataString Feb 13, 2021
@mikem8361
Copy link
Member

@hoyosjs the more I think about this the more I think using Uri.EscapeUriString is the right thing to do. It won't affect the symbol uploader. And it allow dotnet-symbol, SOS/dotnet-dump to work with those 5.0.x, etc. builds.

@mikem8361 mikem8361 merged commit b9b94a0 into dotnet:master Feb 15, 2021
@am11 am11 deleted the feature/url-generation branch February 16, 2021 04:04
@mikem8361
Copy link
Member

@am11, I put up PR #260 that fixes the problems with EscapeUriString and doesn't escape forward slashes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dotnet-symbol is returning '404 not found' for .NET5 native binaries
3 participants