• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

Issue Plesk XML API Error

Joni

New Pleskian
Hi,

Im trying to set via API a mysql remote allowed ip, the request:

Code:
<packet>
<database>
   <set-db-user>
    <id>$id</id>
    <allow-access-from>
       <ip-address>$externalIp</ip-address>
    </allow-access-from>
  </set-db-user>
</database>
</packet>

$id -> DB User ID
$externalIp -> The ip that i try to allow.

It returns:

Code:
object(PleskX\Api\XmlResponse)#2 (1) {
  ["status"]=>
  string(2) "ok"
}

If i ask to API about user info it returns:

Code:
object(PleskX\Api\XmlResponse)#2 (7) {
  ["status"]=>
  string(2) "ok"
  ["filter-id"]=>
  string(2) "21"
  ["id"]=>
  string(2) "23"
  ["login"]=>
  string(11) "xxxx_xxxx"
  ["db-id"]=>
  string(2) "21"
  ["acl"]=>
  object(PleskX\Api\XmlResponse)#3 (1) {
   ["host"]=>
   string(9) "localhost"
  }
  ["allow-access-from"]=>
  object(PleskX\Api\XmlResponse)#4 (1) {
   ["ip-address"]=>
   string(10) "X.X.X.X"
  }
}

i just replaced the real data for xxxxx

So, it should be working but nope, i cant connect...

If i enter vía Ples Admin (Web) and go to dbuser config the option marked is "Allow only local connections".

Any idea?

Many Thanks.
 
Last edited:
The second environment:

I made this request:

Code:
<packet>
<database>
   <set-db-user>
    <id>$id</id>
    <acl>
       <host>$externalIp</host>
    </acl>
  </set-db-user>
</database>
</packet>

And i got:

Code:
object(PleskX\Api\XmlResponse)#2 (7) {
  ["status"]=>
  string(2) "ok"
  ["filter-id"]=>
  string(2) "21"
  ["id"]=>
  string(2) "23"
  ["login"]=>
  string(11) "xxxx_xxxx"
  ["db-id"]=>
  string(2) "21"
  ["acl"]=>
  object(PleskX\Api\XmlResponse)#3 (1) {
   ["host"]=>
   string(10) "X.X.X.X"
  }
  ["allow-access-from"]=>
  object(PleskX\Api\XmlResponse)#4 (0) {}
}

Good! i can made a remote conection and if i enter via Plesk Admin (Web) the ip is showing up in the "Allow remote connection from" option.

Apparently it is correct, but no. Now deny the local connections made by the website (PHP).

So, none of the two environments are working as spected.

Any idea?
 
Last edited:
Back
Top