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

ConsoleLogAsync is failing to get console output #15598

Open
2 tasks
wfurt opened this issue Mar 6, 2025 · 0 comments · May be fixed by #15599
Open
2 tasks

ConsoleLogAsync is failing to get console output #15598

wfurt opened this issue Mar 6, 2025 · 0 comments · May be fixed by #15599

Comments

@wfurt
Copy link
Member

wfurt commented Mar 6, 2025

  • This issue is blocking
  • This issue is causing unreasonable pain

I bump to this when trying to do some testing with OsobCli.

OsobCli exec -q osx.13.arm64   -t XXXXXXXX  -v -c wfurt -- bash -c set
No payload specified
Sending job to osx.13.arm64..
Created job list at https://helixd0107v0xd6tv7v8isja.blob.core.windows.net/helix-job-ec8b804e-81c1-4761-9c92-ea04d864e14085ee43c871c4dffbc/job-list-9a7559d8-2672-4363-8f03-71ac03e78918.json
Sent job: https://helix.int-dot.net/api/2019-06-17/jobs/085d5b57-56b5-4ec1-9452-291e515bf3bf
Operation failed. JobUrl = https://helix.int-dot.net/api/2019-06-17/jobs/085d5b57-56b5-4ec1-9452-291e515bf3bf
Microsoft.DotNet.Helix.Client.RestApiException`1[Microsoft.DotNet.Helix.Client.Models.ApiError]: The response contained an invalid status code 302 Found

Body:
   at Microsoft.DotNet.Helix.Client.WorkItem.OnConsoleLogFailed(Request req, Response res) in /_/src/Microsoft.DotNet.Helix/Client/CSharp/generated-code/WorkItem.cs:line 308
   at Microsoft.DotNet.Helix.Client.WorkItem.ConsoleLogAsync(String id, String job, CancellationToken cancellationToken) in /_/src/Microsoft.DotNet.Helix/Client/CSharp/generated-code/WorkItem.cs:line 275
   at Microsoft.Internal.Helix.Machines.OsobCli.Commands.Exec.ExecCommand.PrintConsoleOutput(IHelixApi helixApi, String jobId, String workItemName) in C:\Users\furt\github\dotnet-helix-machines\tools\OsobCli\Commands\Exec\ExecCommand.cs:line 216
   at Microsoft.Internal.Helix.Machines.OsobCli.Commands.Exec.ExecCommand.ExecuteAsync(ExecOptions options) in C:\Users\furt\github\dotnet-helix-machines\tools\OsobCli\Commands\Exec\ExecCommand.cs:line 161
   at Microsoft.Internal.Helix.Machines.OsobCli.Program.Main(String[] args) in C:\Users\furt\github\dotnet-helix-machines\tools\OsobCli\Program.cs:line 40

I did little bit more digging and the rot cause is that API returns HTTP redirect to blob storage but the client does not handle it.

Method: GET, RequestUri: 'https://helix.int-dot.net/api/jobs/52cd5e96-39fc-4674-abf5-e2b3ccb86129/workitems/bash-c-set/console?api-version=2019-06-17', Version: 1.1, Content: <null>, Headers:
{
  Authorization: token XXXXXXXXXXXXXXXXXXX
  x-ms-client-request-id: de6af8ef-1719-4ad5-9e96-43dd31a00900
  x-ms-return-client-request-id: true
  User-Agent: azsdk-net-Microsoft.DotNet.Helix.Client/10.0.0-dev (.NET 8.0.7; Darwin 23.6.0 Darwin Kernel Version 23.6.0: Thu Dec 19 20:47:16 PST 2024; root:xnu-10063.141.1.703.2~1/RELEASE_ARM64_T6031)
}

and the response is

StatusCode: 302, ReasonPhrase: 'Found', Version: 1.1, Content: <null>, Headers:
{
  Date: Thu, 06 Mar 2025 13:51:31 GMT
  Connection: keep-alive
  Location: https://helixr0107v0xd6tv7v8isja.blob.core.windows.net/results-52cd5e9639fc4674ab/bash-c-set/1/console.70af22fc.log?sv=2024-11-04&se=2025-06- ....... 
  Server: Microsoft-HTTPAPI/2.0
}
@wfurt wfurt linked a pull request Mar 6, 2025 that will close this issue
1 task
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

Successfully merging a pull request may close this issue.

1 participant