Results 1 to 2 of 2

Thread: liveapi connections to cpsrvd are failing

  1. #1
    Registered User
    Join Date
    Jun 2012
    Posts
    3
    cPanel/WHM Access Level

    Root Administrator

    Question liveapi connections to cpsrvd are failing

    I'm trying to play around with the cpanel liveapi for perl and I'm running into a problem with making any connection to cpsrvd to use the api. I'm just trying to run the test perl and php scripts that are provided by cpanel and the both seem to fail. As the shell output below indicates, this is all being run from /usr/local/cpanel/base/frontend/x3. This would I think appear to be a server related issue, but I'm not really sure what is broken or disabled that prevents this from running.

    These are the errors I get when trying to run the perl and php scripts from shell:

    root@cpaneldev [/usr/local/cpanel/base/frontend/x3]# php test.live.php
    <html>
    <pre>

    Fatal error: Uncaught exception 'RuntimeException' with message 'There was a problem fetching the env variablecontaining the path to the socket' in /usr/local/cpanel/php/cpanel.php:140
    Stack trace:
    #0 /usr/local/cpanel/base/frontend/x3/test.live.php(8): CPANEL->__construct()
    #1 {main}
    thrown in /usr/local/cpanel/php/cpanel.php on line 140

    root@cpaneldev [/usr/local/cpanel/base/frontend/x3]# perl test.live.pl
    Wed Jun 20 19:58:16 2012 There was a problem connecting back to the cPanel engine [socket file does not exist or env not set].. Make sure your script ends with .live.pl or .LiveAPI:
    Content-type: text/html

    Can't call method "exec" on an undefined value at test.live.pl line 15.


    I also checked and cpsrvd is also running on the server when I made these attempts:

    root@cpaneldev [/usr/local/cpanel/base/frontend/x3]# ps aux | grep cpsrvd
    root 23709 0.0 0.4 15920 8580 ? S Jun19 0:00 cpsrvd (SSL) - waiting for connections
    root 28504 0.0 0.0 3100 720 pts/2 R+ 20:00 0:00 grep cpsrvd

    Thanks!

  2. #2
    Integration Developer cPanelDavidN's Avatar
    Join Date
    Dec 2009
    Location
    Houston, TX
    Posts
    570

    Default Re: liveapi connections to cpsrvd are failing

    LiveAPI scripts must be served from cpsrvd; You must load 'test.live.*' from the cPanel UI:
    1) log into your cPanel account
    2) once logged in, change 'index.html' in the address bar of your browser to 'test.live.php' or 'test.live.pl' and hit 'go/return'

    When a document, which has the 'live.*' extension, is requested from the server (cpsrvd daemon), a private socket is opened prior to parsing and serving the doc. During processing of the document, it will load the logic necessary to connect to that socket, and do so. API calls can then pumped through the pipe. On a command line, there's no way to trigger cpsrvd to provide you that private socket to the API engine.

    Regards,
    -DavidN
    David Neimeyer
    Integration Developer

    sdk.cpanel.net
    APIs: XML-API API1 & API2
    Check Out: Developer Downloads Integration Blog
    Need Support? Support Ticket Developer Forum Feature Requests

Similar Threads

  1. Server Load & cpsrvd - waiting for connections
    By BizzHost in forum cPanel & WHM Discussions
    Replies: 0
    Last Post: 06-12-2009, 09:16 AM
  2. CPSRVD Failing
    By tenatious in forum New User Questions
    Replies: 0
    Last Post: 06-19-2007, 08:28 AM
  3. cpsrvd failing frequently.
    By salman77 in forum Data Protection
    Replies: 16
    Last Post: 06-12-2007, 04:47 PM
  4. cpsrvd failing
    By zapzappy in forum cPanel & WHM Discussions
    Replies: 1
    Last Post: 09-11-2005, 03:55 AM
  5. cpsrvd failing
    By Fallout2man in forum cPanel & WHM Discussions
    Replies: 7
    Last Post: 06-04-2004, 06:28 PM