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

Improve logging when the content type is wrong #208

Open
arthuraraujo-msft opened this issue Sep 25, 2024 · 0 comments
Open

Improve logging when the content type is wrong #208

arthuraraujo-msft opened this issue Sep 25, 2024 · 0 comments

Comments

@arthuraraujo-msft
Copy link
Contributor

Is your feature request related to a problem? Please describe.
An acquisition failed in a scan from winget because one of the files of a piece of content did not have the "FileMoniker" field.
The logs don't say which file failed validation, they just say something was not of the App type.

2024-09-24 09:46:55.829 [CORE] DisplayCatalog package selected. WuCategoryId: 64b22df1-5a9c-4c88-aa1f-42cefaf8b281 , ContentId: 69f3bcab-8975-c526-30f5-39fa70c77ad9
2024-09-24 09:46:55.831 [CORE] CallSfsClientAndGetMSStoreDownloadInfo with WuCategoryId: 64b22df1-5a9c-4c88-aa1f-42cefaf8b281 Architecture: Unknown Platform: Unknown
2024-09-24 09:46:55.837 [CORE] Message: SFSClient instance created successfully. Version: 1.0.0 File: C:\__w\1\s\external\pkg\src\SfsClient\sfs-client\client\src\SFSClient.cpp Line: 26 Function: SFS::SFSClient::Make
2024-09-24 09:46:55.846 [CORE] Message: Requesting latest version of [64b22df1-5a9c-4c88-aa1f-42cefaf8b281] from URL [https://storeapps.api.cdp.microsoft.com/api/v2/contents/storeapps/namespaces/default/names/64b22df1-5a9c-4c88-aa1f-42cefaf8b281/versions/latest?action=select] File: C:\__w\1\s\external\pkg\src\SfsClient\sfs-client\client\src\details\SFSClientImpl.cpp Line: 194 Function: SFS::details::SFSClientImpl<class SFS::details::CurlConnectionManager>::GetLatestVersion
2024-09-24 09:46:55.846 [CORE] Message: Request attempt 1 out of 4 (cv: H12/Nhr5rU+nD2q7.0) File: C:\__w\1\s\external\pkg\src\SfsClient\sfs-client\client\src\details\connection\CurlConnection.cpp Line: 347 Function: SFS::details::CurlConnection::CurlPerform
2024-09-24 09:47:00.200 [CORE] Message: Received a response with version 0.0.4666.14428 File: C:\__w\1\s\external\pkg\src\SfsClient\sfs-client\client\src\details\SFSClientImpl.cpp Line: 205 Function: SFS::details::SFSClientImpl<class SFS::details::CurlConnectionManager>::GetLatestVersion
2024-09-24 09:47:00.200 [CORE] Message: Getting download info for main app content File: C:\__w\1\s\external\pkg\src\SfsClient\sfs-client\client\src\details\SFSClientImpl.cpp Line: 348 Function: SFS::details::SFSClientImpl<class SFS::details::CurlConnectionManager>::GetLatestAppDownloadInfo
2024-09-24 09:47:00.201 [CORE] Message: Requesting download info of version [0.0.4666.14428] of [64b22df1-5a9c-4c88-aa1f-42cefaf8b281] from URL [https://storeapps.api.cdp.microsoft.com/api/v2/contents/storeapps/namespaces/default/names/64b22df1-5a9c-4c88-aa1f-42cefaf8b281/versions/0.0.4666.14428/files?action=GenerateDownloadInfo] File: C:\__w\1\s\external\pkg\src\SfsClient\sfs-client\client\src\details\SFSClientImpl.cpp Line: 287 Function: SFS::details::SFSClientImpl<class SFS::details::CurlConnectionManager>::GetDownloadInfo
2024-09-24 09:47:00.201 [CORE] Message: Request attempt 1 out of 4 (cv: H12/Nhr5rU+nD2q7.1) File: C:\__w\1\s\external\pkg\src\SfsClient\sfs-client\client\src\details\connection\CurlConnection.cpp Line: 347 Function: SFS::details::CurlConnection::CurlPerform
2024-09-24 09:47:03.317 [CORE] Message: Received a response with 40 files File: C:\__w\1\s\external\pkg\src\SfsClient\sfs-client\client\src\details\SFSClientImpl.cpp Line: 296 Function: SFS::details::SFSClientImpl<class SFS::details::CurlConnectionManager>::GetDownloadInfo
2024-09-24 09:47:03.318 [CORE] Message: FAILED [ServiceUnexpectedContentType] Unexpected content type [Generic] returned by the service does not match the expected [App] (C:\__w\1\s\external\pkg\src\SfsClient\sfs-client\client\src\details\entity\ContentType.cpp:37) File: C:\__w\1\s\external\pkg\src\SfsClient\sfs-client\client\src\details\ErrorHandling.cpp Line: 23 Function: SFS::details::LogFailedResult
2024-09-24 09:47:03.322 [CORE] Message: FAILED [ServiceUnexpectedContentType] Unexpected content type [Generic] returned by the service does not match the expected [App] (C:\__w\1\s\external\pkg\src\SfsClient\sfs-client\client\src\details\SFSClientImpl.cpp:385) File: C:\__w\1\s\external\pkg\src\SfsClient\sfs-client\client\src\details\ErrorHandling.cpp Line: 23 Function: SFS::details::LogFailedResult
2024-09-24 09:47:03.323 [CORE] Failed to call SfsClient GetLatestAppDownloadInfo. Error code: 2147495937 Message: Unexpected content type [Generic] returned by the service does not match the expected [App]

Describe the solution you'd like
We could tell which file or entity failed the validation by catching the thrown error and rethrowing it with more data, or just logging it and rethrowing. That would help further investigations without needing to manually check the files.

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

No branches or pull requests

1 participant