Problem/Motivation

After importing some BOMN.IO models via /admin/config/workflow/eca/import, the follwing error occurs:

The website encountered an unexpected error. Please try again later.
Error: Class "Symfony\Component\Filesystem\Filesystem" not found in Drupal\eca_ui\Form\Import->submitForm() (line 365 of modules/contrib/eca/modules/ui/src/Form/Import.php).

Drupal\eca_ui\Form\Import->submitForm(Array, Object)
call_user_func_array(Array, Array) (Line: 114)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 52)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 592)
Drupal\Core\Form\FormBuilder->processForm('eca_import', Array, Object) (Line: 320)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 564)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 158)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 709)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

However, imported model was imported and works.

Steps to reproduce

  1. Go to https://ecaguide.org/library/test%20models/views/ and download the example model or create a dummy model and export this one and delete it (to be able to reimport).
  2. Import the downloaded file via /admin/config/workflow/eca/import
  3. Error occurs

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork eca-3305587

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

marco.b created an issue. See original summary.

marco.b’s picture

Issue summary: View changes
jurgenhaas’s picture

Unfortunately, I can't reproduce this error.

It appears, that your Drupal site can't find the class Symfony\Component\Filesystem\Filesystem but that should always be there, as Drupal core requires symfony/routing which in itself requires symfony/filesystem.

@marco.b can you provide some more details about the versions (Drupal, PHP, etc.) you're using and how you've installed your Drupal site in the first place?

marco.b’s picture

My system runs at Drupal Version 9.4.5, PHP-Version 8.0.20, Memory limit 512M.

I installed it via composer command
`composer create-project drupal/recommended-project mynewproject --no-interaction`.

jurgenhaas’s picture

That should be exactly what's needed.

What output do you get with composer show symfony/filesystem?

marco.b’s picture

My composer show symfony/filesystem output:

name     : symfony/filesystem
descrip. : Provides basic utilities for the filesystem
keywords : 
versions : * v5.4.11
type     : library
license  : MIT License (MIT) (OSI approved) https://spdx.org/licenses/MIT.html#licenseText
homepage : https://symfony.com
source   : [git] https://github.com/symfony/filesystem.git 6699fb0228d1bc35b12aed6dd5e7455457609ddd
dist     : [zip] https://api.github.com/repos/symfony/filesystem/zipball/6699fb0228d1bc35b12aed6dd5e7455457609ddd 6699fb0228d1bc35b12aed6dd5e7455457609ddd
path     : /www/htdocs/xxxxx/yyyyy.tld/dev/vendor/symfony/filesystem
names    : symfony/filesystem

support
source : https://github.com/symfony/filesystem/tree/v5.4.11

autoload
psr-4
Symfony\Component\Filesystem\ => .
exclude-from-classmap

requires
php >=7.2.5
symfony/polyfill-ctype ~1.8
symfony/polyfill-mbstring ~1.8
symfony/polyfill-php80 ^1.16
jurgenhaas’s picture

That's exactly what I get too. TBH, I have no idea why your Drupal installation then can't find the class Symfony\Component\Filesystem\Filesystem. And that's what the error message above is all about. So, it's hard to help with this. I would probably delete the vendor directory and call composer update, that will rebuild all the dependencies and I can't see why that shouldn't work then.

marco.b’s picture

I just deleted the vendor directory and called composer update so it has been recreated but the error is still happening.

mxh’s picture

Title: unexpected error after model import » Model import gives Error: Class "Symfony\Component\Filesystem\Filesystem" not found
Version: 1.0.1 » 1.1.x-dev
Issue tags: +backport

We need more details about your installation and setup. Example info that may be useful here:

  • Hosting: Name of provider, operating system, number of web servers being used, file system being used. Are you reproducing this error only on a certain hosting instance, or also on other environments e.g. locally?
  • Installation: Are you using a certain Drupal installation profile? What other modules are you using
marco.b’s picture

Issue summary: View changes
marco.b’s picture

Issue summary: View changes
marco.b’s picture

FileSize
2.53 MB

The error occured on two instances on separate webservers of provider all-inkl.com (shared hosting accounts).

operating system: Linux dd14330 5.4.0-113-generic - more infos see attached phpinfo as PDF.

I don't use any special Drupal installation profile. The Modules list differ between the affected systems.

jurgenhaas’s picture

Status: Active » Needs review

I have no idea whatsoever, what's going on here. Can't find any logical explanation.

However, I've found an issue in the submit handler where we've instantiated a new Filesystem object instead of using the available service. I've corrected that, and that makes that use-statement obsolete which caused the exception.

@marco.b please give it a try if that solves it at your end, because here we can't reproduce the problem.

rkoller’s picture

i've tested to import the example model with the latest eca 1.1.x-dev version. i dont get the exact same error @marco.b got. but i get the following error admin notice on the models list page:

The import failed due to the following reason: There were errors validating the config synchronization. Configuration <em class="placeholder">eca.eca.process_z6jzc9k</em> depends on the <em class="placeholder">views.view.</em> configuration that will not exist after import. Configuration <em class="placeholder">eca.eca.process_z6jzc9k</em> depends on the <em class="placeholder">views.view.</em> configuration that will not exist after import.

jurgenhaas’s picture

@rkoller that is something different. You should open a new issue for that and then also upload the ECA model process_z6jzc9k so that we can analyse.

marco.b’s picture

> @marco.b please give it a try if that solves it at your end, because here we can't reproduce the problem. (merge request !217)

sorry i don't get along well with git merge, can't test this. I can do a patch (.diff) if you have one.

jurgenhaas’s picture

FileSize
41.29 KB

Hi @marco.b there is a link to the patch available, see at the red arrow:

marco.b’s picture

After applying the patch the import works without error.

jurgenhaas’s picture

Status: Needs review » Reviewed & tested by the community

Oh, that's good news. Thanks @marco.b for your feedback.

  • jurgenhaas committed 1538b9c on 1.1.x
    Issue #3305587 by jurgenhaas, marco.b: Model import gives Error: Class "...

  • jurgenhaas committed f0ef977 on 1.0.x
    Issue #3305587 by jurgenhaas, marco.b: Model import gives Error: Class "...
jurgenhaas’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 1.1.x and back-ported to 1.0.x

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.