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

publish build failing with "Could not insert build BuildWrapper" randomly #2129

Open
Pymann opened this issue Aug 11, 2023 · 3 comments
Open
Labels
bug Something isn't working

Comments

@Pymann
Copy link

Pymann commented Aug 11, 2023

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.

@Pymann Pymann added the bug Something isn't working label Aug 11, 2023
@Pymann
Copy link
Author

Pymann commented Aug 30, 2023

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] ]

@ShrutiTalewad
Copy link

Any update on this please? I am getting the similar error

@adamtenna
Copy link

same error here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants