-
Notifications
You must be signed in to change notification settings - Fork 739
Open
Labels
Type: BugAn issue or pull request relating to a bug in WebPageTestAn issue or pull request relating to a bug in WebPageTest
Description
Description
After update private wpt to the latest release 24.12 (btw, works fine on 23.01 release), faced with issues during cron jobs that triggers every 5 minutes here:
https://github.com/catchpoint/WebPageTest/blob/master/www/cron/5min.php#L54
which triggers EC2_GetRunningInstances
WebPageTest/www/ec2/ec2.inc.php
Line 438 in 4e15ff7
| function EC2_GetRunningInstances() { |
and then on this line:
WebPageTest/www/ec2/ec2.inc.php
Line 448 in 4e15ff7
| $response = $ec2->describeRegions(); |
it fails with error:
==> /var/log/php7.4-fpm.log <==
[27-Dec-2024 08:00:01] WARNING: [pool www] child 805 said into stderr: "NOTICE: PHP message: Argument 1 passed to Symfony\Component\EventDispatcher\EventDispatcher::dispatch() must be an object, string given, called in /var/www/webpagetest/www/lib/aws/Guzzle/Common/AbstractHasDispatcher.php on line 40"
[27-Dec-2024 08:00:01] WARNING: [pool www] child 805 said into stderr: "NOTICE: PHP message: PHP Fatal error: Uncaught TypeError: Argument 1 passed to Symfony\Component\EventDispatcher\EventDispatcher::dispatch() must be an object, string given, called in /var/www/webpagetest/www/lib/aws/Guzzle/Common/AbstractHasDispatcher.php on line 40 and defined in /var/www/webpagetest/vendor/symfony/event-dispatcher/EventDispatcher.php:48"
[27-Dec-2024 08:00:01] WARNING: [pool www] child 805 said into stderr: "Stack trace:"
[27-Dec-2024 08:00:01] WARNING: [pool www] child 805 said into stderr: "#0 /var/www/webpagetest/www/lib/aws/Guzzle/Common/AbstractHasDispatcher.php(40): Symfony\Component\EventDispatcher\EventDispatcher->dispatch('client.command....', Object(Guzzle\Common\Event))"
[27-Dec-2024 08:00:01] WARNING: [pool www] child 805 said into stderr: "#1 /var/www/webpagetest/www/lib/aws/Guzzle/Service/Client.php(91): Guzzle\Common\AbstractHasDispatcher->dispatch('client.command....', Array)"
[27-Dec-2024 08:00:01] WARNING: [pool www] child 805 said into stderr: "#2 /var/www/webpagetest/www/lib/aws/Guzzle/Service/Client.php(76): Guzzle\Service\Client->getCommand('DescribeRegions', Array)"
[27-Dec-2024 08:00:01] WARNING: [pool www] child 805 said into stderr: "#3 /var/www/webpagetest/www/lib/aws/Aws/Common/Client/AbstractClient.php(106): Guzzle\Service\Client->__call('DescribeRegions', Array)"
[27-Dec-2024 08:00:01] WARNING: [pool www] child 805 said into stderr: "#4 /var/www/webpagetest/www/ec2/ec2.inc.php(448): A..."
==> /var/log/nginx/error.log <==
2024/12/27 08:00:01 [error] 614#614: *628 FastCGI sent in stderr: "PHP message: Argument 1 passed to Symfony\Component\EventDispatcher\EventDispatcher::dispatch() must be an object, string given, called in /var/www/webpagetest/www/lib/aws/Guzzle/Common/AbstractHasDispatcher.php on line 40PHP message: PHP Fatal error: Uncaught TypeError: Argument 1 passed to Symfony\Component\EventDispatcher\EventDispatcher::dispatch() must be an object, string given, called in /var/www/webpagetest/www/lib/aws/Guzzle/Common/AbstractHasDispatcher.php on line 40 and defined in /var/www/webpagetest/vendor/symfony/event-dispatcher/EventDispatcher.php:48
Stack trace:
#0 /var/www/webpagetest/www/lib/aws/Guzzle/Common/AbstractHasDispatcher.php(40): Symfony\Component\EventDispatcher\EventDispatcher->dispatch('client.command....', Object(Guzzle\Common\Event))
#1 /var/www/webpagetest/www/lib/aws/Guzzle/Service/Client.php(91): Guzzle\Common\AbstractHasDispatcher->dispatch('client.command....', Array)
#2 /var/www/webpagetest/www/lib/aws/Guzzle/Service/Client.php(76): Guzzle\Service\Client->getCommand('DescribeRegions', Array)
#3 /var/www/webpagetest/www/lib/aws/Aws/Common/Client/AbstractClient.php(106): Guzzle\Service\Client->__call('DescribeRegions', Array)
#4 /var/www/webpagetest/www/ec2/ec2.inc.php(448): A" while reading response header from upstream, client: 127.0.0.1, server: _, request: "GET /cron/5min.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "127.0.0.1"Steps to reproduce
Install wpt 24.12 release
www/settings/settings.ini should contain valid aws access/secret key
ec2_key=AKIAXXXXXXXXX
ec2_secret=XXXXXXXXXXX
just for testing purpose, create file /var/www/webpagetest/www/testRegions.php
<?php
require_once('./common_lib.inc');
require_once('./lib/aws/aws-autoloader.php');
$instances = array();
$key = GetSetting('ec2_key');
$secret = GetSetting('ec2_secret');
if ($key && $secret) {
try {
$ec2 = \Aws\Ec2\Ec2Client::factory(array('key' => $key, 'secret' => $secret, 'region' => 'us-east-1'));
$regions = array();
$response = $ec2->describeRegions();
if (isset($response['Regions'])) {
foreach ($response['Regions'] as $region)
$regions[] = $region['RegionName'];
}
} catch (\Aws\Ec2\Exception\Ec2Exception $e) {
$error = $e->getMessage();
EC2LogError("Listing running EC2 instances: $error");
}
}
echo $response;
?>and trigger it by
php testRegions.phpExpected result
It should show what came from available regions
Actual result
Error happen described earlier
ignatovich-artem
Metadata
Metadata
Assignees
Labels
Type: BugAn issue or pull request relating to a bug in WebPageTestAn issue or pull request relating to a bug in WebPageTest