Drupal 9 Portal Apigee connection problem

Hi everyone,
I'm new to Drupal so obv going through some bumps. Currently working on Drupal 9-based apigee dev portal.

Set it up locally by using Apigee Kickstart (XAMPP server) since I'm on Windows 10 - all good and well. Site is up and such. Tried to set up Apigee connection: config -> apigee-edge -> settings: APIGEE EDGE CONNECTION SETTINGS

Put all my live creds and hit "Test" button - nothing. Checked the log report and found this php error:

TypeError: Apigee\Edge\Api\Management\Entity\Organization::setEnvironments(): Argument #1 must be of type string, array given, called in C:\apigee_local\vendor\symfony\property-access\PropertyAccessor.php on line 564 in Apigee\Edge\Api\Management\Entity\Organization->setEnvironments() (line 40 of C:\apigee_local\vendor\apigee\apigee-client-php\src\Entity\Property\EnvironmentsPropertyAwareTrait.php)

#0 C:\apigee_local\vendor\symfony\property-access\PropertyAccessor.php(564): Apigee\Edge\Api\Management\Entity\Organization->setEnvironments(Array)
#1 C:\apigee_local\vendor\symfony\property-access\PropertyAccessor.php(114): Symfony\Component\PropertyAccess\PropertyAccessor->writeProperty(Array, 'environments', Array)
#2 C:\apigee_local\vendor\apigee\apigee-client-php\src\PropertyAccess\PropertyAccessorDecorator.php(53): Symfony\Component\PropertyAccess\PropertyAccessor->setValue(Object(Apigee\Edge\Api\Management\Entity\Organization), 'environments', Array)
#3 C:\apigee_local\vendor\symfony\serializer\Normalizer\ObjectNormalizer.php(147): Apigee\Edge\PropertyAccess\PropertyAccessorDecorator->setValue(Object(Apigee\Edge\Api\Management\Entity\Organization), 'environments', Array)
#4 C:\apigee_local\vendor\symfony\serializer\Normalizer\AbstractObjectNormalizer.php(361): Symfony\Component\Serializer\Normalizer\ObjectNormalizer->setAttributeValue(Object(Apigee\Edge\Api\Management\Entity\Organization), 'environments', Array, 'json', Array)
#5 C:\apigee_local\vendor\apigee\apigee-client-php\src\Denormalizer\ObjectDenormalizer.php(111): Symfony\Component\Serializer\Normalizer\AbstractObjectNormalizer->denormalize(Object(stdClass), 'Apigee\\Edge\\Api...', 'json', Array)
#6 C:\apigee_local\vendor\symfony\serializer\Serializer.php(196): Apigee\Edge\Denormalizer\ObjectDenormalizer->denormalize(Object(stdClass), 'Apigee\\Edge\\Api...', 'json', Array)
#7 C:\apigee_local\vendor\symfony\serializer\Serializer.php(143): Symfony\Component\Serializer\Serializer->denormalize(Object(stdClass), 'Apigee\\Edge\\Api...', 'json', Array)
#8 C:\apigee_local\vendor\apigee\apigee-client-php\src\Serializer\EntitySerializer.php(124): Symfony\Component\Serializer\Serializer->deserialize(Object(stdClass), 'Apigee\\Edge\\Api...', 'json', Array)
#9 C:\apigee_local\vendor\apigee\apigee-client-php\src\Controller\EntityLoadOperationControllerTrait.php(43): Apigee\Edge\Serializer\EntitySerializer->deserialize('{\n  "createdAt"...', 'Apigee\\Edge\\Api...', 'json')
#10 C:\apigee_local\web\modules\contrib\apigee_edge\src\SDKConnector.php(282): Apigee\Edge\Api\Management\Controller\OrganizationController->load('first-american-...')
#11 C:\apigee_local\web\modules\contrib\apigee_edge\src\KeyEntityFormEnhancer.php(345): Drupal\apigee_edge\SDKConnector->testConnection(Object(Drupal\key\Entity\Key))
#12 [internal function]: Drupal\apigee_edge\KeyEntityFormEnhancer->validateForm(Array, Object(Drupal\Core\Form\FormState))
#13 C:\apigee_local\web\core\lib\Drupal\Core\Form\FormValidator.php(82): call_user_func_array(Array, Array)
#14 C:\apigee_local\web\core\lib\Drupal\Core\Form\FormValidator.php(273): Drupal\Core\Form\FormValidator->executeValidateHandlers(Array, Object(Drupal\Core\Form\FormState))
#15 C:\apigee_local\web\core\lib\Drupal\Core\Form\FormValidator.php(118): Drupal\Core\Form\FormValidator->doValidateForm(Array, Object(Drupal\Core\Form\FormState), 'apigee_edge_aut...')
#16 C:\apigee_local\web\core\lib\Drupal\Core\Form\FormBuilder.php(589): Drupal\Core\Form\FormValidator->validateForm('apigee_edge_aut...', Array, Object(Drupal\Core\Form\FormState))
#17 C:\apigee_local\web\core\lib\Drupal\Core\Form\FormBuilder.php(321): Drupal\Core\Form\FormBuilder->processForm('apigee_edge_aut...', Array, Object(Drupal\Core\Form\FormState))
#18 C:\apigee_local\web\core\lib\Drupal\Core\Controller\FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\apigee_edge\Form\AuthenticationForm), Object(Drupal\Core\Form\FormState))
#19 [internal function]: Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch))
#20 C:\apigee_local\web\core\lib\Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#21 C:\apigee_local\web\core\lib\Drupal\Core\Render\Renderer.php(573): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#22 C:\apigee_local\web\core\lib\Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#23 C:\apigee_local\web\core\lib\Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#24 C:\apigee_local\vendor\symfony\http-kernel\HttpKernel.php(158): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#25 C:\apigee_local\vendor\symfony\http-kernel\HttpKernel.php(80): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#26 C:\apigee_local\web\core\lib\Drupal\Core\StackMiddleware\Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#27 C:\apigee_local\web\core\lib\Drupal\Core\StackMiddleware\KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#28 C:\apigee_local\web\core\modules\page_cache\src\StackMiddleware\PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#29 C:\apigee_local\web\core\modules\page_cache\src\StackMiddleware\PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#30 C:\apigee_local\web\core\lib\Drupal\Core\StackMiddleware\ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#31 C:\apigee_local\web\core\lib\Drupal\Core\StackMiddleware\NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#32 C:\apigee_local\vendor\stack\builder\src\Stack\StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#33 C:\apigee_local\web\core\lib\Drupal\Core\DrupalKernel.php(706): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#34 C:\apigee_local\web\index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#35 {main}

Checked curl call to apigee and saw valid response there from apigee...

Seems to me like something isn't right with the way returned environments array is parse out in Drupal.

Any thoughts what could that be?

Many thanks in advance

0 2 610
2 REPLIES 2

Hi Andrey,


You might have to look into the PHP version that you are running. The version should be 7.4.

$ php -v

PHP 7.4.11 (cli) (built: Sep 29 2020 13:18:06) ( ZTS Visual C++ 2017 x64 ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies with Zend OPcache v7.4.11, Copyright (c), by Zend Technologies


Hope this helps .

Thanks Swapna! I figured that might be the case - have successful set up on another machine with PHP 7.4. Cheers!