Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

SOLVED [CPANEL-22800] Wrong path to uapi used in auto-deployment Git hook

Discussion in 'CloudLinux' started by Asmit khadka, Sep 9, 2018.

  1. Asmit khadka

    Asmit khadka Registered

    Joined:
    Sep 9, 2018
    Messages:
    2
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Nepal
    cPanel Access Level:
    Root Administrator
    I have created a repo in cpanel and cloned it in my local machine. When I tried to git push after making the changes then the below error comes. But the changes are taking effect in the server.

    The user is in cagefs and it work if I disable the cagefs.

    Code:
    Counting objects: 3, done.
    Delta compression using up to 4 threads.
    Compressing objects: 100% (2/2), done.
    Writing objects: 100% (3/3), 285 bytes | 285.00 KiB/s, done.
    Total 3 (delta 0), reused 0 (delta 0)
    remote: Recieved update on checked-out branch, queueing deployment.
    remote: [2018-09-09 12:24:12 +0200] warn [uapi] Failed to execute /usr/local/cpanel/cpanel: [I]No such file or directory at /usr/local/cpanel/Cpanel/XML.pm line 114.[/I]
    remote:    Cpanel::XML::cpanel_exec_fast(HASH(0x8975b0), HASH(0x157a5b8)) called at bin/apitool.pl line 206
    remote:    bin::apitool::_run_cpanel_function("yaml", HASH(0x8975b0), HASH(0x1579ef8)) called at bin/apitool.pl line 146
    remote:    bin::apitool::_cpanel_api_handler(__CPANEL_HIDDEN__, HASH(0x1579ef8), __CPANEL_HIDDEN__, __CPANEL_HIDDEN__, ARRAY(0x897b20)) called at bin/apitool.pl line 108
    remote:    bin::apitool::run("VersionControlDeployment", "create", "repository_root=/home2/user/public_html") called at bin/apitool.pl line 37
    remote: Failed to execute /usr/local/cpanel/cpanel: No such file or directory at bin/apitool.pl line 209.
    To ssh://user.com/home2/user/public_html
       d5647f9..2ab73d3  master -> master
    I have also tried to allow this by using /etc/cagefs/custom.proxy.commands but it is also not working.
     
    Umanga Deep Shrestha likes this.
  2. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,890
    Likes Received:
    91
    Trophy Points:
    78
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hi,

    How exactly you are doing all this push thing. Provide more details to investigate it further.
    What command you are executing?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Mikey12345

    Mikey12345 Registered

    Joined:
    Sep 10, 2018
    Messages:
    1
    Likes Received:
    1
    Trophy Points:
    1
    Location:
    United Kingdom
    cPanel Access Level:
    Root Administrator
    Also having the same issue with a .cpanel.yml deployment setup to cp some files around.

    after running 'git push' on my local machine to the cpanel repo i get the following:

    Code:
    remote: Recieved update on checked-out branch, queueing deployment.
    remote: [2018-09-10 20:34:04 +0100] warn [uapi] Failed to execute /usr/local/cpanel/cpanel: No such file or directory at /usr/local/cpanel/Cpanel/XML.pm line 114.
    remote:         Cpanel::XML::cpanel_exec_fast(HASH(0x8975b0), HASH(0x14e5a48)) called at bin/apitool.pl line 206
    remote:         bin::apitool::_run_cpanel_function("yaml", HASH(0x8975b0), HASH(0x14e53a0)) called at bin/apitool.pl line 146
    remote:         bin::apitool::_cpanel_api_handler(__CPANEL_HIDDEN__, HASH(0x14e53a0), __CPANEL_HIDDEN__, __CPANEL_HIDDEN__, ARRAY(0x897b20)) called at bin/apitool.pl line 108
    remote:         bin::apitool::run("VersionControlDeployment", "create", "repository_root=/home/supertest/repositories/superrepo"...) called at bin/apitool.pl line 37
    remote: Failed to execute /usr/local/cpanel/cpanel: No such file or directory at bin/apitool.pl line 209.
    
     
    Umanga Deep Shrestha likes this.
  4. Asmit khadka

    Asmit khadka Registered

    Joined:
    Sep 9, 2018
    Messages:
    2
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Nepal
    cPanel Access Level:
    Root Administrator
    I am following this documentation;

    Guide to Git - Host Git Repositories on a cPanel Account - cPanel Knowledge Base - cPanel Documentation

    I cloned the repo and after I make the changes and try to push it, I got the error. But the thing is that it gives the error when I make changes for the first time. If I again push it, no error is shown. Additionally, if I make any changes and again try to push it, it gives me error.

    Code:
    $ git add .
    $ git commit -am "Changes comment"
    $ git push origin master
    
    As I said before, if I disable cagefs it works fine.
     
    Umanga Deep Shrestha likes this.
  5. Umanga Deep Shrestha

    Umanga Deep Shrestha Registered

    Joined:
    Sep 11, 2018
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Kathmandu, Nepal
    cPanel Access Level:
    Website Owner
    Hello,

    I have been trying to automatically deploy the files after pushing my commit but unfortunately my knowledge on .cpanel.yml is not clear.

    I have used this code on .cpanel.yml as mentioned in the documentation

    ---
    deployment:
    tasks:
    - export DEPLOYPATH=/home/monkeyde/public_html/
    - /bin/cp index.html $DEPLOYPATH
    - /bin/cp style.css $DEPLOYPATH


    I get this error while pushing my local changes,

    {15:44}[2.2.5]~/workspace/cprepo:master ✓ ➭ git push cpanel
    Counting objects: 3, done.
    Delta compression using up to 8 threads.
    Compressing objects: 100% (3/3), done.
    Writing objects: 100% (3/3), 303 bytes | 0 bytes/s, done.
    Total 3 (delta 1), reused 0 (delta 0)
    remote: Recieved update on checked-out branch, queueing deployment.
    remote: [2018-09-11 11:59:14 +0200] warn [uapi] Failed to execute /usr/local/cpanel/cpanel: No such file or directory at /usr/local/cpanel/Cpanel/XML.pm line 114.
    remote: Cpanel::XML::cpanel_exec_fast(HASH(0x8975b0), HASH(0x1e90680)) called at bin/apitool.pl line 206
    remote: bin::apitool::_run_cpanel_function("yaml", HASH(0x8975b0), HASH(0x1e902f0)) called at bin/apitool.pl line 146
    remote: bin::apitool::_cpanel_api_handler(__CPANEL_HIDDEN__, HASH(0x1e902f0), __CPANEL_HIDDEN__, __CPANEL_HIDDEN__, ARRAY(0x897b20)) called at bin/apitool.pl line 108
    remote: bin::apitool::run("VersionControlDeployment", "create", "repository_root=/home/monkeyde/cprepo") called at bin/apitool.pl line 37
    remote: Failed to execute /usr/local/cpanel/cpanel: No such file or directory at bin/apitool.pl line 209.
    To ssh://monkeydenim.com:2222/home/monkeyde/cprepo
    e343f9b..5dcad90 master -> master
     
  6. Umanga Deep Shrestha

    Umanga Deep Shrestha Registered

    Joined:
    Sep 11, 2018
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Kathmandu, Nepal
    cPanel Access Level:
    Website Owner
    I am facing the same issue here.
    I noticed a case sensitive here in this line as posted by both @Asmit khadka and @Mikey12345
    Code:
    remote: [2018-09-10 20:34:04 +0100] warn [uapi] Failed to execute /usr/local/cpanel/cpanel: No such file or directory at /usr/local/cpanel/Cpanel/XML.pm line 114.
    
    /usr/local/cpanel/cpanel
    /usr/local/cpanel/Cpanel/XML.pm

    The second line cpanel has a uppercase Cpanel.
     
  7. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,005
    Likes Received:
    2,123
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    Internal case CPANEL-22800 is open to address an issue where the post-receive Git hook used for auto-deployment makes use of the wrong path to the UAPI binary. This causes auto-deployments to fail when using CageFS. I'll monitor this case and update this thread with more information as it becomes available. In the meantime, the temporary workaround is to modify the /usr/local/cpanel/3rdparty/share/git-cpanel/deployment/hooks/post-receive file so that it looks like this:

    Code:
    #!/bin/sh
    
    # post-receive                                       Copyright 2018 cPanel, Inc.
    #                                                           All rights reserved.
    # copyright@cpanel.net                                         http://cpanel.net
    # This code is subject to the cPanel license. Unauthorized copying is prohibited
    
    branch=$(/usr/local/cpanel/3rdparty/bin/git branch | awk '$1 == "*"{print $2}')
    while read oldrev newrev ref
    do
      if [ "x$ref" == "xrefs/heads/$branch" ]
      then
        echo "Recieved update on checked-out branch, queueing deployment."
        (cd .. ; /usr/bin/uapi VersionControlDeployment create repository_root=$PWD)
      fi
    done < /dev/stdin
    Then, run the following command:

    Code:
    cagefsctl --remount-all
    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. Umanga Deep Shrestha

    Umanga Deep Shrestha Registered

    Joined:
    Sep 11, 2018
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Kathmandu, Nepal
    cPanel Access Level:
    Website Owner
    Hello @cPanelMichael ,
    How long would it take to resolve this problem ?
     
  9. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,005
    Likes Received:
    2,123
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @Umanga Deep Shrestha,

    The case was picked up by the Development team associated with the feature, but we don't yet have a specific time frame on a solution. I'll update this thread as soon as that information is available.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. Artemu78

    Artemu78 Registered

    Joined:
    Sep 16, 2018
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Moscow, Russia
    cPanel Access Level:
    Website Owner
    hey guys, is there any news in issue solving?
     
  11. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,005
    Likes Received:
    2,123
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hi @Artemu78,

    The solution is published as part of cPanel & WHM version 76, but keep in mind that version isn't yet ready for production servers (it's only released to the EDGE release tier at this time).

    We do have a backport request open to get the case published to version 74, but I don't have a specific time frame to offer on it's publication at this time. I'll update this thread as soon as new information is available.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. Robin Jonsson

    Robin Jonsson Registered

    Joined:
    Oct 15, 2018
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Sweden
    cPanel Access Level:
    Reseller Owner
    When are you planning to fix this issue in version 74?
     
  13. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,005
    Likes Received:
    2,123
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello Robin,

    I don't have a specific time frame to offer on the next version 74 publication, but note that cPanel & WHM version 76 is available in the CURRENT release tier at this time. 76 is tentatively planned for publication the the RELEASE tier in early November.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  14. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,005
    Likes Received:
    2,123
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    To update, it doesn't look like this will make it out to cPanel & WHM version 74, however version 76 is nearing publication to the RELEASE tier (tentatively planned for publication within the next two weeks).

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice