Plugin Fatal Error

Created on 25 June 2023, over 1 year ago
Updated 24 July 2023, over 1 year ago

I have implemented a OAuth2 Client plugin as described in the documentation and using the examples in the Etsy Shop Integration β†’ module. After I install the module and browse to /admin/config, I get a WSOD with a message "The website encountered an unexpected error. Please try again later." and the following in the logs:

Drupal\oauth2_client\Exception\InvalidOauth2ClientException: The OAuth2 Client plugin 'etsy' does not exist in Drupal\oauth2_client\Service\Oauth2ClientService->getClient() (line 85 of /var/www/drupal10/web/modules/contrib/oauth2_client/src/Service/Oauth2ClientService.php).

If i manually type in the URL for the system configuration (/admin/config/system) the page loads as expected. I can then edit the etsy OAuth2 Client plugin and request a token successfully. Then when navigating back to /admin/config, the page displays correctly.

Any help on why OAuth2 Client isn't initially seeing my client configuration would be greatly appreciated.

πŸ› Bug report
Status

Closed: works as designed

Version

4.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States r0nn1ef

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @r0nn1ef
  • Assigned to fathershawn
  • πŸ‡ΊπŸ‡ΈUnited States fathershawn New York

    I'm not sure from this description, but I'll investigate! The prime suspects are cached plugin definitions not being updated, or the associated config entity not being created.

  • Status changed to Closed: cannot reproduce over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States fathershawn New York

    I can't reproduce your error, so I'm unable to provide a cause. Here are my steps. You might try them or adapt them on your setup and see if it sheds any light.

    In a fresh, clean Drupal 10 site, add oauth2 client module:

    1. Visit /admin/site in the clean site to populate caches
    2. Enable oauth2_client_example_plugins module, which will also enable oauth2_client
    3. Reload /admin/site - no error
    4. Visit admin/config/system/oauth2-client - no error.

    If this repeats without error on your local setup, I'd suggest repeating this clean site test with your custom module.

  • πŸ‡ΊπŸ‡ΈUnited States r0nn1ef

    It turned out to be a caching issue. I cleared the caches and all seems to be well now.

  • Issue was unassigned.
  • Status changed to Closed: works as designed over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States r0nn1ef
Production build 0.71.5 2024