Updated Drupal core and modules today. Checked Status Report and came across the error:

"Mismatched entity and/or field definitions" on File 'type' field: The File type field needs to be installed...

Eventually fixed the issue by updating the module to the 8.x-2.x-dev version and following various steps in the issue described at https://www.drupal.org/node/2758043

Now when I visit /admin/content/ I get a WSOD, and I'm getting the following message in the error log:

AH01071: Got error 'PHP message: Uncaught PHP Exception Symfony\\Component\\Routing\\Exception\\RouteNotFoundException: "Route "entity.file.collection" does not exist." at /core/lib/Drupal/Core/Routing/RouteProvider.php line 190\n'

Google didn't reveal any exact matches for this error. Searching the codebase for "entity.file.collection" found matches in 3 files, all belonging to the file_entity module, so I assume the problem exists with this module.

Please excuse me, I'm a Drupal veteran, but very new to D8.

CommentFileSizeAuthor
#20 entity.file_.collection.patch519 bytesmahmoud helmy

Comments

scott.whittaker created an issue. See original summary.

scott.whittaker’s picture

Issue summary: View changes
scott.whittaker’s picture

Just dropping a note that I rolled the database back and re-applied the updates and it's all working again except the original issue #2758043 which still applies. It seems fixing that issue causes this one, and that one seems the lesser of two evils since I haven't noticed any actual consequences of that issue... yet.

scott.whittaker’s picture

scott.whittaker’s picture

Status: Active » Closed (works as designed)

Figured out a way around the other issue (not uninstalling and reinstalling, but running "drush entity-updates"), everything works now.

mikeohara’s picture

Status: Closed (works as designed) » Needs work

Bumping this as I am experiencing this myself. When installing this module using a config import, the route is never created. The only way to create it is to completely disable the module and re-install. IF we don't enable the module (via a config import) automatically and then manually enable it later, the route IS created.

This occurs in D 8.3.2

Anyone else see this?

falco010’s picture

Priority: Normal » Major

Having the same issue and none of the above worked for me!

Changing status to major because we cannot deploy with the current dev & new beta4 release because of this.
Also /admin/content is not reachable anymore.

mikeohara’s picture

So, In an investigation, we figured out that a view was not getting properly enabled on an automated module enable.

We fixed it, by manually enabling the module in a clean environment, then enabling and exporting the config that includes the view called "files_entity_files" and including it in our site config that gets imported on deployment.

That seemed to fix it for us.

falco010’s picture

@mikeohara Thank you, this solved my error.
Exported the views.view.file_entity_files.yml config and put it in my deployment as you said.

UPDATE:
This is not a good solution, currently have double 'Files' tabs and I cannot add a file via the admin interface anymore, due to deleted config that File Entity did.

I am currently going to enable it manually as temporary fix. But every deploy I need to enable it again.

File Entity is just not compatible with Config Manager at this moment and this should be fixed as soon as possible

mikeohara’s picture

Yeah it's not an amazing solution, it got us past a blocker and worked for what we needed at that time. YMMV.

You will also need to deal with if you export config related to your media stuff that depends on the module being enabled and your config does not enable it, you will run into deployment failures when it trys to validate.

We need a true fix, for sure.

falco010’s picture

Title: RouteNotFoundException: Route "entity.file.collection" does not exist. » File entity is not compatible with Configuration Management
idebr’s picture

Status: Needs work » Active

Updating the issue status to 'Active', since it does not contain a patch file.

ocastle’s picture

I also get the same issue. +1

joseph.olstad’s picture

A reminder that if possible you should be switching to since core 8.4.x media entity as D8 now has something superior in core.
however I will continue to review patches if someone pushes up one.

bob.hinrichs’s picture

Also frustrated with this apparently 2-year-old (?) issue today (is it really still?). Running 8.x-2.0-beta7 on Drupal 8.7.8.

joseph.olstad’s picture

If you are using D8 file_entity you should consider looking at this module and the D8 documentation.

if you have not used file_entity in D8, you should use the core media module instead (provided with core, not to be confused with the 'media' project for D7 (the D8 version again was taken over by core so please use the D8 core module not the contrib module)).

This information is clearly stated on the file_entity project page.

With that said, we are still accepting patches for this issue, if someone pushes up a patch for this I will review it. Otherwise check the first two paragraphs in this comment.

brunapimenta’s picture

FYI

I faced the second error message ("Route "entity.file.collection" does not exist.") trying to enable it in existing site using Drupal 8.8.6 core.

And what I figured out is it happened when the module has some problem during its installation. In my case, somehow, I had already the config "core.entity_view_mode.file.thumbnail" imported in my database. Then, when I deleted it before installing, everything worked fine and the error had gone away.

davidsheart02’s picture

I just got this error as well. Looks like there's no route provided for entity.file.collection in the file_entity.routing.yml file. I commented out the section in the file_entity.links.task.yml file to bypass the error on the admin/content screen since I am not sure what the entity.file.collection route is really supposed to do. The true fix for this issue would be for someone to add the route to file_entity.routing.yml.

mahmoud helmy’s picture

StatusFileSize
new519 bytes

There is problem in file_entity.tasks.link.yml that entity.file.collection route is not exist so Remove it from file and work for me.

magendiran’s picture

Thanks @Mahmoud Helmy,

Your #20 patch works for me, Along with I modified the content of the web/modules/contrib/file_entity/file_entity.install file.

Comment the following lines (113-114):

$definition = $update_manager->getFieldStorageDefinition('type', 'file');
$update_manager->uninstallFieldStorageDefinition($definition);

and uninstall the module.

rsbecker’s picture

Following this thread I finally was able to uninstall file_entity, which I only installed on a new D9 site because it was installed on the D7 site from which I migrate. But even after manually removing all entries in the config and key_values table for field_file, on the System Status report I am still getting an error -- "The node.field_file field needs to be uninstalled." I've run cr and updated the database, but no joy.

Any suggestions about where to look for a fix?