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

Overflow exception when posting issue to GitHub with OctoKit #1322

Closed
mthalman opened this issue Jun 4, 2024 · 2 comments · Fixed by #1328
Closed

Overflow exception when posting issue to GitHub with OctoKit #1322

mthalman opened this issue Jun 4, 2024 · 2 comments · Fixed by #1328

Comments

@mthalman
Copy link
Member

mthalman commented Jun 4, 2024

Unhandled exception: System.OverflowException: Value was either too large or too small for an Int32.
   at System.Convert.ThrowInt32OverflowException()
   at System.Convert.ToInt32(Int64 value)
   at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
   at Octokit.PocoJsonSerializerStrategy.DeserializeObject(Object value, Type type) in /_/Octokit/SimpleJson.cs:line 1437
   at Octokit.Internal.SimpleJsonSerializer.GitHubSerializerStrategy.DeserializeObject(Object value, Type type) in /_/Octokit/Http/SimpleJsonSerializer.cs:line 205
   at Octokit.PocoJsonSerializerStrategy.DeserializeObject(Object value, Type type) in /_/Octokit/SimpleJson.cs:line 1492
   at Octokit.Internal.SimpleJsonSerializer.GitHubSerializerStrategy.DeserializeObject(Object value, Type type) in /_/Octokit/Http/SimpleJsonSerializer.cs:line 205
   at Octokit.SimpleJson.DeserializeObject(String json, Type type, IJsonSerializerStrategy jsonSerializerStrategy) in /_/Octokit/SimpleJson.cs:line 584
   at Octokit.SimpleJson.DeserializeObject[T](String json, IJsonSerializerStrategy jsonSerializerStrategy) in /_/Octokit/SimpleJson.cs:line 596
   at Octokit.Internal.SimpleJsonSerializer.Deserialize[T](String json) in /_/Octokit/Http/SimpleJsonSerializer.cs:line 22
   at Octokit.Internal.JsonHttpPipeline.DeserializeResponse[T](IResponse response) in /_/Octokit/Http/JsonHttpPipeline.cs:line 44
   at Octokit.Connection.Run[T](IRequest request, CancellationToken cancellationToken, Func`2 preprocessResponseBody) in /_/Octokit/Http/Connection.cs:line 752
   at Octokit.ApiConnection.Post[T](Uri uri, Object data, String accepts, String contentType, CancellationToken cancellationToken)
   at Microsoft.DotNet.Git.IssueManager.Clients.GitHubClient.CreateNewIssueCommentAsync(String repositoryUrl, Int32 issueNumber, String comment, String personalAccessToken) in /_/src/Microsoft.DotNet.Git.IssueManager/src/Clients/GitHubClient.cs:line 87
   at Microsoft.DotNet.Git.IssueManager.Helpers.RepositoryHelper.CreateNewIssueCommentAsync(String repositoryUrl, Int32 issueNumber, String comment, String gitHubPersonalAccessToken) in /_/src/Microsoft.DotNet.Git.IssueManager/src/Helpers/RepositoryHelper.cs:line 91
   at Microsoft.DotNet.Git.IssueManager.IssueManager.CreateNewIssueCommentAsync(String repositoryUrl, Int32 issueNumber, String comment) in /_/src/Microsoft.DotNet.Git.IssueManager/src/IssueManager.cs:line 84
   at Microsoft.DotNet.ImageBuilder.NotificationService.PostAsync(String title, String description, IEnumerable`1 labels, String repoUrl, String gitHubAccessToken, Boolean isDryRun, IEnumerable`1 comments) in /image-builder/src/NotificationService.cs:line 46
   at Microsoft.DotNet.ImageBuilder.Commands.PostPublishNotificationCommand.ExecuteAsync() in /image-builder/src/Commands/PostPublishNotificationCommand.cs:line 101

Example build (internal link)

@lbussell
Copy link
Contributor

lbussell commented Jun 4, 2024

Comment ids have now apparently overflowed the same way as issue ids did in the past: octokit/octokit.net#2927

@lbussell
Copy link
Contributor

I also checked our code for use of OctoKit. We use it, but we use the implicit version from Microsoft.DotNet.Git.IssueManager. Since we use all 3 of Microsoft.DotNet.Git.IssueManager, Microsoft.DotNet.VersionTools.Automation.GitHubApi, and Octokit directly, I'm going to file a separate issue to consolidate all of that usage to just one of those packages (probably OctoKit).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants