Bug #76457

Could not scan for classes inside "..." which does not appear to be a file nor a folder

Added by Saskia B about 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2016-06-05
Due date:
% Done:

0%

TYPO3 Version:
7
PHP Version:
5.6
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Hello,

Typo3 does show the following message every time I try to install or update an extension, but the extension is still updated or installed.
Could not scan for classes inside "/.../htdocs/me/typo3conf/ext/<extname>/htdocs/typo3conf/ext/<extname>/Classes/" which does not appear to be a file nor a folder

I guess the issue is due to the doubled folder path (/htdocs/me/typo3conf/ext/.../htdocs/typo3conf/...)

Best regards,

Saskia

History

#1 Updated by Nicole Cordes about 3 years ago

  • Category deleted (Extension Manager)

The issue has nothing to do with the Extension Manager. It is an error that is thrown from the ClassMapGenerator during gathering the class loading information.

#2 Updated by Nicole Cordes about 3 years ago

  • Status changed from New to Needs Feedback

Dear Saskia,

Can you tell us which extension are affected? Can you please have a look in your PackageStates.php and check the 'packagePath' for those extensions. Thank you very much.

#3 Updated by Tobias Gülzow almost 3 years ago

Hi everyone.

I might shed some light on this one:
When you point the composer to some none existing directory or files, it "breaks" the ClassMapGenerator.

Just add something like this:

  "autoload": {
    "psr-4": {
      "Whatever\\Break\\": "Classes" 
    },
    "files": ["somedir/somefile.php"]
  }

to your composer.json. The file and directory does not exist.

As far as I can see, is the mainproblem here, that it stops the ClassMapGenerator in it's tracks. New extensions can not be installed afterwards without a fatal.
Tested with TYPO3 7.6.10

How to reproduce:
1.) Create an extension with wrong autoloader configuration.
2.) Install something new from the TER
3.) Get a "class not found" fatal, because the ClassMapGenerator could not reach the new installed extension.

Hope this helps.

Tobi

#4 Updated by Nicole Cordes almost 3 years ago

Hi Tobi,

thanks for your answer. But referring to a non-existing path in your composer.json is breaking in every way because not only the ClassMapGenerator will throw an error, but composer itself will fail with installation.

If the problem only occurs with invalid paths this is not a core issue at all.

#5 Updated by Tobias Gülzow almost 3 years ago

Hi Nicole.

The installation of the faulty extension actually works, but composer class map will crash with a handled TYPO3 warning.

If the problem only occurs with invalid paths this is not a core issue at all.

That is how I see it, too. Although I have not tested, what happens if I disable all error handling. If disabling the error handler works, the core might be able to work around this issue.

Edit: Disabling error handling does not work, because a \RuntimeException is explicitly thrown, halting the code.

Tobi

#6 Updated by Tobias Pinnekamp almost 3 years ago

I can report a similar behavior.

Just update my local installation with composer update which jumped from 7.6.9 to 7.6.11 and at the end of the process I get the following error message

[RuntimeException]
Could not scan for classes inside "web/typo3/sysext/extbase/Tests/Unit/Object/Container/Fixtures/" which does not appear to be a file nor a folder

The same I get with composer dump-autoload.

The problem may be the composer.json of extbase which contains

"autoload-dev": {
    "psr-4": {
        "TYPO3\\CMS\\Extbase\\Tests\\": "Tests/" 
    },
    "classmap": ["Tests/Unit/Object/Container/Fixtures/"]
}

but doesn't contain any Test folder.

As a result the system doesn't run properly.

#7 Updated by Wouter Wolters almost 3 years ago

Do you need these fixture files? If not please remove the autoload-dev information from your root composer file.

#8 Updated by Tobias Pinnekamp almost 3 years ago

Ah, perfect. Good to know. Works perfectly now. Thank you very much for that fast hint.

#9 Updated by Alex no-lastname-given almost 3 years ago

Just trying to install extension PerfectLightBox 4.0.2 on Typo3 7.6.11. It says:

Could not scan for classes inside "D:/wamp/www/typo3conf/ext/perfectlightbox/Classes/" which does not appear to be a file nor a folder

After manual creating of "Classes" folder the problem is gone.

#10 Updated by Nicole Cordes almost 3 years ago

Hi Alex!

The problem with perfectlightbox in version 4.0.2 is, that is hasn't any Classes folder but specifies this one in its composer autoload information. This is no core but an extension bug and has to be resolved in there.

#11 Updated by Nicole Cordes almost 3 years ago

  • Status changed from Needs Feedback to Closed

I'm closing this issue now as it cannot be reproduced with valid paths and extensions.

Also available in: Atom PDF