apigee / apigee-m10n-drupal

Add monetization features to a Drupal developer portal
https://www.drupal.org/project/apigee_m10n
GNU General Public License v2.0
13 stars 13 forks source link

Nginx 404 when using Apigee Monetization 2.0.1 #370

Closed vanberge closed 2 years ago

vanberge commented 2 years ago

Description

Apigee monetization plugin implementation results in nginx 404 error due to invalid permissions.

Path: /user/5/monetization/xproduct/plan//purchase. Drupal\Core\Http\Exception\CacheableAccessDeniedHttpException: The following permissions are required: 'purchase xrate_plan' OR 'purchase xrate_plan xrate_plan'. in Drupal\Core\Routing\AccessAwareRouter->checkAccess() (line 118 of /var/www/devportal/code/web/core/lib/Drupal/Core/Routing/AccessAwareRouter.php).

Steps to Reproduce

Steps to reproduce the behavior:

  1. Create API product leveraging Apigee Monetization v 2.0.1
  2. Attempt to purchase via this API endpoint

Actual Behavior

Recieve nginx 404 error page

Expected Behavior

Apigee Monetization API endpoint should execute with 200

Screenshots

Notes

Performed initial troubleshooting including flushed all cache, module at latest version Error was found in the Drupal logs: Reports > Recent Log Messages > Filter on warnings

Seems the permissions the permissions the AccessAwareRouter is checking are not correct: 'purchase xrate_plan' or 'purchase xrate_plan xrate_plan'

Version Info

Drupal core 9.3.9 Apigee Monetization v2.0.1

raakesh-blokhra commented 2 years ago

Thanks for bringing this to our notice. We will get back to you shortly.

shishir-intelli commented 2 years ago

Hi @vanberge ,

Have you enabled the permission for ApigeeX in the Drupal permission page, Go to admin/people/permissions (as admin) look for Apigee Monetization tab and make sure you have enabled the Purchase apigeex rate plan for that User/Role or AUTHENTICATED USER. Flushed all cache and try it again.

vanberge commented 2 years ago

@shishir-intelli we did review these permissions. However, removing/recreating the API product did seem to solve the problem for now. I will close, thanks!