- 🇩🇪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
11 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.
- 🇺🇸United States brad.bulger
I can tell you that it has nothing to do with DDEV, we are running Drupal 10.3 on Ubuntu / Apache and we see this error constantly. It's caused by bots making GET requests to /contextual/render. They seem to come directly to that URL, no referral.
Personally, I wish it would just return NULL or some such instead of throwing an exception. I don't know why bots are trying to crawl /contextual/render like that.
- 🇨🇦Canada Roshny Kunjappan London
I'm also getting the same issue in log messages for Drupal10.5.0.
- 🇺🇸United States brad.bulger
The rationale for closing this issue was mistaken. We are getting this on valid block configuration contextual menus in 10.4, for instance. No DDEV, no Provision module, none of the other peripheral issues raised in the thread. Just Drupal. Like many problems, "Tell me how to reproduce it from drupal install" is essentially impossible. But it is happening nonetheless.
- 🇦🇺Australia acbramley
Back to PMNMI then since we still need steps to reproduce this.