Uninstall a module called "contact-storage" that is making my website fail

I am looking for help regarding an installed module on my website that is giving me a lot of problems.

I installed it a while ago but I am not using it on my website. The last time there was a security update, I received a notification that the security update of my site had failed because of this module so I uninstalled it.

However, for this last security update of my site, I have again received a failure notification because of this module. Since then, I haven’t been able to log in so I can’t operate on my website.:

Is there something I can do without being able to access my website and try to fix this?
Thank you in advance,

Hi Ana,

I believe the fact that you used “contact_storage” in the past has persisted the problem in the database.

Notice the mention of a route at the top of the error message:

    Symfony\Component\Routing\Exception\InvalidParameterException: Parameter "contact_form" for route "entity.contact_form.edit_form" must match "[^/]++" ("" given) to generate a corresponding URL. in Drupal\Core\Routing\UrlGenerator->doGenerate() (line 204 of core/lib/Drupal/Core/Routing/UrlGenerator.php).

    Drupal\Core\Routing\UrlGenerator->getInternalPathFromRoute('entity.contact_form.edit_form', Object, Array) (Line: 133)
    Drupal\Core\Routing\UrlGenerator->getPathFromRoute('entity.contact_form.edit_form', Array) (Line: 68)
    Drupal\Core\Render\MetadataBubblingUrlGenerator->getPathFromRoute('entity.contact_form.edit_form', Array) (Line: 799)
    Drupal\Core\Url->getInternalPath() (Line: 136)

From the displayed error message I can tell you where this route “entity.contact_form.edit_form” is mentioned in the Drupal code:

    [drupal-code]$ grep -rne 'entity.contact_form.edit_form'
    core/modules/contact/contact.links.task.yml:3:  route_name: entity.contact_form.edit_form
    core/modules/contact/contact.links.task.yml:4:  base_route: entity.contact_form.edit_form
    core/modules/contact/src/Entity/Message.php:39: *   field_ui_base_route = "entity.contact_form.edit_form",
    core/modules/contact/tests/src/Functional/ContactSitewideTest.php:120:      ':href' => Url::fromRoute('entity.contact_form.edit_form', ['contact_form' => 'personal'])->toString(),

What I would do from this point on is to try and understand where in the database the route is mentioned and maybe edit the parameter “contact_form” if such a field exists.

This is a very dangerous action. You are never supposed to touch the application’s database directly, but I can’t think of another way forward from the present broken state.

I would do the following in your case:

  1. Clone to my dev site so I can experiment without breaking further the live site
  2. Understand how routes are modelled in the DB
  3. Experiment with changes
  4. If I fix the problem, verify that I didn’t break anything else
  5. Perform the same change on the live site

Hi @kosamara,

I think this would be possible to fix via Drush, by maybe deleting this configuration completely. At least I would try this before going commando on the DB :sweat_smile:

I guess @asujaluc you could clone your broken site into a new test one, then follow the instructions to run Drush on it and trying to delete the offending configuration (entity.contact_form.edit_form).

Here’s some info about such Drush command, if you feel adventurous: https://drushcommands.com/drush-8x/config/config-delete/

And you would normally use Docker to be able to run Drush on your test site, via an image provided by our Drupal Infra overlords (:stuck_out_tongue_winking_eye:). Instructions can be found under <your-test-site>.web.cern.ch/_site/drush.php.

Let me know if you get stuck!


That would be wonderful! :smiley:
Do you see the relevant configuration though? In my basic investigation I couldn’t identify any relevant configuration that has to do either with “route”, “entity” or “contact”.
entity.contact_form.edit_form or anything similar for example doesn’t appear on drush config-list.

Note that the error message refers to this as a “route”. I don’t know Drupal’s internals well enough to understand the meaning of “route” though. @ogomezal do you have any hint?

You are right, this route seems a Drupal core thing. I don’t know how this module could mess up so badly…

Well, I googled a bit and couldn’t find anything specific related to Contact Storage which is the module we suspect is causing the issue, so I suggest trying this generic ‘reinstall module, then uninstall again’ approach: https://www.drupal.org/project/contact_storage/issues/3028830

In any case a clone of the site to a test one is needed so we can use Drush, since the site is now unusable.