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

CreateBaselineUpdatePR failing in SDK Diff Pipeline with HTTP Error #4459

Closed
ellahathaway opened this issue Jun 10, 2024 · 5 comments
Closed
Labels
ops-monitor Issues created/handled by the source build monitor role untriaged

Comments

@ellahathaway
Copy link
Member

CreateBaselineUpdatePR tool failed for this build (internal Microsoft link) with the following error:

Unhandled exception: System.FormatException: Cannot add value because header 'Content-Length' does not support multiple values.
   at System.Net.Http.Headers.HttpHeaders.ParseAndAddValue(HeaderDescriptor descriptor, HeaderStoreItemInfo info, String value)
   at System.Net.Http.Headers.HttpHeaders.Add(HeaderDescriptor descriptor, IEnumerable`1 values)
   at Octokit.Internal.HttpClientAdapter.CloneHttpRequestMessageAsync(HttpRequestMessage oldRequest) in /_/Octokit/Http/HttpClientAdapter.cs:line 272
   at Octokit.Internal.HttpClientAdapter.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in /_/Octokit/Http/HttpClientAdapter.cs:line 195
   at Octokit.Internal.HttpClientAdapter.Send(IRequest request, CancellationToken cancellationToken, Func`2 preprocessResponseBody) in /_/Octokit/Http/HttpClientAdapter.cs:line 50
   at Octokit.Connection.RunRequest(IRequest request, CancellationToken cancellationToken, Func`2 preprocessResponseBody) in /_/Octokit/Http/Connection.cs:line 760
   at Octokit.Connection.Run[T](IRequest request, CancellationToken cancellationToken, Func`2 preprocessResponseBody) in /_/Octokit/Http/Connection.cs:line 751
   at Octokit.ApiConnection.Post[T](Uri uri, Object data, String accepts, String contentType, CancellationToken cancellationToken)
   at CreateBaselineUpdatePR.PRCreator.CreateBlobAsync(String content) in /mnt/vss/_work/1/s/eng/tools/CreateBaselineUpdatePR/PRCreator.cs:line 213
   at CreateBaselineUpdatePR.PRCreator.UpdateFileAsync(List`1 tree, String content, String searchFileName, String updatedPath) in /mnt/vss/_work/1/s/eng/tools/CreateBaselineUpdatePR/PRCreator.cs:line 200
   at CreateBaselineUpdatePR.PRCreator.UpdateRegularFilesAsync(HashSet`1 updatedFiles, List`1 tree, String compareContent) in /mnt/vss/_work/1/s/eng/tools/CreateBaselineUpdatePR/PRCreator.cs:line 166
   at CreateBaselineUpdatePR.PRCreator.UpdateAllFilesAsync(Dictionary`2 updatedFiles, List`1 tree, Pipelines pipeline) in /mnt/vss/_work/1/s/eng/tools/CreateBaselineUpdatePR/PRCreator.cs:line 89
   at CreateBaselineUpdatePR.PRCreator.ExecuteAsync(String originalFilesDirectory, String updatedFilesDirectory, Int32 buildId, String title, String targetBranch, Pipelines pipeline) in /mnt/vss/_work/1/s/eng/tools/CreateBaselineUpdatePR/PRCreator.cs:line 57
   at CreateBaselineUpdatePR.Program.<>c__DisplayClass11_0.<<SetCommandAction>b__0>d.MoveNext() in /mnt/vss/_work/1/s/eng/tools/CreateBaselineUpdatePR/Program.cs:line 109
--- End of stack trace from previous location ---
   at System.CommandLine.CliCommand.<>c__DisplayClass32_0.<<SetAction>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Invocation.InvocationPipeline.InvokeAsync(ParseResult parseResult, CancellationToken cancellationToken)

I tried to repro this locally, but I was unsuccessful. In fact, I was able to successfully create the PR by running the tool with the downloaded files from this build. It produced this PR: dotnet/sdk#41514.

There's not much Octokit documentation on this issue, and nothing has changed to the tool recently that would cause this. It'd be interesting to see if the run of the sdk diff pipeline tomorrow will be able to successfully run the tool without the error.

@ellahathaway ellahathaway added the ops-monitor Issues created/handled by the source build monitor role label Jun 10, 2024
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@ellahathaway
Copy link
Member Author

It's possible that a race condition is occurring here... This would help to explain why I cannot repro the issue locally.

@ellahathaway
Copy link
Member Author

ellahathaway commented Jun 12, 2024

Did a test run where I added logic to make Create calls thread safe, and the issue persisted. This error occurs for every call to _client.Git._SomeType_.Create(), which I find interesting.

@ellahathaway
Copy link
Member Author

The tool now works in the pipelines without any changes having been made. I think that this issue still deserves some investigation, but it's a bit difficult to pinpoint what the error is if its indeterminate.

@github-project-automation github-project-automation bot moved this from Backlog to Done in .NET Source Build Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ops-monitor Issues created/handled by the source build monitor role untriaged
Projects
Archived in project
Development

No branches or pull requests

1 participant