ArgumentCountError breaking site

Created on 17 June 2024, 7 months ago
Updated 19 June 2024, 7 months ago

Problem/Motivation

The website encountered an unexpected error. Please try again later.
ArgumentCountError: Too few arguments to function Drupal\oauth2_server\Authentication\Provider\OAuth2DrupalAuthProvider::__construct(), 5 passed in /~site~/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 and exactly 6 expected in Drupal\oauth2_server\Authentication\Provider\OAuth2DrupalAuthProvider->__construct() (line 82 of modules/contrib/oauth2_server/src/Authentication/Provider/OAuth2DrupalAuthProvider.php).

Steps to reproduce

Require module and see the error

Proposed resolution

Code change is proposed

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Postponed: needs info

Version

2.0

Component

Code

Created by

🇦🇺Australia dzastin

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

Comments & Activities

  • Issue created by @dzastin
  • Assigned to PrabuEla
  • 🇮🇳India Indranil Roy kolkata

    Hi @dzastin, Not able to reproduce the error in Drupal 10.1.6 with PHP 8.2.
    Steps :
    1. require the module.
    2. enable the module.
    3. clear the cache.
    do I need to add any configuration?

  • Issue was unassigned.
  • 🇮🇳India PrabuEla chennai

    @dzastin, I don't face the issue which you have mentioned.
    @Indranil Roy, Once the module was installed via composer and enabled via drush. The page gets breaks for me.

    Error: Interface "OAuth2\OpenID\Storage\AuthorizationCodeInterface" not found in include() (line 19 of /app/web/modules/contrib/oauth2_server/src/OAuth2StorageInterface.php)
    #0 /app/vendor/composer/ClassLoader.php(576): include()
    #1 /app/vendor/composer/ClassLoader.php(427): Composer\Autoload\{closure}('/app/web/module...')
    #2 /app/web/modules/contrib/oauth2_server/src/OAuth2Storage.php(21): Composer\Autoload\ClassLoader->loadClass('Drupal\\oauth2_s...')
    #3 /app/vendor/composer/ClassLoader.php(576): include('/app/web/module...')
    #4 /app/vendor/composer/ClassLoader.php(427): Composer\Autoload\{closure}('/app/web/module...')
    #5 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(259): Composer\Autoload\ClassLoader->loadClass('Drupal\\oauth2_s...')
    #6 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService(Array, 'oauth2_server.s...')
    #7 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(440): Drupal\Component\DependencyInjection\Container->get('oauth2_server.s...', 1)
    #8 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(237): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
    #9 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService(Array, 'authentication....')
    #10 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(440): Drupal\Component\DependencyInjection\Container->get('authentication....', 1)
    #11 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(237): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
    #12 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(455): Drupal\Component\DependencyInjection\Container->createService(Array, 'private__DimxxC...')
    #13 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(273): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
    #14 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService(Array, 'page_cache_requ...')
    #15 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(440): Drupal\Component\DependencyInjection\Container->get('page_cache_requ...', 1)
    #16 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(237): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
    #17 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService(Array, 'http_middleware...')
    #18 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(440): Drupal\Component\DependencyInjection\Container->get('http_middleware...', 1)
    #19 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(237): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
    #20 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService(Array, 'http_middleware...')
    #21 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(440): Drupal\Component\DependencyInjection\Container->get('http_middleware...', 1)
    #22 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(237): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
    #23 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService(Array, 'http_middleware...')
    #24 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(440):

    We will create another issue. If this is replicated by any other. Else we need bit more information for the issue.

  • Status changed to Postponed: needs info 7 months ago
  • 🇦🇺Australia cafuego

    The code and service for OAuth2DrupalAuthProvider both look fine to me.

    @PrabuEla that backtrace looks like it might be an issue with bshaffer/oauth2-server-php. Which version of that library is installed?

Production build 0.71.5 2024