Drupal website not accessible

Dear colleague,
I was trying to access the drupal website: https://project-ut.web.cern.ch/ and I have got the following message.
Could you please let me know how to solve this issue?

Hi Joao

I am flagging this.

Sorry for the inconvenience.


Hi @joao ,

Taking a closer look at your website, I see that there are logs like this:

PHP Fatal error:  Uncaught TypeError: Argument 5 passed to Drupal\Core\Template\TwigExtension::__construct() must implement interface Drupal\Core\File\FileUrlGeneratorInterface or be null, instance of Drupal\flag\FlagCountManager given, called in /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 262 and defined in /app/web/core/lib/Drupal/Core/Template/TwigExtension.php:86
Stack trace:
#0 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(262): Drupal\Core\Template\TwigExtension->__construct(Object(Drupal\Core\Render\Renderer), Object(Drupal\Core\Render\MetadataBubblingUrlGenerator), Object(Drupal\Core\Theme\ThemeManager), Object(Drupal\Core\Datetime\DateFormatter), Object(Drupal\flag\FlagCountManager))
#1 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(176): Drupal\Component\DependencyInjection\Container->createService(Array, 'flag.twig.count')
#2 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(437): Drupal\Component\DependencyInjection\Container->get('flag.twig.count', 1)
#3 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(276): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#4 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(176): Drupal\Component\DependencyInjection\Container->createService(Array, 'twig')
#5 /app/web/core/lib/Drupal.php(198): Drupal\Component\DependencyInjection\Container->get('twig')
#6 /app/web/core/includes/common.inc(555): Drupal::service('twig')

This is most likely an issue with your locally installed module Flags. You can find this module through the webdav interface. It’s possible that the currently installed version isn’t compatible with Drupal 9.3, or that it hasn’t been installed correctly.

Unfortunately, I can’t give you much more information than this. We don’t have the resources to help you debug more deeply an issue related with a module that you have installed locally yourself.
I hope this info is helpful nonetheless.

Thanks for your reply! so i guess you advise to remove the flags module.
could you please let me know how to do it? i found the module in the webdav interface but i can’t uninstall it.
thanks for your help. Joao

Before making any change to your website I advise you to create a clone and experiment there (if it never gets created due to the error, let us know).

Once you have your clone, you can try first upgrading the module. Search upstream if there’s a newer version. Delete the local directory and replace it with the newest version. If your site works after this, then you can try uninstalling it properly from the “Extensions” panel. Then, you can safely delete the directory again.

I advise against simply removing the directory even if your site appears to work after such an action. In case the module was in use, there will be leftover references on your website’s database which can cause worse trouble upon the next update.

Hi Joao, just to add to Konstantinos’ message above: It does appear like flags has a Drupal 9 compatible version (https://www.drupal.org/project/flags/releases/8.x-1.0-beta3) you could go ahead and try first on a clone website. If upgrading does not resolve your issue, you would necessarily be looking at removing this specific module and using another to re-create the functionality required. Please refer to this guide on how to uninstall modules: https://drupal-tools.web.cern.ch/how-do-i-remove-or-uninstall-modules.

Hi Joachim, thanks for the additional information and availability to provide additional support.
i have cloned the website through the https://webservices-portal.web.cern.ch however the process was not successful.
let me know if you have any advice on the cloning process.

Hi Joao

As seen in the notification, the website is still initialising.

If nothing has changed in another ~15 minutes, please let us know.


Hi Joachim,
I started the process this afternoon at 2pm. basically i waited until now.

Hi again

Thanks for the confirmation. I will flag this accordingly.

I apologise for the inconvenience!

@joao while we look into the main site, is this backup of any use to you? https://project-ut-backup.web.cern.ch/

Regarding the main site, the issue you’re facing is most likely this: TypeError: Drupal\Core\Template\TwigExtension::__construct(): Argument #5 ($file_url_generator) must be of type ?Drupal\Core\File\FileUrlGeneratorInterface, Drupal\flag\FlagCountManager given [#3251435] | Drupal.org

It’s apparently resolved in the development version of the module. I will try replacing your local copy by downloading the dev version from upstream.

Updating the module has restored your main site.

This kind of problem will happen again to your site since you have a beta version of a module installed locally. Our workload is too big to help on a regular basis, so you’ll have to take care of it yourself the next time.

You can do so by essentially following the instructions for preparing your site for Drupal 9: How to Prepare Your Website for its Drupal 9 Upgrade | Drupal @ CERN
Instead of fixing something inside the module, in this case you’ll use the same interface to delete the whole directory of the module and replace it with the new version that you download from the source.

1 Like