Skip to content

[BUG]: OverflowException when listing a large artifact (with size more than MAX_INT) #3027

@radical

Description

@radical

What happened?

This workflow run has an artifact named logs-Cli-macos-latest which is 2.53G in size. Getting any information about this artifact fails with OverflowException. Test code:

// https://github.com/dotnet/aspire/actions/runs/16871325740/artifacts/3731413302
using Octokit;

if (args.Length == 0)
{
    Console.WriteLine("Please provide a GitHub Personal Access Token as the first argument.");
    return;
}

var client = new GitHubClient(new ProductHeaderValue("Octokit"))
{
    Credentials = new Credentials(args[0], AuthenticationType.Bearer),
};

await client.Actions.Artifacts.GetArtifact("dotnet", "aspire", artifactId: 3731413302L);

Versions

Octokit 14.0.0

Relevant log output

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 1454
   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 1509
   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 784
   at Octokit.ApiConnection.Get[T](Uri uri, IDictionary`2 parameters)
   at Program.<Main>$(String[] args) in /private/tmp/testcase/main.cs:line 14
   at Program.<Main>(String[] args)

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: TriageThis is being looked at and prioritizedType: BugSomething isn't working as documented

    Type

    No type

    Projects

    Status

    🆕 Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions