jfrog / build-info

Artifactory's open integration layer for CI build servers
https://www.buildinfo.org
Apache License 2.0
147 stars 156 forks source link

Could not build the build-info object. #781

Open adamtenna opened 8 months ago

adamtenna commented 8 months ago

Describe the bug

Task :artifactoryDeploy
Deploying build info...
Could not build the build-info object.

Task :artifactoryDeploy FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':artifactoryDeploy'.
java.io.IOException: JFrog service failed. Received 400: {
    "errors" : [ {
      "status" : 400,
      "message" : "Could not insert build BuildWrapper(build=Build{version='1.0.1', name='radio-sdk-android', number='1705687499145', buildAgent=Gradle/7.4, agent=Gradle/7.4, started='2024-01-19T12:04:58.591-0600', durationMillis=153872, principal='firstlast', artifactoryPrincipal='user@domain.com', artifactoryPluginVersion='Unknown', url='null', parentName='null', parentNumber='null', vcs='[]', parentBuildId='null', buildRetention=null, runParameters=null, modules=[org.jfrog.build.api.Module@f884abab], statuses=null, buildDependencies=null, issues=null}, buildRepo=artifactory-build-info)"
    } ]
  }

To Reproduce This error happens when adding a 2nd flavor on my 2nd flavor dimension. E.g. this works:

flavorDimensions = ["visibility", "features"]
    productFlavors {
        internal {
            dimension "visibility"
        }
        external {
            dimension "visibility"
        }
        normal {
            dimension "features"
        }
    }

But this does not (added spi flavor as the only change):

flavorDimensions = ["visibility", "features"]
    productFlavors {
        internal {
            dimension "visibility"
        }
        external {
            dimension "visibility"
        }
        normal {
            dimension "features"
        }
        spi {
            dimension "features"
        }
    }

Expected behavior Build success with no errors as happens without the spi flavor presnt.

Screenshots N/A

Versions

Additional context N/A

adamtenna commented 8 months ago

Could there be a size limit imposed by the REST API when uploading via PUT /artifactory/api/build? After adding the extra flavor, my build-info.json file goes from 66KB -> 83KB.

adamtenna commented 8 months ago

I can reproduce the issue with a curl command for just the upload portion. So this ticket is probably better suited for the REST API team - however I can't find their repo.

Here's an example:

curl -u user:password -X PUT "https://company.jfrog.io/artifactory/api/build" -H "Content-Type: application/json" --upload-file build-info.json

The above command works for the attached working.json and fails for the attached broken.json. The only meaningful difference is the length of scopes for the broken.json. This probably means the REST endpoint is imposing some undocumented limits on the scopes array or some undocumented limit on the file-size itself.

broken.json working.json