jfrog-cli
jfrog-cli copied to clipboard
publish build failing with "Could not insert build BuildWrapper" randomly
Describe the bug
The answer of REST-API gives every information: cli version and what has be done
{
[2023-08-11T04:39:21.465Z] "errors": [
[2023-08-11T04:39:21.465Z] {
[2023-08-11T04:39:21.465Z] "status": 400,
[2023-08-11T04:39:21.465Z] "message": "Could not insert build BuildWrapper(build=Build{version='1.0.1', name='jenkins-EOX6-frontend-PullRequest', number='188', buildAgent=GENERIC/1.54.0, agent=jfrog-cli-go/1.54.0, started='2023-08-11T04:39:19.476+0000', durationMillis=0, principal='null', artifactoryPrincipal='rbg-jenkins-flash', artifactoryPluginVersion='null', url='null', parentName='null', parentNumber='null', vcs='[revision='6f0f33b46f3b5c9d6651d6afdb67110b522f4bd5', commit message=Add 'general/' from commit 'f7a92f517e4fdaa2f29b6bed9d550748e1250ce8'\n\ngit-subtree-dir: general\ngit-subtree-mainline: 652675c9ab1c5edd4c918171efee0f7be993dec1\ngit-subtree-split: f7a92f517e4fdaa2f29b6bed9d550748e1250ce8', branch='', url='https://production.github.bshg.com/EOX6/frontend.git']', parentBuildId='null', buildRetention=null, runParameters=null, modules=[org.jfrog.build.api.Module@9944b3be], statuses=null, buildDependencies=null, issues=null}, buildRepo=artifactory-build-info)"
[2023-08-11T04:39:21.465Z] }
[2023-08-11T04:39:21.465Z] ]
[2023-08-11T04:39:21.465Z] }
Current behavior
The build is tried to be published, but API answers with 400. I have hundreads of builds using same commandline/code and it never fails. But for one build it does randomly with this error received.
Reproduction steps
I dont know how to reproduce a random error. I normaly do like this:
jfrog_bce_cmd = (
f'{jfrog_bin} rt bce {build_name} {os.getenv("BUILD_NUMBER", "1")}'
)
if int(self.execute_cmd(jfrog_bce_cmd)) != 0:
print(f"Error: jfrog collecting env failed {build_name}")
return False
jfrog_bag_cmd = (
f'{jfrog_bin} rt bag {build_name} {os.getenv("BUILD_NUMBER", "1")}'
)
if int(self.execute_cmd(jfrog_bag_cmd)) != 0:
print(f"Error: jfrog collecting git failed {build_name}")
return False
jfrog_bp_cmd = f'{jfrog_bin} rt bp --apikey {os.getenv("JFROG_TOKEN", "NoToken")} --url {self.jfrog_url} \
{build_name} {os.getenv("BUILD_NUMBER", "1")}'
if int(self.execute_cmd(jfrog_bp_cmd)) != 0:
print(f"Error: jfrog publish build failed {build_name}")
return False
print(f"Uploading: {pkg_path} -> {self.jfrog_url}/{up_path}")
jfrog_u_cmd = f'{jfrog_bin} rt u --apikey {os.getenv("JFROG_TOKEN", "NoToken")} --url {self.jfrog_url} \
--build-name {build_name} --build-number {os.getenv("BUILD_NUMBER", "1")} \
--target-props JENKINS_AGENT_NAME={os.getenv("PL_AGENT", "LocalBuild")};JENKINS_URL={os.getenv("JENKINS_URL", "LocalBuild")};BUILD_TAG={os.getenv("BUILD_TAG", "LocalBuild")} \
{pkg_path} {up_path}'
Expected behavior
Publish the build
JFrog CLI version
jfrog-cli-go/1.54.0
Operating system type and version
ubuntu 20.04
JFrog Artifactory version
maybe this one: Enterprise Plus 7.39.4 rev
JFrog Xray version
cant find.
tried jfrog v2, same problem:
[2023-08-30T06:10:06.672Z] {
[2023-08-30T06:10:06.672Z] "errors": [
[2023-08-30T06:10:06.672Z] {
[2023-08-30T06:10:06.672Z] "status": 400,
[2023-08-30T06:10:06.672Z] "message": "Could not insert build BuildWrapper(build=Build{version='1.0.1', name='jenkins-EOX6-frontend-PR2', number='1', buildAgent=GENERIC/2.46.2, agent=jfrog-cli-go/2.46.2, started='2023-08-30T06:10:04.960+0000', durationMillis=0, principal='null', artifactoryPrincipal='rbg-jenkins-flash', artifactoryPluginVersion='null', url='null', parentName='null', parentNumber='null', vcs='[revision='d571b72aa42fe18513e1147daaed78bca5372809', commit message=Add 'general/' from commit 'f7a92f517e4fdaa2f29b6bed9d550748e1250ce8'\n\ngit-subtree-dir: general\ngit-subtree-mainline: 22469a96b9409abaeaaaea0470ec193b72e9429c\ngit-subtree-split: f7a92f517e4fdaa2f29b6bed9d550748e1250ce8', branch='', url='https://production.github.bshg.com/EOX6/frontend.git', revision='d571b72aa42fe18513e1147daaed78bca5372809', commit message=Add 'general/' from commit 'f7a92f517e4fdaa2f29b6bed9d550748e1250ce8'\n\ngit-subtree-dir: general\ngit-subtree-mainline: 22469a96b9409abaeaaaea0470ec193b72e9429c\ngit-subtree-split: f7a92f517e4fdaa2f29b6bed9d550748e1250ce8', branch='', url='https://production.github.bshg.com/EOX6/frontend.git', revision='d571b72aa42fe18513e1147daaed78bca5372809', commit message=Add 'general/' from commit 'f7a92f517e4fdaa2f29b6bed9d550748e1250ce8'\n\ngit-subtree-dir: general\ngit-subtree-mainline: 22469a96b9409abaeaaaea0470ec193b72e9429c\ngit-subtree-split: f7a92f517e4fdaa2f29b6bed9d550748e1250ce8', branch='', url='https://production.github.bshg.com/EOX6/frontend.git', revision='d571b72aa42fe18513e1147daaed78bca5372809', commit message=Add 'general/' from commit 'f7a92f517e4fdaa2f29b6bed9d550748e1250ce8'\n\ngit-subtree-dir: general\ngit-subtree-mainline: 22469a96b9409abaeaaaea0470ec193b72e9429c\ngit-subtree-split: f7a92f517e4fdaa2f29b6bed9d550748e1250ce8', branch='', url='https://production.github.bshg.com/EOX6/frontend.git']', parentBuildId='null', buildRetention=null, runParameters=null, modules=null, statuses=null, buildDependencies=null, issues=null}, buildRepo=artifactory-build-info)"
[2023-08-30T06:10:06.672Z] }
[2023-08-30T06:10:06.672Z] ]
Any update on this please? I am getting the similar error
same error here