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!

UAPI DomainInfo does not show result

Discussion in 'cPanel Developers' started by senyapsudah, May 11, 2019.

  1. senyapsudah

    senyapsudah Registered

    Joined:
    May 11, 2019
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    malaysia
    cPanel Access Level:
    DataCenter Provider
    Hi Team,

    not sure if anybody had ask this kind of question before. What i'm trying to do is to automatically install wordpress whenever cpanel user add an addon domain to their account. the script that i use is just a bash script which trying to get all the required information for the wordpress installation using wpcli. I have attached the script to Whostmgr::Domain::park hook.

    so far i manage to get and prepare some part of the information required. However, i'm not able to get information like document root and also ip address assigned to the addon domain. i have try to run few command options which i believe should be able to give me the information that i need during the hook run. However, the result shows that the information is not being generated during the hook run. Below are some command that i used.

    uapi --user=<cpanelusername> DomainInfo single_domain_data domain=<newly addon domain>
    whmapi1 domainuserdata domain=<newly addon domain>
    cpapi2 --user=<cpanelusername> AddonDomain listaddondomains regex=<newly addon domain>


    most of this command will give below output.

    ---
    data:
    userdata: {}

    metadata:
    command: domainuserdata
    reason: Obtained userdata.
    result: 1
    version: 1


    the userdata always shows nothing.

    However, when i run the command manually after the hook run completely. i can see that all of the commands that i used does return the correct output with the information that i need to use.

    is there anyway or steps that i need to follow to make sure i get the required info during the hook run?

    looking forward for the best way to solved this.

    thanks.
     
  2. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    6,254
    Likes Received:
    479
    Trophy Points:
    233
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hi @senyapsudah

    Have you looked at enabling WHM>>Server Configuration>>Tweak Settings ->
    Standardized Hooks - Debug Mode
    The Standardized Hooks System’s debug mode helps to troubleshoot hook issues.

    To see if it clues you into any potential errors?
     
    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