• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue 502 Bad Gateway on Git fetch/deploy via Plesk API

decodernt

New Pleskian
Hello, i am facing a problem with Plesk API when i fetch and deploy from Git on multiple domains. The request is being made from another server (used to do it from the same, but thought that that was causing the 502), i also tried to put inside a single API call multiple fetch/deploy (domains) and single fetch/deploy (domain), but whatever i do, there is always a chance of a mostly one but other times could be more (live) sites (which were updated by the git deploy) showing 502 bad Gateway, so i need to "Apply PHP Settings" in order to recover the sites back to normal.

Also, no matter how much time later you try to visit the site, if you wont reset the php settings (just press apply, to reload), the site wont come back online. So it's not a peek on visitors, or network traffic...

Is this a problem of the API, server, php, nginx...i do not know..anyone could help?

Thank you

The requet for git update is this:

$request = '
<packet>
<extension>';
foreach ($packages as $domain => $domainkey){
$request .= '
<call>
<git>
<fetch>
<domain>'.$domain.'</domain>
<name>'.$domainkey.'</name>
</fetch>
</git>
</call>
<call>
<git>
<deploy>
<domain>'.$domain.'</domain>
<name>'.$domainkey.'</name>
</deploy>
</git>
</call>';
}
$request .= '</extension>
</packet>
';

$response = $this->request($request);
 
Do you happen to have the "Apache graceful restart" option enable in the Apache Web Server Settings of Plesk? If not, enable it and see if it makes any difference.
 
An 502 error means that Nginx cannot communicate with Apache. So you're most likely using Nginx as a reverse proxy, and Apache is still being used a downstream server.

You'll have to look in your domains error log to get the exact error that causes this issue.
 
Back
Top