Problem/Motivation

Drupal\social_api\SocialApiException: The PHP League OAuth2 library for Facebook not found. Class: \League\OAuth2\Client\Provider\Facebook. in Drupal\social_auth_facebook\Plugin\Network\FacebookAuth->initSdk() (regel 44 van /customers/0/3/1/domain.be/httpd.www/D9/modules/social_auth_facebook/src/Plugin/Network/FacebookAuth.php).

Steps to reproduce

I installed 8.x-2.x-dev on Drupal 9.1.0 and installed following library's in composer:
composer require league/oauth2-facebook (v2.0)
composer require league/oauth2-client (v2.6)

but still have the error, can somebody help me out?

Comments

Khoebeke created an issue. See original summary.

wells’s picture

Version: 8.x-2.x-dev » 3.x-dev
Status: Active » Postponed (maintainer needs more info)

I'm not sure if the 8.x-2.x Drupal 9 support was actually complete. Could you test with 3.0.0-rc1 and report back if you still have this issue?

khoebeke’s picture

Thanks for the update to RC1! ;)

I installed RC1 but now have this error:

ArgumentCountError: Too few arguments to function Drupal\social_auth_facebook\FacebookAuthManager::__construct(), 2 passed in /customers/0/3/1/mydomain.be/httpd.www/D9/core/lib/Drupal/Component/DependencyInjection/Container.php on line 257 and exactly 3 expected in Drupal\social_auth_facebook\FacebookAuthManager->__construct() (regel 33 van /customers/0/3/1/mydomain.be/httpd.www/D9/modules/social_auth_facebook/src/FacebookAuthManager.php)
#0 /customers/0/3/1/mydomain.be/httpd.www/D9/core/lib/Drupal/Component/DependencyInjection/Container.php(257): Drupal\social_auth_facebook\FacebookAuthManager->__construct(Object(Drupal\Core\Config\ConfigFactory), Object(Drupal\Core\Logger\LoggerChannelFactory))
#1 /customers/0/3/1/mydomain.be/httpd.www/D9/core/lib/Drupal/Component/DependencyInjection/Container.php(171): Drupal\Component\DependencyInjection\Container->createService(Array, 'social_auth_fac...')
#2 /customers/0/3/1/mydomain.be/httpd.www/D9/modules/social_auth_facebook/src/Controller/FacebookAuthController.php(59): Drupal\Component\DependencyInjection\Container->get('social_auth_fac...')
#3 /customers/0/3/1/mydomain.be/httpd.www/D9/core/lib/Drupal/Core/DependencyInjection/ClassResolver.php(28): Drupal\social_auth_facebook\Controller\FacebookAuthController::create(Object(Drupal\Core\DependencyInjection\Container))
#4 /customers/0/3/1/mydomain.be/httpd.www/D9/core/lib/Drupal/Core/Controller/ControllerResolver.php(117): Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition('\\Drupal\\social_...')
#5 /customers/0/3/1/mydomain.be/httpd.www/D9/core/lib/Drupal/Core/Controller/ControllerResolver.php(69): Drupal\Core\Controller\ControllerResolver->createController('\\Drupal\\social_...')
#6 /customers/0/3/1/mydomain.be/httpd.www/D9/core/lib/Drupal/Core/Controller/ControllerResolver.php(85): Drupal\Core\Controller\ControllerResolver->getControllerFromDefinition('\\Drupal\\social_...', '/user/login/fac...')
#7 /customers/0/3/1/mydomain.be/httpd.www/D9/vendor/symfony/http-kernel/HttpKernel.php(141): Drupal\Core\Controller\ControllerResolver->getController(Object(Symfony\Component\HttpFoundation\Request))
#8 /customers/0/3/1/mydomain.be/httpd.www/D9/vendor/symfony/http-kernel/HttpKernel.php(80): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#9 /customers/0/3/1/mydomain.be/httpd.www/D9/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#10 /customers/0/3/1/mydomain.be/httpd.www/D9/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#11 /customers/0/3/1/mydomain.be/httpd.www/D9/core/modules/page_cache/src/StackMiddleware/PageCache.php(191): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#12 /customers/0/3/1/mydomain.be/httpd.www/D9/core/modules/page_cache/src/StackMiddleware/PageCache.php(128): Drupal\page_cache\StackMiddleware\PageCache->fetch(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#13 /customers/0/3/1/mydomain.be/httpd.www/D9/core/modules/page_cache/src/StackMiddleware/PageCache.php(82): Drupal\page_cache\StackMiddleware\PageCache->lookup(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#14 /customers/0/3/1/mydomain.be/httpd.www/D9/core/modules/ban/src/BanMiddleware.php(50): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#15 /customers/0/3/1/mydomain.be/httpd.www/D9/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\ban\BanMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#16 /customers/0/3/1/mydomain.be/httpd.www/D9/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#17 /customers/0/3/1/mydomain.be/httpd.www/D9/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#18 /customers/0/3/1/mydomain.be/httpd.www/D9/core/lib/Drupal/Core/DrupalKernel.php(706): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#19 /customers/0/3/1/mydomain.be/httpd.www/D9/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#20 {main}
khoebeke’s picture

Hi Mr Wells,
Thanks for the update to 3.0.0-rc1 update!
I now have an other error, I already made a new issue.

wells’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Thanks for following up, @Khoebeke. I'm closing this issue assuming it is resolved. Please re-open if that's not the case.

khoebeke’s picture

Hi Mr Wells

I had the same error again after updating from Drupal 9.1.2 to 9.1.3.
I still use 3.0.0-rc2 who was working perfectly on Drupal 9.1.2
After running composer require league/oauth2-facebook ok on Drupal 9.1.3.
Just wanted to inform you about this.

paintingguy’s picture

every time I update drupal core I get this error:
The website encountered an unexpected error. Please try again later.

Drupal\social_api\SocialApiException: The PHP League OAuth2 library for Facebook not found. Class: \League\OAuth2\Client\Provider\Facebook. in Drupal\social_auth_facebook\Plugin\Network\FacebookAuth->initSdk() (line 44 of modules/social_auth_facebook/src/Plugin/Network/FacebookAuth.php).

Drupal\social_api\Plugin\NetworkBase->getSdk() (Line: 167)
Drupal\social_auth\Controller\OAuth2ControllerBase->Drupal\social_auth\Controller\{closure}() (Line: 578)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 208)
Drupal\social_auth\Controller\OAuth2ControllerBase->redirectToProvider()
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 578)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 158)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 50)
Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 717)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)