apigee / apigee-edge-drupal

The Apigee Edge module enables you to integrate a Drupal 9 or 8 site with Apigee.
https://www.drupal.org/project/apigee_edge
GNU General Public License v2.0
32 stars 45 forks source link

[Hybrid] App deletion from Edge caused WSOD on portal #297

Closed arunz6161 closed 4 years ago

arunz6161 commented 4 years ago

Describe the bug There are a couple of issues noticed once the app is deleted from Edge UI

  1. App continues to be displayed under My Apps page but details like keys are empty. Refer screenshot 1.

  2. After clearing cache, accessing the my apps page returns WSOD. Refer attached screenshot 2.

To Reproduce Steps to reproduce the behavior:

  1. Create a app under a developer and verify that the app shows on the users "my app" page.
  2. Delete the app from edge.
  3. On portal, you will continue to see the app listed but with no info about keys and products.
  4. After clearing cache, "my apps" returns WSOD.

Expected behavior No errors are seen and the APP listing does not include the deleted app.

Screenshots

Screenshot-1 Screenshot-2

Additional context Debug logs

[TypeError: Argument 1 passed to Apigee\Edge\Api\Management\Controller\AppByOwnerController::responseArrayToArrayOfEntities() must be of the type array, boolean given, called in /srv/bindings/6420f4f7065c494287b7dd71bda39f5b/code/vendor/apigee/apigee-client-php/src/Controller/NonPaginatedEntityListingControllerTrait.php on line 47 in Apigee\Edge\Api\Management\Controller\AppByOwnerController->responseArrayToArrayOfEntities() (line 42 of /srv/bindings/6420f4f7065c494287b7dd71bda39f5b/code/vendor/apigee/apigee-client-php/src/Controller/EntityListingControllerTrait.php) #0 /srv/bindings/6420f4f7065c494287b7dd71bda39f5b/code/vendor/apigee/apigee-client-php/src/Controller/NonPaginatedEntityListingControllerTrait.php(47): Apigee\Edge\Api\Management\Controller\AppByOwnerController->responseArrayToArrayOfEntities(false) #1 /srv/bindings/6420f4f7065c494287b7dd71bda39f5b/code/web/modules/contrib/apigee_edge/src/Entity/Controller/AppByOwnerController.php(127): Apigee\Edge\Api\Management\Controller\AppByOwnerController->getEntities() #2 /srv/bindings/6420f4f7065c494287b7dd71bda39f5b/code/web/modules/contrib/apigee_edge/src/Entity/Query/AppQueryBase.php(196): Drupal\apigee_edge\Entity\Controller\AppByOwnerController->getEntities() #3 /srv/bindings/6420f4f7065c494287b7dd71bda39f5b/code/web/modules/contrib/apigee_edge/src/Entity/Query/Query.php(86): Drupal\apigee_edge\Entity\Query\AppQueryBase->getFromStorage() #4 /srv/bindings/6420f4f7065c494287b7dd71bda39f5b/code/web/modules/contrib/apigee_edge/src/Entity/ListBuilder/EdgeEntityListBuilder.php(71): Drupal\apigee_edge\Entity\Query\Query->execute() #5 /srv/bindings/6420f4f7065c494287b7dd71bda39f5b/code/web/core/lib/Drupal/Core/Entity/EntityListBuilder.php(86): Drupal\apigee_edge\Entity\ListBuilder\EdgeEntityListBuilder->getEntityIds() #6 /srv/bindings/6420f4f7065c494287b7dd71bda39f5b/code/web/profiles/contrib/apigee_devportal_kickstart/modules/custom/apigee_kickstart_enhancement/src/Entity/ListBuilder/DeveloperAppListBuilder.php(35): Drupal\Core\Entity\EntityListBuilder->load() #7 [internal function]: Drupal\apigee_kickstart_enhancement\Entity\ListBuilder\DeveloperAppListBuilder->render() #8 /srv/bindings/6420f4f7065c494287b7dd71bda39f5b/code/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array) #9 /srv/bindings/6420f4f7065c494287b7dd71bda39f5b/code/web/core/lib/Drupal/Core/Render/Renderer.php(582): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #10 /srv/bindings/6420f4f7065c494287b7dd71bda39f5b/code/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #11 /srv/bindings/6420f4f7065c494287b7dd71bda39f5b/code/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) #12 /srv/bindings/6420f4f7065c494287b7dd71bda39f5b/code/vendor/symfony/http-kernel/HttpKernel.php(151): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #13 /srv/bindings/6420f4f7065c494287b7dd71bda39f5b/code/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #14 /srv/bindings/6420f4f7065c494287b7dd71bda39f5b/code/web/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #15 /srv/bindings/6420f4f7065c494287b7dd71bda39f5b/code/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #16 /srv/bindings/6420f4f7065c494287b7dd71bda39f5b/code/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #17 /srv/bindings/6420f4f7065c494287b7dd71bda39f5b/code/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #18 /srv/bindings/6420f4f7065c494287b7dd71bda39f5b/code/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #19 /srv/bindings/6420f4f7065c494287b7dd71bda39f5b/code/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #20 /srv/bindings/6420f4f7065c494287b7dd71bda39f5b/code/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #21 /srv/bindings/6420f4f7065c494287b7dd71bda39f5b/code/web/core/lib/Drupal/Core/DrupalKernel.php(693): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #22 /srv/bindings/6420f4f7065c494287b7dd71bda39f5b/code/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #23 {main}.

Version Info Latest Hybrid version

arlina-espinoza commented 4 years ago

@arunz6161 This should be fixed by https://github.com/apigee/apigee-client-php/pull/91. I've updated the testing environment to include this PR, could you test again? Thanks!

shadcn commented 4 years ago

I can confirm @arlina-espinoza's PR fixes this.

arlina-espinoza commented 4 years ago

Closing.