Application automated build fails due connection HTTP Basic: Access Denied
To Reproduce
- Create Git Lab credentials
- Test connectivity and check repository count (all should be fine, testing connection should show at least 1+ repositories)
- Create the Application in Dokploy
- Choose repo from previously set Git Lab
- Choose Dockerfile build
Application should be built OK, started, running and accessible with public domain already prepared on Domain registrar.
Setup automated build and deploy for develop branch (follow docs from Dokploy)
Leave Dokploy App and return tomorrow.
In the mean time push new code to the develop branch.
If you return tomorrow with more then couple of pushes to the repository – there should be error indicator – indication that building of the app has failed .Check the logs and there is only one information:
Initializing deployment
Cloning Repo gitlab.com/[REDACTED]/[REDACTED].git to /etc/dokploy/applications/[REDACTED]/code: ✅
Cloning into '/etc/dokploy/applications/[REDACTED]/code'...
remote: HTTP Basic: Access denied. If a password was provided for Git authentication, the password was incorrect or you're required to use a token instead of a password. If a token was provided, it was either incorrect, expired, or improperly scoped. See https://gitlab.com/help/topics/git/troubleshooting_git.md#error-on-git-fetch-http-basic-access-denied
fatal: Authentication failed for 'https://gitlab.com/[REDACTED]/[REDACTED].git/'
ERROR Cloning: Error: Cloning into '/etc/dokploy/applications/[REDACTED]/code'...
remote: HTTP Basic: Access denied. If a password was provided for Git authentication, the password was incorrect or you're required to use a token instead of a password. If a token was provided, it was either incorrect, expired, or improperly scoped. See https://gitlab.com/help/topics/git/troubleshooting_git.md#error-on-git-fetch-http-basic-access-denied
fatal: Authentication failed for 'https://gitlab.com/[REDACTED]/[REDACTED].git/'
: ❌
After seeing logs go to GENERAL tab, (for second or two git credentials and repository should be empty) but they load after that. Click Deploy, deploy should start normally and application should be built like the first time.
After successful deploy, updated app should work fine.
Current vs. Expected behavior
Current: Automated git clone for the updated repository fails, not always but when not logged in in Dokploy app, almost every other day. Expected: To not to login every time into Dokploy app to manually build and deploy via GitLab to the non production branch.
Provide environment information
Ubuntu 24.04
Dokploy version: v0.21.5
VPS Provider: SSD Nodes
Deploying the Nuxt3 Application in Dockerfile with automated push to git and deploy via GitLab
Which area(s) are affected? (Select all that apply)
Application
Are you deploying the applications where Dokploy is installed or on a remote server?
Same server where Dokploy is installed
Additional context
No response
Will you send a PR to fix it?
Maybe, need help
@Sparo I got a similar error, but disabling "SSL verification" in the webhook settings worked for me.
Hi @jjanampa, sorry for late response. I have checked and SSL Verification is disabled in my case.
having the same issue with gitlab self hosted. i disabled SSL verification but i think that's unrelated because in my case it sometimes works and sometimes doesn't
edit: i think this issue has to do with branch filtering. if you have multiple branches in your repo you need to filter the webhook event in webhook settings to that specific branch. i checked the webhook logs from gitlab and it seems dokploy fails build because it receives other branch names when you're merging to deploy branch. testing with this setting.
second edit: branch filtering in webhooks didn't work.
I have the same issue with gitlab
I made a change, it took me a bit of thinking,
But I think to reproduce the problem was:
- you did deploy and it worked
- Then you came back a week later, and did a push on deploy,
- The token was expired, at the time of deployment, you used the outdated gitlab data, and then you updated the token
and that's why I assume it wasn't working, now once we update the token we will use the updated data,
I hope this solves the problem, I also applied it to gitea which I saw had the same case.
thanks for the fix @Siumauricio . i was going to test it but now gitlab branches do not load. here's the response from browser console when the dashboard tries to hit gitlab.getGitlabBranches
[
{
"error": {
"json": {
"message": "Failed to fetch branches: Unauthorized",
"code": -32603,
"data": {
"code": "INTERNAL_SERVER_ERROR",
"httpStatus": 500,
"path": "gitlab.getGitlabBranches",
"zodError": null
}
}
}
}
]
edit: oh it seems this was reported in #2338 and fixed. waiting for the release. edit2: fixed! thanks for the speedy release, king