Rest Api client_add returning Internal Server error

Discussion in 'Plugins/Modules/Addons' started by Florian Lenz, Mar 9, 2019.

  1. Florian Lenz

    Florian Lenz New Member

    Hello everyone,

    I'm trying to implement the ISPconfig Api to automatically create Clients. Getting client details thru the JSON-Api works perfectly fine, but creating just fails without further error messages. To make sure, my Parameters are right, I used the exact same parameters as described in /remoting_client/examples/client_add.php.
    I double-checked all remote user checkboxes and im running ISPConfig 3.1.13p1 on Debian 9.
    Here is what my Request looks like:
    Code:
    POST /remote/json.php?client_add HTTP/1.1
    Host: myserver:8080
    Content-Type: application/json
    Content-Length: 1823
    
    {
      "session_id": "............",
      "reseller_id": 0,
      "params": {
        "company_name": "awesomecompany",
        "contact_name": "name",
        "customer_no": "1",
        "vat_id": "1",
        "street": "fleetstreet",
        "zip": "21337",
        "city": "london",
        "state": "bavaria",
        "country": "GB",
        "telephone": "123456789",
        "mobile": "987654321",
        "fax": "546718293",
        "email": "[email protected]",
        "internet": "",
        "icq": "111111111",
        "notes": "awesome",
        "default_mailserver": 1,
        "limit_maildomain": -1,
        "limit_mailbox": -1,
        "limit_mailalias": -1,
        "limit_mailaliasdomain": -1,
        "limit_mailforward": -1,
        "limit_mailcatchall": -1,
        "limit_mailrouting": 0,
        "limit_mailfilter": -1,
        "limit_fetchmail": -1,
        "limit_mailquota": -1,
        "limit_spamfilter_wblist": 0,
        "limit_spamfilter_user": 0,
        "limit_spamfilter_policy": 1,
        "default_webserver": 1,
        "limit_web_ip": "",
        "limit_web_domain": -1,
        "limit_web_quota": -1,
        "web_php_options": "no,fast-cgi,cgi,mod,suphp",
        "limit_web_subdomain": -1,
        "limit_web_aliasdomain": -1,
        "limit_ftp_user": -1,
        "limit_shell_user": 0,
        "ssh_chroot": "no,jailkit,ssh-chroot",
        "limit_webdav_user": 0,
        "default_dnsserver": 1,
        "limit_dns_zone": -1,
        "limit_dns_slave_zone": -1,
        "limit_dns_record": -1,
        "default_dbserver": 1,
        "limit_database": -1,
        "limit_cron": 0,
        "limit_cron_type": "url",
        "limit_cron_frequency": 5,
        "limit_traffic_quota": -1,
        "limit_client": 0,
        "parent_client_id": 0,
        "username": "guy3",
        "password": "brush",
        "language": "en",
        "usertheme": "default",
        "template_master": 0,
        "template_additional": "",
        "created_at": 0
      }
    }
    Does any of you has an idea what could be wrong?
    Thanks in advance
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Which error message do you get in the global apache or nginx error.log on the server?
     
  3. Florian Lenz

    Florian Lenz New Member

    The error is Uncaught Error: Class 'SoapFault' not found in /usr/local/ispconfig/interface/lib/classes/remoting.inc.php:531
    Code:
    mod_fcgid: stderr: PHP Fatal error:  Uncaught Error: Class 'SoapFault' not found in /usr/local/ispconfig/interface/lib/classes/remoting.inc.php:531
    mod_fcgid: stderr: Stack trace:
    mod_fcgid: stderr: #0 /usr/local/ispconfig/interface/lib/classes/remoting.inc.php(493): remoting->getSession('c85df56fc0c7033...')
    mod_fcgid: stderr: #1 /usr/local/ispconfig/interface/lib/classes/remote.d/client.inc.php(163): remoting->checkPerm('c85df56fc0c7033...', 'client_add')
    [Mon Mar 11 08:15:52.787708 2019] [fcgid:warn] [pid ...] [client ...:49612] mod_fcgid: stderr: #2 /usr/local/ispconfig/interface/lib/classes/json_handler.inc.php(117): remoting_client->client_add('c85df56fc0c7033...', 0, Array)
    mod_fcgid: stderr: #3 /usr/local/ispconfig/interface/web/remote/json.php(17): ISPConfigJSONHandler->run()
    mod_fcgid: stderr: #4 {main}
    mod_fcgid: stderr:   thrown in /usr/local/ispconfig/interface/lib/classes/remoting.inc.php on line 531
    (running apache2)
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Please install the PHP soap extension.
     
  5. Florian Lenz

    Florian Lenz New Member

    Thanks, Till!
    That solved it.
    I forgot to check on that.
     

Share This Page