• Hi, Pleskians! We are running a UX testing of our upcoming product intended for server management and monitoring.
    We would like to invite you to have a call with us and have some fun checking our prototype. The agenda is pretty simple - we bring new design and some scenarios that you need to walk through and succeed. We will be watching and taking insights for further development of the design.
    If you would like to participate, please use this link to book a meeting. We will sent the link to the clickable prototype at the meeting.
  • (Plesk for Windows):
    MySQL Connector/ODBC 3.51, 5.1, and 5.3 are no longer shipped with Plesk because they have reached end of life. MariaDB Connector/ODBC 64-bit 3.2.4 is now used instead.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.

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