rouble shooting is an essential part of any software system. As a Drupal developer it is important to have knowledge about the most important tips about troubleshooting.
Install/Uninstall module error
When you install/uninstall a module there is usually an error if the module code removed but its entry exist in DB. Some time both exists but still this error. The full error is :
the following module is marked as installed in the core.extension configuration, but it is missing:
Solution:
Using PMA run the following SQL to fix it.
delete from `key_value` where collection = 'system.schema' and name = 'image_downloader';
The context is not valid
This error occurs in ctools.
Converting back to version 3.9.0 solved it.
composer require 'drupal/ctools:3.9.0'
Solved: Drupal - Exception: Serialization of Symfony is not allowed in serialize line 14
During my earlier days with Drupal module development, the instructor gave these instructions with a smiley face that more than 90% of drupal issue are related to Drupal cache.
Since then I was paying special attention to it while module development but today I spent a couple of hours & googling around, looking at different logs & debugging & turning stones here and there, beating around the bushes to solve the following problem:
Exception: Serialization of 'Symfony\Component\HttpFoundation\File\UploadedFile' is not allowed in serialize() (line 14 of /opt/web/core/lib/Drupal/Component/Serialization/PhpSerialize.php).
And a million dollar solution is to add the following in the build method.
// Don't cache
$form_state->disableCache();
The module mysql is not installed
This error occurs while enabling a module in extend.
The solution is :
docker exec -ti container_name composer update
docker exec -ti container_name chmod 777 /opt -Rf
docker exec -ti container_name /opt/vendor/drush/drush/drush cr
Composer update memory limit
While updating composer packages (specially using docker) you may encounter memory limit reached issue. The solution is to simply run the composer update command on localhost (without docker container), and may be install (composer.json packages) it in docker then.
Twig chainloader twig is not defined
Enable components module
Workflow new status not working
Check for user permissions
Composer - file_get_contents(): read of 8192 bytes failed with errno=21 Is a directory
The composer.lock is a directory, remove it an run composer install again.
- Install/Uninstall module error
- The context is not valid
- Solved: Drupal - Exception: Serialization of Symfony is not allowed in serialize line 14
- The module mysql is not installed
- Composer update memory limit
- Twig chainloader twig is not defined
- Workflow new status not working
- Composer - file_get_contents(): read of 8192 bytes failed with errno=21 Is a directory