Unable to Invoke API Requests
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 42/100
Research direction
Start by reproducing the failure against Rest-Source 1.1.20221129 in the Azure environment, then read CertificateValidationHelper.cs at line 31 and ServerFunctions.cs at line 62. Compare the latest release with a version where /api/information works. Done means /api/information and the other API functions no longer fail with the reported null-value exception.
Written by the indexing model from the issue text.
Description
Brief description of your issue
When calling the API, it returns the below error.
This is not only occouring with /api/information but also with the other functions.
Installing older versions of the Rest-Source fixes the Problem.
Steps to reproduce
- Run latest version of the Rest-Source (1.1.20221129)
- Call /api/information
Expected behavior
Calling /api/information

2022-12-12T09:23:35.445 [Information] Executing 'InformationGet' (Reason='This function was programmatically called via the host APIs.', Id=3c326d7d-f179-47aa-ab9a-adf0fc781a02)
2022-12-12T09:23:35.446 [Information] Executed 'InformationGet' (Succeeded, Id=3c326d7d-f179-47aa-ab9a-adf0fc781a02, Duration=7ms)
Actual behavior
Error after calling /api/information

Stacktrace of Server
2022-12-12T09:03:12.730 [Information] Executing 'InformationGet' (Reason='This function was programmatically called via the host APIs.', Id=48169d65-88c7-4778-a241-03fa34ceaab4)
2022-12-12T09:03:13.117 [Error] System.ArgumentNullException: Value cannot be null. (Parameter 'value')at System.Boolean.Parse(String value)at Microsoft.WinGet.RestSource.Functions.Common.CertificateValidationHelper.ValidateAuthentication(HttpRequest req, ILogger log) in D:\a\1\s\src\WinGet.RestSource.Functions\Common\CertificateValidationHelper.cs:line 31at Microsoft.WinGet.RestSource.Functions.ServerFunctions.InformationGetAsync(HttpRequest req, ILogger log) in D:\a\1\s\src\WinGet.RestSource.Functions\ServerFunctions.cs:line 62
2022-12-12T09:03:13.172 [Error] Emitting metric ServerInformationError for function InformationGet on route /api/information'
2022-12-12T09:03:13.246 [Error] Emitting metric 'ServerInformationError'
2022-12-12T09:03:13.290 [Error] Fatal error MonitorTenant is empty
2022-12-12T09:03:13.335 [Error] Fatal error MonitorRole is empty
2022-12-12T09:03:13.378 [Error] {"FunctionName":"InformationGet","Route":"/api/information","Headers":"null","Object":"null","Error":"{"ClassName":"System.ArgumentNullException","Message":"Value cannot be null.","Data":null,"InnerException":null,"HelpURL":null,"StackTraceString":" at System.Boolean.Parse(String value)\r\n at Microsoft.WinGet.RestSource.Functions.Common.CertificateValidationHelper.ValidateAuthentication(HttpRequest req, ILogger log) in D:\\a\\1\\s\\src\\WinGet.RestSource.Functions\\Common\\CertificateValidationHelper.cs:line 31\r\n at Microsoft.WinGet.RestSource.Functions.ServerFunctions.InformationGetAsync(HttpRequest req, ILogger log) in D:\\a\\1\\s\\src\\WinGet.RestSource.Functions\\ServerFunctions.cs:line 62","RemoteStackTraceString":null,"RemoteStackIndex":0,"ExceptionMethod":null,"HResult":-2147467261,"Source":"System.Private.CoreLib","WatsonBuckets":null,"ParamName":"value"}"}
2022-12-12T09:03:13.401 [Information] Executed 'InformationGet' (Succeeded, Id=48169d65-88c7-4778-a241-03fa34ceaab4, Duration=670ms)
Environment
- Rest-Source is currently running on the newest release version 1.1.20221129.
- Rest-Source is hosted in a Azure Environment
- Calling /api/information works with previous versions
- Dominant language
- C#
- Stars
- 317
- Forks
- 79
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/winget-cli-restsource
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Issue-Feature
Difficulty 4/5 3-5 days Newbie friendliness 55/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
Font Support OpenIssue-Feature
microsoft/winget-cli-restsource#310 · 1 comment · 1 assignee ·
-
Issue-Bug
Difficulty 4/5 3-5 days Newbie friendliness 25/100
microsoft/winget-cli-restsource#309 · 2 comments ·
All issues in microsoft/winget-cli-restsource
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·