Search Engine: Elastic

Article ID: 129454, created on Sep 16, 2016, last review on Dec 28, 2017

  • Applies to:
  • Operations Automation 7.0
  • Operations Automation 6.0

Symptoms

A WordPress site application provisioning task fails with the following error:

Script execution failed: executing '/opt/alt/php56/usr/bin/php -d open_basedir= -q configure' for APS application instance with id 13233 returned value '255' with output '' and errors 'PHP Fatal error: Uncaught exception 'phpmailerException' with message 'Invalid address: wordpress@' in /var/www/vhosts/1/140960/webspace/siteapps/WordPress-13233/htdocs/wp-includes/class-phpmailer.php:946
Stack trace:
#0 /var/www/vhosts/1/140960/webspace/siteapps/WordPress-13233/htdocs/wp-includes/pluggable.php(352): PHPMailer->setFrom('wordpress@', 'WordPress')
...

Cause

The issue is corrected in scope of request APSI-537 and fixed in Wordpress APS application version 4.6.1-235.

Resolution

Import the latest Wordpress APS version and use it for provisioning.

There are two possible workarounds in order to fixed a failed task for an older Wordpress version.

The first possible workaround is the following:

  1. Comment the following block inside /var/www/vhosts/1/<webspace_id>/webspace/siteapps/WordPress-<instance_id>/htdocs/wp-includes/class-phpmailer.php (the exact path is found in the task error message):

    public function setFrom($address, $name = '', $auto = true)
    {
        $address = trim($address);
        $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
        // Don't validate now addresses with IDN. Will be done in send().
    //    if (($pos = strrpos($address, '@')) === false or
    //        (!$this->has8bitChars(substr($address, ++$pos)) or !$this->idnSupported()) and
    //        !$this->validateAddress($address)) {
    //        $error_message = $this->lang('invalid_address') . $address;
    //        $this->setError($error_message);
    //        $this->edebug($error_message);
    //        if ($this->exceptions) {
    //            throw new phpmailerException($error_message);
    //        }
    //        return false;
    //    }
        $this->From = $address;
        $this->FromName = $name;
        if ($auto) {
            if (empty($this->Sender)) {
                $this->Sender = $address;
            }
        }
        return true;
    }
    
  2. Re-submit the task afterwards.

As another way to resolve this issue it is possible to set a valid address for $from_email variable in /var/www/vhosts/1/<webspace_id>/webspace/siteapps/WordPress-<instance_id>/htdocs/wp-includes/pluggable.php. Then resubmit failed task.

5356b422f65bdad1c3e9edca5d74a1ae caea8340e2d186a540518d08602aa065 e12cea1d47a3125d335d68e6d4e15e07 956c448bddc7e1f3585373687602379f 6f1456866eed87488c0f02b298a741c0 0871c0b47b3b86ae3b1af4c2942cd0ce 1941880841f714e458ae4dc3d9f3062d

Email subscription for changes to this article
Save as PDF