PECE-project / drupal-pece

PECE development repository
GNU General Public License v3.0
21 stars 28 forks source link

A developer can log in with `drush uli` #355

Closed mlncn closed 8 months ago

mlncn commented 9 months ago

Somehow the generated link is not working:

The website encountered an unexpected error. Please try again later.

TypeError: Drupal\user\Controller\UserController::validatePathParameters(): Argument #4 ($timeout) must be of type int, null given, called in /var/www/html/web/core/modules/user/src/Controller/UserController.php on line 306 in Drupal\user\Controller\UserController->validatePathParameters() (line 330 of core/modules/user/src/Controller/UserController.php).

Drupal\user\Controller\UserController->determineErrorRedirect(Object, 1697136076, 'Ob0TvOM70ET3Qbc0bdslDSI7YmrK7GHTon-0bSqKIm8') (Line: 235) Drupal\user\Controller\UserController->resetPassLogin('1', '1697136076', 'Ob0TvOM70ET3Qbc0bdslDSI7YmrK7GHTon-0bSqKIm8', Object) call_user_func_array(Array, Array) (Line: 123) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}() (Line: 592) 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: 182) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 68) Drupal\simple_oauth\HttpMiddleware\BasicAuthSwap->handle(Object, 1, 1) (Line: 58) Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191) Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128) Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82) Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51) Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704) Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

mlncn commented 9 months ago

This problem has persisted through Drush 11 and Drush 12, uninstalling all PECE custom modules and any contrib module that has anything to do with users, deleting the spanish content language so links are only produced as https://drupal-pece.ddev.site/user/reset/1/1697137964/BzFkiKCtqmoOiUAKcwaMX4aGp9jd0w_43R_TYNq85Cg/login rather than https://drupal-pece.ddev.site/en/user/reset/1/1697137964/BzFkiKCtqmoOiUAKcwaMX4aGp9jd0w_43R_TYNq85Cg/login

And also it happens for newly created users.

It's hard to believe this is not a core bug that hasn't been filed yet? But i cannot find it anywhere reported on Drupal.org or the issue.

mlncn commented 8 months ago

Keegan debugged and found this is due to missing the password_reset_timeout key in the user.settings.yml configuration file.

Here is the history of that file, found with help from Louis:

Edmar Gomes removed the full config file (and every other file) in this commit, "Remove unused config yml."

commit 87699edb3e9ef8d94887838709d12d6d9b482e1a
Author: Edmar Gomes <edmar.gomes@nyx.tc>
Date:   Tue Mar 29 11:58:22 2022 -0300

… and then brought it back, without the critical password_reset_timeout option and several others, in "Update drupal 9 and modules." (which only added a handful of yamle configuration files)

commit ae6232f077a03c1e238285e83d43eddf7ef6bd2c
Author: Edmar Gomes <edmar.gomes@nyx.tc>
Date:   Sat Jun 4 11:05:33 2022 -0300

Also deja vu i think we figured this out already.

But the actionable takeaway to take action on now is to completely update the config so that at least all parts that come from a standard Drupal installation will be the same as that, unless there is a reason, and going forward we run update hooks and capture those changes every time we update code— that is, before we re-run the install from config.

laealfaro commented 8 months ago

This particular issue is resolved in commit: 9abf722

The other config updates to make sure that we have all config from a standard Drupal installation were committed in 9abf722 and surrounding commits.