Build issue: You do not have permission to pull from this project (OD-2275)
Long Yang Paffrath opened 11 months ago

Hi,

I have a flutter project that uses internal dependencies that are hosted on my onedev server. I'm using git config --global url.https://username:@secret:ci-access-token@@@git.mydomain.com/project.insteadOf ssh://git.mydomain.com/project with @secret:ci-access-token@ being a token with owner privileges to redirect from ssh to https when using flutter pub get.

For some reason I get the following error when trying to pull dependencies:

01:45:45 Git error. Command: `git clone --mirror ssh://git.mydomain.com/project /root/.pub-cache/_temp/dirHEURGW`
01:45:45 stdout: 
01:45:45 remote: You do not have permission to pull from this project.
01:45:45 fatal: Authentication failed for 'https://git.mydomain.com/project/'

I don't really understand how that is possible since the token I have provided has owner privileges? Am I providing the credentials in the wrong way?

  • Long Yang Paffrath commented 11 months ago

    Just for clarification, I'm using a onedev agent running in a docker container on Linux and the image I am using for command execution is: ghcr.io/cirruslabs/flutter:stable

  • Robin Shen commented 11 months ago

    Are you able to run below command successfully in the container?

    git clone https://username:@secret:ci-access-token@@@git.mydomain.com/project
    
  • Long Yang Paffrath commented 11 months ago

    Running the command results in the same error message:

    11:37:16 Cloning into 'project'...
    11:37:16 remote: You do not have permission to pull from this project.
    11:37:16 fatal: Authentication failed for 'https://git.mydomain.com/project/'
    
  • Robin Shen commented 11 months ago

    This works at my side. Please make sure the access token is not expired and actually has permission to read code of project

  • Long Yang Paffrath commented 11 months ago

    I think I have found the cause of the error.
    Adding a Checkout Code step with Clone Credential set to Default before the Execute Commands step will cause this error. I have fixed it now by setting the Clone Credential to HTTP(S). I don't really understand however how the Checkout Code step would have this effect on the following step(s)?

    Anyway, thanks for pointing me in the right direction 😄

  • Robin Shen changed state to 'Closed' 11 months ago
    Previous Value Current Value
    Open
    Closed
  • Robin Shen commented 11 months ago

    Checkout step will add below entries into .gitconfig, and this may interfere with your subsequent checkout. You may also run git config --global --unset http.extraHeader before your own clone command to see if it works.

    [http]
    extraHeader = OneDevAuthorization: Bearer *****
    
issue 1/1
Type
Question
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (2)
Reference
OD-2275
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover