migration tool: [ERROR] API call to client_add failed. See log file for details

Discussion in 'Plugins/Modules/Addons' started by nikolaosp, Jan 12, 2018.

  1. nikolaosp

    nikolaosp Member

    Happy New Year to everyone,

    I downloaded the new version of the migration tool and tried to run it on a new server in order to migrate the old one. Both servers are running ISPConfig 3.1.11, source is Debian 8 and target Debian 9. I had run previously the first version of the migration tool and all worked . A dry run tells me everything is ok. However the migrate option stops with:
    Code:
    Starting API calls.
    [ERROR] API call to client_add failed. See log file for details.
    [ERROR] Could not create client 
    The log file gives me:
    Code:
    2018-01-12 17:08:52 - [ERROR] Invalid json data received for client_add: <div class='alert alert-danger clear'>
      <div class='alert-label'><strong><tmpl_var name="error_txt"></strong></div>
      <div class='alert-content'>
            <ol>
                    <li>Possible attack detected. This action has been logged.</li>
            </ol>
      </div>
    </div>
    2018-01-12 17:08:53 - [ERROR] Invalid json data received for client_add: <div class='alert alert-danger clear'>
      <div class='alert-label'><strong><tmpl_var name="error_txt"></strong></div>
      <div class='alert-content'>
            <ol>
                    <li>Possible attack detected. This action has been logged.</li>
            </ol>
      </div>
    </div>
    2018-01-12 17:08:53 - [ERROR] Invalid json data received for client_add: <div class='alert alert-danger clear'>
      <div class='alert-label'><strong><tmpl_var name="error_txt"></strong></div>
      <div class='alert-content'>
            <ol>
                    <li>Possible attack detected. This action has been logged.</li>
            </ol>
      </div>
    </div>
    2018-01-12 17:08:53 - [ERROR] API call to client_add failed.
    2018-01-12 17:08:53 - [ERROR] JSON API REPLY ERROR. Arguments sent were: array (
      'reseller_id' => '0',
      'params' =>
      array (
      'company_name' => 'Cube.com.gr',
      'contact_name' => 'Nik*** **********tou',
      'params_no' => '',
      'vat_id' => '',
      'street' => 'Ch***********pi 9',
      'zip' => '63100',
      'city' => 'Poligiros',
      'state' => 'Chalkidiki',
      'country' => 'GR',
      'telephone' => '+3********4',
      'mobile' => '',
      'fax' => '',
      'email' => '[email protected]',
    ....
    
    The next is the first client that fails

    Should I give the old migration tool a try or is there anything else I can do to make the new version work?

    UPDATE: I am running the old migration tools and it works. Any ideas?
     
    Last edited: Jan 12, 2018
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    That's not a problem with the new migration tool version, the reason is that the IDS system in ISPConfig 3.1.11 is on by default. Edit the file /usr/local/ispconfig/security/security_settings.ini on the new server and change:

    ids_anon_enabled=yes

    to

    ids_anon_enabled=no

    You can turn it on again after migration.
     
    nikolaosp likes this.
  3. nikolaosp

    nikolaosp Member

    Thanks for your answer till.

    Wouldn't it be an excellent idea to keep these instructions somewhere handy like the README file?

    Anyway, thanks for your help and I will be back to share my success (fingers crossed)
     
  4. nikolaosp

    nikolaosp Member

    Not working ...Still same error.
    I changed the ids string, i reset the server and still the same issue
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    Try to set:

    ids_user_enabled=no

    as well. And be sure that you set it on the new server (the target) and not on the old one.

    The change in ISPConfig is newer than the last migration tool release and we were not aware of that problem yet. But that's somethin that needs to be fixed in ISPConfig itself anyway as it affects all applications that use the new REST api and not just the migration tool.
     
    nikolaosp likes this.
  6. nikolaosp

    nikolaosp Member

    This is the last part of the log. After successfully copying all the files and importing the databases it gives me this error.
    I have set both of the ids settings as to the previous comments by you till. Is there any way that I can run only the last part and not the whole migration as it could create more problems than it will fix?

    Code:
    2018-01-13 03:24:35 - [INFO] Successfully executed command rm -f '/tmp/migrate-import-tmp.sql.gz' ;
    2018-01-13 03:24:35 - [INFO] Successfully executed command rm -rf '/tmp/dumps'
    2018-01-13 03:24:35 - [ERROR] JSON API ERROR in API call (server_config_set): NO ACCESS
    2018-01-13 03:24:35 - [INFO] Trying again (server_config_set)
    2018-01-13 03:24:37 - [ERROR] JSON API ERROR in API call (server_config_set): NO ACCESS
    2018-01-13 03:24:37 - [INFO] Trying again (server_config_set)
    2018-01-13 03:24:39 - [ERROR] JSON API ERROR in API call (server_config_set): NO ACCESS
    2018-01-13 03:24:39 - [ERROR] API call to server_config_set failed.
    2018-01-13 03:24:39 - [ERROR] JSON API ERROR. Arguments sent were: array (
      'server_id' => '1',
      'section' => 'server',
      'key' => 'migration_mode',
      'value' => 'n',
      'session_id' => '21349747a48a8591dc18ec84c36160fa',
    )
    2018-01-13 03:24:39 - [ERROR] JSON API ERROR in API call (system_config_set): NO ACCESS
    2018-01-13 03:24:39 - [INFO] Trying again (system_config_set)
    2018-01-13 03:24:41 - [ERROR] JSON API ERROR in API call (system_config_set): NO ACCESS
    2018-01-13 03:24:41 - [INFO] Trying again (system_config_set)
    2018-01-13 03:24:43 - [ERROR] JSON API ERROR in API call (system_config_set): NO ACCESS
    2018-01-13 03:24:43 - [ERROR] API call to system_config_set failed.
    2018-01-13 03:24:43 - [ERROR] JSON API ERROR. Arguments sent were: array (
      'section' => 'sites',
      'key' => 'dbname_prefix',
      'value' => 'c[CLIENTID]',
      'session_id' => '21349747a48a8591dc18ec84c36160fa',
    )
    
     
  7. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    Hello could you please double check that your remote user has all the checkboxes selected.
    In addition please check your Apache Webserver Logfile for the errors at the time the mentioned errors occured in the migration log.
     
  8. nikolaosp

    nikolaosp Member

    It appears that on some of the websites I had on option to disallow mod_pagespeed and that caused the apache server to fail because mod_pagespeed was not installed. I restarted the migration and I will try to see if I run in any more problems.
     
    Last edited: Jan 13, 2018

Share This Page