- 🇩🇪Germany thomaswalther Rhein-Main Area
I upload a media video on drupal 10.0.8 (php 8.1.21).
the upload is limited on "2 MB" on the server.
so i changed via php.ini to
upload_max_filesize = 16M post_max_size = 16M
after that change, i could upload the video, but there occurs the error:
Symfony\Component\HttpKernel\Exception\BadRequestHttpException: No contextual ids specified. in Drupal\contextual\ContextualController->render() (line 66 of /webroot/core/modules/contextual/src/ContextualController.php).
Drupal shows the Error (german)
Ein nicht behebbarer Fehler ist aufgetreten. Die Datei hat wahrscheinlich die maximale Dateigröße (16 MB) überschritten, die dieser Server unterstützt.
There is definitely a difference between DDEV and Pantheon on this. I see the error and contextual links don't load initially in DDEV until the caches are cleared. But with Pantheon I don't see the error, and there is no trouble with contextual links.
Ok, interesting findings. Start Docker desktop,
ddev start
, and go to the site, no contextual links are rendered and there is the following error in the dblog:
Symfony\Component\HttpKernel\Exception\BadRequestHttpException: Invalid contextual ID specified. in Drupal\contextual\ContextualController->render() (line 78 of /var/www/html/web/core/modules/contextual/src/ContextualController.php).
Then clear caches. (via Drush or UI) and all is better.
Thenddev stop
,ddev start
. All is still fine.
Shut down Docker desktop, and restart docker, thenddev start
. Visit the site, and the problem is back exactly as it was.
The only difference I can see from the command line is that the ddev-ssh-agent containers are recreated and started after having shut down docker:Container ddev-ssh-agent Recreate Container ddev-ssh-agent Recreated Container ddev-ssh-agent Started ssh-agent container is running: If you want to add authentication to the ssh-agent container, run 'ddev auth ssh' to enable your keys.
Also, after clearing the cache and "fixing" it,
ddev poweroff
, andddev start
bring the problem back the same way that shutting down Docker does.Ok, so DDEV users, here you go. Whenever ddev builds the containers, they create a new hash_salt everytime. You can reproduce this by opening the settings.ddev.php file, doing
ddev poweroff
, and thenddev start
to view it change in real time.So if you place one of the hash_salt values ddev creates AFTER the loop in settings.php, this will allow that value to persist despite the new hash salt every start-up. Something like this:
// Automatically generated include for settings managed by ddev. $ddev_settings = dirname(__FILE__) . '/settings.ddev.php'; if (getenv('IS_DDEV_PROJECT') == 'true' && is_readable($ddev_settings)) { require $ddev_settings; } $settings['hash_salt'] = 'TjrGfXryltDjIfeIlxgbouWdUlOBXQaalBjXkgxsvbEYQowkqSZsDeraAyUzGUCT';
Here is a link to a new issue in ddev for this:
https://github.com/ddev/ddev/issues/5255I bet this explains #27 🐛 BadRequestHttpException: Invalid contextual ID specified Postponed: needs info too. I'm guessing when you push a site from pantheon dev to test, there's a new hash_salt value for test environment.
And once cache is cleared the problem doesn't come back.
- 🇷🇴Romania ioana apetri
I use ddev for lunching the Drupal - version 10.1.4.I am experiencing the same issue, but after clearing the cache it dissapeared. I also cannot indentify why do I have this error in the error logs.
- Status changed to Closed: won't fix
3 months ago 12:45am 13 September 2024 - 🇦🇺Australia acbramley
This has been in PMNMI for almost 2 years and the comments since seem to indicate it is an issue in DDEV and has been fixed since.
I am closing this issue. Please feel free to re-open with steps to reproduce from a fresh drupal installation if appropriate.