×


Plesk git authentication failed - Fix it Now ?

Plesk git authentication failed can happen when trying to access the local git repository.

Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to perform related Plesk queries.


What triggers 'Plesk git authentication failed' error?

  • Firstly, the Git extension for Plesk currently does not add additional users to the Git protected directory.
  • Secondly, CageFS permitted ones does not have RPM-package git.


How to fix 'Plesk git authentication failed' error?

1. The Git extension for Plesk currently does not add additional users to the Git protected directory.

 

Symptoms

Below mentioned are some of the symptoms for the error.

i. On a Plesk for Linux server, configure a local Git repository on the subscription.

ii. It is possible to work with the repository using the system user of the subscription:

# git clone http://sysuser@example.com/plesk-git/example.git
Cloning into ‘example’…
Password for ‘http://sysuser@example.com’:
remote: Counting objects: 2, done.
remote: Total 2 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (2/2), done.

iii. Attempts to use Git repository as an additional FTP user created in Domains > example.com > FTP Access fail, even though the correct password is used:

# git clone http://gituser@example.com/plesk-git/example.git
Cloning into ‘example’…
Password for ‘http://gituser@example.com’:

iv. The following error can occur in the domain's log file /var/www/vhosts/example.com/logs/error_log when we usean additional user for accessing Git repository:

[auth_basic:error] [pid 2972:tid 140463692547840] [client 203.0.113.2:60065] AH01618: user gituser not found: /plesk-git/example.com/info/refs

Quick fix to this error.

To fix this error, you can simply add additional FTP users to the Git protected directory manually:

i. Connect to the server using SSH.

ii. Use the following commands to manage Git users:

a. Firstly, add a new user:

# PSA_PASSWORD=example_password plesk sbin pdmng –add-user –vhost-name=example.com –directory=git@plesk-git –user-name=exampleuser

b. Secondly, modify already existing user:

# PSA_PASSWORD=new_password plesk sbin pdmng –update-user –vhost-name=example.com –directory=git@plesk-git –user-name=exampleuser

c. Next, remove a user:

# plesk sbin pdmng –remove-user –vhost-name=example.com –directory=git@plesk-git –user-name=exampleuser

d. Finally, list existing users:

# cat /var/www/vhosts/system/example.com/pd/d..git@plesk-git


2. CageFS permitted ones does not have RPM-package git.

 

Symptoms

Some of the possible symptoms detected are mentioned below:

i. Plesk is installed on CloudLinux server and then install and enable CageFS feature.

ii. Unable to access the local git repository. Attempt to execute git clone command fails:

git clone https://johndoe@example.com/plesk-git/my_app
Cloning into ‘repo’…
Password for ‘https://johndoe@example.com’:
fatal: repository ‘https://johndoe@example.com:7080/plesk-git/repo/’ not found

iii. The following error is seen in web server log of the domain:

# tail -fn0 /var/www/vhosts/example.com/logs/error_log
[Tue Sep 19 00:32:36.985861 2017] [auth_basic:error] [pid 4217:tid 140077837539072] [client 203.0.113.2:36100] AH01617: user john.doe: authentication failure for “/plesk-git/example.git”: Password Mismatch

Quick fix to this error.

i. Firstly, connect to the server using SSH.

ii. Add git rpm package to CageFS and apply changes with below commands:

# cagefsctl –addrpm git
# cagefsctl –force-update

iii. Make sure that the LoadModule directives exists and is no comment in /etc/httpd/conf.modules.d/01-cgi.conf file. It should look as below:

# cat /etc/httpd/conf.modules.d/01-cgi.conf | grep -v ^#
<IfModule mpm_worker_module>
LoadModule cgid_module modules/mod_cgid.so
</IfModule>
<IfModule mpm_event_module>
LoadModule cgid_module modules/mod_cgid.so
</IfModule>
<IfModule mpm_prefork_module>
LoadModule cgi_module modules/mod_cgi.so
</IfModule>

iv. Finally, restart httpd service to apply changes:

# systemctl restart httpd.service


[Need help fixing Plesk error? We are available 24*7. ]


Conclusion

This article covers how to authenticate via HTTP when connecting to a remote Git repository in Plesk. HTTP/HTTPS authentication is not supported.

Authentication should be performed with an SSH key generated by Plesk (refer to Use SSH Connection for details).

It is possible to use HTTP/HTTPS protocol only if a repository does not require authentication.