• The APS Catalog has been deprecated and removed from all Plesk Obsidian versions.
    Applications already installed from the APS Catalog will continue working. However, Plesk will no longer provide support for APS applications.
  • Please be aware: with the Plesk Obsidian 18.0.78 release, the support for the ngx_pagespeed.so module will be deprecated and removed from the sw-nginx package.

Plesk XML API issues

Scarabaeus

New Pleskian
Hey guys,

I'm currently trying to create subdomains, databases and database users via the XML API. The Problem is: The API only seems to work sporadically somehow.

These are the issues I experienced:

Sometimes the connection is interrupted when creating a subdomain (the subdomain itself is created by Plesk), sometimes I get no valid (incomplete) XML response when creating a database user and sometimes everything runs just fine.

This is my XML to create a subdomain: http://pastebin.com/cUK4RpCn
And this is my XML to create a database user: http://pastebin.com/2fJPhCe1

I'm using the PHP ApiClient to send the XML: https://github.com/plesk/api-examples/blob/master/php/PleskApiClient.php

I think that the Apache webserver is responsible for the issues but by checking the logfiles I found nothing suspicious that would help me to solve my problems and I'm running out of options. The environment is a standard LAMP stack (PHP 5.6.2) on a Ubuntu 12.04 server.

I hope you can help me with that.

Greetings
 
I think you just made my day.

So far I get no more interrupted connections when subdomains are created via the API.

I guess MySQL is also restarted every time when a database or a database user is added? If this is the case, it would explain why I still get errors when parsing the XML response when adding a database user right after I created a database. I just probably have to tell my script to wait a little bit before I send the next request.

Thank you very much for your help.

Greetings
 
Last edited:
Back
Top