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

StandardError has not been redirected from Azure.Identity #16211

Closed
jongio opened this issue Oct 23, 2020 · 2 comments · Fixed by #16499 or #16933
Closed

StandardError has not been redirected from Azure.Identity #16211

jongio opened this issue Oct 23, 2020 · 2 comments · Fixed by #16499 or #16933
Assignees
Labels
Azure.Identity Client This issue points to a problem in the data-plane of the library. needs-team-triage This issue needs the team to triage.

Comments

@jongio
Copy link
Member

jongio commented Oct 23, 2020

Describe the bug
Getting this exception when running AzureCliCredential in container with .NET 5.0.

I have Console logging enabled with
using var listener = AzureEventSourceListener.CreateConsoleLogger();

I know that I'm getting a 401, but if I don't have logging enabled all I see is StandardError has not been redirected.

[Informational] Azure-Core: Request [fac39a0e-3bcb-4e11-bc20-ef12c81adc2c] GET https://memealyzerdevkeyvault.vault.azure.net/secrets/CosmosKey/?api-version=7.1
Accept:application/json
x-ms-client-request-id:fac39a0e-3bcb-4e11-bc20-ef12c81adc2c
x-ms-return-client-request-id:true
User-Agent:azsdk-net-Security.KeyVault.Secrets/4.1.0,(.NET 5.0.0-rc.2.20475.5; Linux 4.19.104-microsoft-standard #1 SMP Wed Feb 19 06:37:35 UTC 2020)
Content-Type:application/json
client assembly: Azure.Security.KeyVault.Secrets
[Warning] Azure-Core: Error response [fac39a0e-3bcb-4e11-bc20-ef12c81adc2c] 401 Unauthorized (00.5s)
Cache-Control:no-cache
Pragma:no-cache
WWW-Authenticate:REDACTED
x-ms-keyvault-region:westus2
x-ms-request-id:REDACTED
x-ms-keyvault-service-version:1.2.41.0
x-ms-keyvault-network-info:conn_type=Ipv4;addr=216.9.29.113;act_addr_fam=InterNetwork;
X-Powered-By:REDACTED
Strict-Transport-Security:REDACTED
X-Content-Type-Options:REDACTED
Date:Fri, 23 Oct 2020 05:03:16 GMT
Content-Length:87
Content-Type:application/json; charset=utf-8
Expires:-1

[Informational] Azure-Identity: AzureCliCredential.GetToken invoked. Scopes: [ https://vault.azure.net/.default ] ParentRequestId: fac39a0e-3bcb-4e11-bc20-ef12c81adc2c
Unhandled exception. System.InvalidOperationException: StandardError has not been redirected.
   at System.Diagnostics.Process.get_StandardError()
   at Azure.Identity.ProcessService.ProcessWrapper.get_StandardError()
   at Azure.Identity.ProcessRunner.HandleExit()
   at Azure.Identity.ProcessRunner.<StartProcess>b__9_0(Object o, EventArgs e)
   at System.Diagnostics.Process.OnExited()
   at System.Diagnostics.Process.RaiseOnExited()
   at System.Diagnostics.Process.CompletionCallback(Object waitHandleContext, Boolean wasSignaled)
   at System.Threading._ThreadPoolWaitOrTimerCallback.WaitOrTimerCallback_Context_f(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading._ThreadPoolWaitOrTimerCallback.PerformWaitOrTimerCallback(_ThreadPoolWaitOrTimerCallback helper, Boolean timedOut)

Expected behavior
What is the expected behavior?

Show the exception, not StandardError has not been redirected.

Actual behavior (include Exception or Stack Trace)
What is the actual behavior?

Above.

To Reproduce
Steps to reproduce the behavior (include a code snippet, screenshot, or any additional information that might help us reproduce the issue)

  1. Create .NET console app
  2. Use AzureCliCredential
  3. Create docker container with azure cli installed.
  4. run it
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
COPY . .
RUN dotnet publish "Services/QueueService/QueueService.csproj" -c Release -o /app/publish

FROM mcr.microsoft.com/dotnet/runtime:5.0 AS base
RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash
WORKDIR /app
COPY --from=build /app/publish .
RUN apt-get update 
RUN apt-get install -y --no-install-recommends apt-utils 
RUN apt-get install -y curl unzip procps
RUN curl -sSL https://aka.ms/getvsdbgsh | bash /dev/stdin -v latest -l /publish/vsdbg;
ENTRYPOINT ["dotnet", "QueueService.dll"]

Environment:

  • Name and version of the Library package used: [e.g. Azure.Storage.Blobs 12.2.0]

Azure.Identity

  • Hosting platform or OS and .NET runtime version (dotnet --info output for .NET Core projects): [e.g. Azure AppService or Windows 10 .NET Framework 4.8]

WSL2

  • IDE and version : [e.g. Visual Studio 16.3]

VS Code

azsdke2e
azsdke2e2

@ghost ghost added the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Oct 23, 2020
@ghost
Copy link

ghost commented Oct 23, 2020

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @wmengmsft, @MehaKaushik, @shurd

@jsquire jsquire added Azure.Identity Client This issue points to a problem in the data-plane of the library. needs-team-triage This issue needs the team to triage. labels Oct 23, 2020
@ghost ghost removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Oct 23, 2020
@schaabs
Copy link
Contributor

schaabs commented Nov 12, 2020

It looks like we are still getting hits on this issue from our CI.

@schaabs schaabs reopened this Nov 12, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Mar 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Azure.Identity Client This issue points to a problem in the data-plane of the library. needs-team-triage This issue needs the team to triage.
Projects
None yet
3 participants