After upgrade to ISPC 3.1, SOAP login gives 500 Internal Server Error

Discussion in 'General' started by Reinhold Kainhofer, Nov 20, 2016.

  1. Reinhold Kainhofer

    Reinhold Kainhofer New Member

    I have a small script that basically implements DDNS for two hosts by using SOAP calls to change the A record of a given subdomain. Now, after the upgrade from 3.0.5pX to 3.1.1p1 (and Ubuntu 14.04 to 16.10), the soap call (the very first login call) gives an Internal Server Error:
    root@DiskStation:~# /volume1/\@appstore/PHP5.6/usr/local/bin/php56 /volume1/temp/ispconfig-ddns/update.php aon 
    PHP Fatal error:  Uncaught SoapFault exception: [HTTP] Internal Server Error in /volume1/temp/ispconfig-ddns/update.php:36  
    Stack trace:  
    #0 [internal function]: SoapClient->__doRequest('<?xml version="...', 'https://server....', 'https://server....', 1, 0)  
    #1 /volume1/temp/ispconfig-ddns/update.php(36): SoapClient->__call('login', Array)  
    #2 /volume1/temp/ispconfig-ddns/update.php(36): SoapClient->login('REMOTEUSER', 'PASSWORD')  
    #3 {main}  
     thrown in /volume1/temp/ispconfig-ddns/update.php on line 36                                                                                                             

    On the server, I cannot see any log entry about the server error, except the /var/log/ispconfig/httpd/
    Code: - - [20/Nov/2016:14:19:25 +0100] "POST /remote/index.php HTTP/1.1" 500 4059 "-" "PHP-SOAP/5.6.23" - - [20/Nov/2016:14:21:37 +0100] "POST /remote/index.php HTTP/1.1" 500 4059 "-" "PHP-SOAP/5.6.23"
    However, I don't see any indication what exactly went wrong. Here is my whole DDNS script:
    $soap_location= ''; 
    $soap_uri= ''; 
    $soap_user= 'REMOTEUSER'; 
    $soap_password= 'PASSWORD'; 
        print "Usage: php ./update.php HOST DOMAIN [IP]\n"; 
        print "If not given, the ip address will be queried from\n"; 
        if(filter_var($ip, FILTER_VALIDATE_IP)===false){
            die("Unable to retrieve public IP address ( returned $ip)\n"); 
    $client=new SoapClient(null, 
        array('location'  =>$soap_location, 
         'uri'  =>$soap_uri, 
         'trace'  =>1, 
         'exceptions' =>1)); 
    //try {
        $session_id=$client->login($soap_user, $soap_password); 
        $zone_id=$client->dns_zone_get_id($session_id, $domain); 
        $zone=$client->dns_zone_get($session_id, $zone_id); 
        $records=$client->dns_rr_get_all_by_zone($session_id, $zone_id); 
             if($rec['type']=='A' &&$rec['name']==$ddns_host){
             die("Unable to find DNS record for host $ddns_host in domain $domain on the server...\n"); 
            $client->dns_a_update($session_id, null, $dns_record['id'], $dns_record); 
            $client->dns_zone_update($session_id, 0, $zone_id, $zone); 
    //        print("Successfully set DNS entry for host $ddns_host in domain $domain to $ip.\n");
            print("IP address of $ddns_host.$domain already set to $ip.\n"); 
    //} catch (SoapFault $e) {
    //     die('SOAP Error: '.$e->getMessage()."\n");
    Any idea what causes the Internal Server Error or where I might look for further information?


Share This Page