Git problems with ispconfig generated website folders

Discussion in 'General' started by Trix, Apr 13, 2022.

  1. Trix

    Trix Member HowtoForge Supporter

    Hi!

    Dont know if ispconfig has anything to do with this, so i posting on multiple forums maybe i will get an aswer to my problem.
    Since this happened on all of our ispconfig servers without installing any updates i thought i might post it here aswell maybe someone can point me in the good direction.

    So the problem is that this morning all the sudden git pulls started failing with the following erro:

    Code:
    [email protected]:/var/www/clients/client5/web137/web# git pull
    fatal: unsafe repository ('/var/www/clients/client5/web137/web' is owned by someone else)
    To add an exception for this directory, call:
    
            git config --global --add safe.directory /var/www/clients/client5/web137/web
    
    As i mentioned this worked perfectly yestarday night and no ubuntu/ispconfig or gitlab updates were installed.

    If i give the whole web folder root:root permission then the pull completes but i dont want to do that. After setting it back to web137:client5 stops working again.
    We are using Ubuntu 20.04 with the latest ISPConfig and latest gitlab.

    Many thanks,
    Trix
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    First, undo your permission changes. Then run the git command as user web137 as required by git.
     
  3. Trix

    Trix Member HowtoForge Supporter

    Thanks Till for your answer.

    Might sound as a stupid question but how can i run the git command as web137? Do i need to su web137 ? Since these webxxx users doesnt exist i the home directory i can't do that.
    Maybe i am missing something.

    Thanks.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    You can do that with the sudo command. And the webxxx users exist of course in /etc/passwd and they have a home directory, which is the root of the website.
     
  5. Trix

    Trix Member HowtoForge Supporter

    Still can't figure it out how to do a git pull using the web137 user.
    Can you please give an example.

    I know i am taking away your time on something that is not really ispconfig related so i will do a 6 months subscription to make it up.
     
  6. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    How did you do git pull previously? I believe it can not have worked as root user even before.
    Log in as user web137.
    Or if you are logged in as root, do
    Code:
    su - web137
    to switch to user web137.
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    Try e.g. e.g.:

    sudo -u web137 git pull
     
  8. Trix

    Trix Member HowtoForge Supporter

    I used it with root user. Logged in whit my user, did a sudo su to access the root user and did the git pull in the web folder and it worked till now. We have been using it like this for 2 years. So it was kinda funny to see that after no updates it stopped today on all of our servers.

    Thanks for the info. It's working now.
     

Share This Page