Mirror pull fail "This build is not authorized to sync to project" (OD-2439)
Karol Gusak opened 7 months ago

My pull setup was working fine (from github), but now suddenly started to error out with this:

java.lang.RuntimeException: Http request failed (status code: 500, error message: This build is not authorized to sync to project: blokada)
	at io.onedev.k8shelper.KubernetesHelper.checkStatus(KubernetesHelper.java:342)
	at io.onedev.k8shelper.KubernetesHelper.runServerStep(KubernetesHelper.java:853)
	at io.onedev.k8shelper.KubernetesHelper.runServerStep(KubernetesHelper.java:812)
	at io.onedev.agent.AgentSocket$2.doExecute(AgentSocket.java:520)
	at io.onedev.agent.AgentSocket$2.lambda$execute$0(AgentSocket.java:437)
	at io.onedev.agent.ExecutorUtils.runStep(ExecutorUtils.java:100)
	at io.onedev.agent.AgentSocket$2.execute(AgentSocket.java:434)
	at io.onedev.k8shelper.LeafFacade.execute(LeafFacade.java:12)
	at io.onedev.k8shelper.CompositeFacade.execute(CompositeFacade.java:35)
	at io.onedev.agent.AgentSocket.executeShellJob(AgentSocket.java:430)
	at io.onedev.agent.AgentSocket.service(AgentSocket.java:1042)
	at io.onedev.agent.AgentSocket.lambda$onMessage$2(AgentSocket.java:268)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:840)

I haven't changed anything in Onedev configuration, or in my remote repo. Any clue how to debug this?

  • Robin Shen changed fields 7 months ago
    Name Previous Value Current Value
    Type
    Bug
    Question
  • Robin Shen commented 7 months ago

    Make sure the access token specified in the pull step has write code permission against the target projects.

  • Karol Gusak commented 7 months ago

    That's the thing, the build step is part of the target project itself (if you mean onedev target project where it should pull the mirror towards). No access token is set and it was working fine for a while.

    Now on checking the job status again I can see another error:

    java.lang.RuntimeException: Http request failed (status code: 500, error message: Command execution failed (command: git fetch https://github.com/blokadaorg/blokada.git refs/heads/*:refs/heads/* refs/tags/*:refs/tags/*, exit code: 1)
     ! [rejected]          codex/build-env -> codex/build-env  (non-fast-forward)
    )
    	at io.onedev.k8shelper.KubernetesHelper.checkStatus(KubernetesHelper.java:342)
    	at io.onedev.k8shelper.KubernetesHelper.runServerStep(KubernetesHelper.java:853)
    	at io.onedev.k8shelper.KubernetesHelper.runServerStep(KubernetesHelper.java:812)
    	at io.onedev.agent.AgentSocket$2.doExecute(AgentSocket.java:520)
    	at io.onedev.agent.AgentSocket$2.lambda$execute$0(AgentSocket.java:437)
    	at io.onedev.agent.ExecutorUtils.runStep(ExecutorUtils.java:100)
    	at io.onedev.agent.AgentSocket$2.execute(AgentSocket.java:434)
    	at io.onedev.k8shelper.LeafFacade.execute(LeafFacade.java:12)
    	at io.onedev.k8shelper.CompositeFacade.execute(CompositeFacade.java:35)
    	at io.onedev.agent.AgentSocket.executeShellJob(AgentSocket.java:430)
    	at io.onedev.agent.AgentSocket.service(AgentSocket.java:1042)
    	at io.onedev.agent.AgentSocket.lambda$onMessage$2(AgentSocket.java:268)
    	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    	at java.base/java.lang.Thread.run(Thread.java:840)
    

    So it seems like it did not like that new branch that was added in upstream. Can I configure it somehow to allow for this?

  • Robin Shen commented 7 months ago

    That's the thing, the build step is part of the target project itself

    You still need an access token in this case to prove that you have full control over the repository, otherwise, anyone can send a pull request to your project running some pull step to do nasty things.

    As to the non-fastforward error, please push your local changes to remote first. I filed an improvement request (OD-2442) to improve the pull/push step to be able to merge with remote changes in future versions.

  • Robin Shen changed state to 'Closed' 7 months ago
    Previous Value Current Value
    Open
    Closed
issue 1/1
Type
Question
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (2)
Reference
OD-2439
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover