Remote API error after updating to 3.0.4

Discussion in 'Installation/Configuration' started by snowfly, Nov 7, 2011.

  1. snowfly

    snowfly New Member

    Recently updated from 3.0.3.3 to 3.0.4, and now one of our Remoting API calls fails, sites_web_domain_update().
    This worked perfectly fine before in 3.0.3.3

    The error is:
    pm_max_children_error_regex
    pm_start_servers_error_regex
    pm_min_spare_servers_error_regex
    pm_max_spare_servers_error_regex

    Have the remoting functions changed in 3.0.4 or perhaps parameters changed?
     
  2. till

    till Super Moderator

    The API has extended due to nginx support. Do you use 3.0.4 beta or final code, as the error above should not occur with 3.0.4 final.
     
  3. snowfly

    snowfly New Member

    Here is the full soap exception:

    Code:
    SoapFault Object
    (
        [message:protected] => pm_max_children_error_regex
    pm_start_servers_error_regex
    pm_min_spare_servers_error_regex
    pm_max_spare_servers_error_regex
    
        [string:private] => 
        [code:protected] => 0
        [file:protected] => /var/www/clients/clientXXX/webXXX/app/ispconfig.class.php
        [line:protected] => 150
        [trace:private] => Array
            (
                [0] => Array
                    (
                        [function] => __call
                        [class] => SoapClient
                        [type] => ->
                        [args] => Array
                            (
                                [0] => sites_web_domain_update
                                [1] => Array
                                    (
                                        [0] => 4aff2061d8a6295527c6f72dfc7bca93
                                        [1] => XXX
                                        [2] => XXX
                                        [3] => Array
                                            (
                                                [server_id] => 3
                                                [ip_address] => *
                                                [domain] => XXX
                                                [type] => vhost
                                                [parent_domain_id] => 
                                                [vhost_type] => name
                                                [hd_quota] => -1
                                                [traffic_quota] => -1
                                                [cgi] => n
                                                [ssi] => n
                                                [suexec] => y
                                                [errordocs] => 1
                                                [subdomain] => www
                                                [ssl] => n
                                                [php] => fast-cgi
                                                [ruby] => n
                                                [active] => y
                                                [redirect_type] => 
                                                [redirect_path] => 
                                                [ssl_state] => 
                                                [ssl_organisation] => 
                                                [ssl_organisation_unit] => 
                                                [ssl_country] => 
                                                [ssl_domain] => 
                                                [ssl_request] => 
                                                [ssl_cert] => 
                                                [ssl_bundle] => 
                                                [ssl_action] => 
                                                [stats_password] => 
                                                [stats_type] => awstats
                                                [backup_interval] => daily
                                                [backup_copies] => 3
                                                [document_root] => /var/www/clients/clientXXX/webXXX
                                                [system_user] => webXXX
                                                [system_group] => clientXXX
                                                [allow_override] => All
                                                [php_open_basedir] => /var/www/clients/clientXXX/webXXX/web:/var/www/clients/clientXXX/webXXX/tmp:/var/www/XXX/web:/srv/www/XXX/web:/usr/share/php5:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin
                                                [custom_php_ini] => 
                                                [apache_directives] => 
                                                [client_group_id] => 9
                                            )
    
                                    )
    
                            )
    
                    )
     
  4. till

    till Super Moderator

    Do you use 3.0.4 beta or final code?
     
  5. snowfly

    snowfly New Member

    Should be 3.0.4 final, as I used the web interface to do the ISPConfig update.
     
  6. till

    till Super Moderator

    Do you have these lines starting on line 1356 in the file /usr/local/interface/web/lib/remoting.inc.php?

    Code:
    //* Set a few defaults for nginx servers
    		if($params['pm_max_children'] == '') $params['pm_max_children'] = 1;
    		if($params['pm_start_servers'] == '') $params['pm_start_servers'] = 1;
    		if($params['pm_min_spare_servers'] == '') $params['pm_min_spare_servers'] = 1;
    		if($params['pm_max_spare_servers'] == '') $params['pm_max_spare_servers'] = 1;
     
  7. snowfly

    snowfly New Member

    I don't have a file at: /usr/local/interface/web/lib/remoting.inc.php
    But do have: /usr/local/ispconfig/interface/lib/classes/remoting.inc.php

    And yes line 1356 has this:
    Code:
    //* Set a few defaults for nginx servers
                    if($params['pm_max_children'] == '') $params['pm_max_children'] = 1;
                    if($params['pm_start_servers'] == '') $params['pm_start_servers'] = 1;
                    if($params['pm_min_spare_servers'] == '') $params['pm_min_spare_servers'] = 1;
                    if($params['pm_max_spare_servers'] == '') $params['pm_max_spare_servers'] = 1;
     
  8. till

    till Super Moderator

    Ok. Your path is right of course :) I guess we should have to add the same lines for the update function then too. Please add the same lines directly after line 1374, that should set default values so that you dont have to add the new parameters to your existng scripts.
     
  9. snowfly

    snowfly New Member

    Ok I added the following params to the sites_web_domain_update() API call, and now this works fine :)

    'pm_max_children' => 1,
    'pm_start_servers' => 1,
    'pm_min_spare_servers' => 1,
    'pm_max_spare_servers' => 1
     
  10. till

    till Super Moderator

    Ok. Will add the lines to the function in svn, so it should work with unpatched scripts in future as well.
     

Share This Page