Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ParallelAnalyser: Some jobs remaining #3910

Closed
staabm opened this issue Oct 2, 2020 · 8 comments
Closed

ParallelAnalyser: Some jobs remaining #3910

staabm opened this issue Oct 2, 2020 · 8 comments

Comments

@staabm
Copy link
Contributor

staabm commented Oct 2, 2020

we updated to the 0.12.48 and since then get in some projects a error:

In ParallelAnalyser.php line 153:
                       
  Some jobs remaining  

I guess its related to the latest version. but it does not occur on all of our projects, just a single one.

@canvural
Copy link
Contributor

canvural commented Oct 2, 2020

This usually means some errors occurred. If you run with --debug you should be able to see what is the actual error.

@ondrejmirtes
Copy link
Member

Yeah, there’s gonna be some error. I’ll make sure the actual error is captured and printed.

It’s possible it might show up with —debug, but that disables parallelism so if the problem is related to parallelism, the build might pass.

@staabm
Copy link
Contributor Author

staabm commented Oct 2, 2020

just run the script locally (instead of within a Github action) and phpstan reports the following error now:

Child process error (exit code 255):
     Fatal error: During class fetch: Uncaught PHPStan\Broker\ClassAutoloadingException: Class
     Application_Trait_ShopTrait not found. in
     phar://C:/Users/mstaab/Documents/GitHub/daiber/vendor-bin/phpstan/vendor/phpstan/phpstan/phpstan/src/Reflection/R
     untime/RuntimeReflectionProvider.php:125
     Stack trace:
     #0 [internal function]:
     PHPStan\Reflection\Runtime\RuntimeReflectionProvider->PHPStan\Reflection\Runtime\{closure}('Application_Tra...')
     #1 C:\Users\mstaab\Documents\GitHub\daiber\application\B2B\controllers\StatisticController.php(6):
     spl_autoload_call('Application_Tra...')
     #2 C:\Users\mstaab\Documents\GitHub\daiber\vendor\plugins\rocket\lib\Rocket.php(311):
     require_once('C:\\Users\\mstaab...')
     #3 [internal function]: Rocket::autoload('StatisticContro...')
     #4 [internal function]: spl_autoload_call('StatisticContro...')
     #5
     phar://C:/Users/mstaab/Documents/GitHub/daiber/vendor-bin/phpstan/vendor/phpstan/phpstan/phpstan/src/Reflection/R
     untime/RuntimeReflectionProvider.php(129): class_exists('StatisticContro...')
     #6 phar://C:/Users in C:\Users\mstaab\Documents\GitHub\daiber\application\B2B\controllers\StatisticController.php
     on line 6
     During class fetch: Uncaught PHPStan\Broker\ClassAutoloadingException: Class Application_Trait_ShopTrait not
     found. in
     phar://C:/Users/mstaab/Documents/GitHub/daiber/vendor-bin/phpstan/vendor/phpstan/phpstan/phpstan/src/Reflection/R
     untime/RuntimeReflectionProvider.php:125
     Stack trace:
     #0 [internal function]:
     PHPStan\Reflection\Runtime\RuntimeReflectionProvider->PHPStan\Reflection\Runtime\{closure}('Application_Tra...')
     #1 C:\Users\mstaab\Documents\GitHub\daiber\application\B2B\controllers\StatisticController.php(6):
     spl_autoload_call('Application_Tra...')
     #2 C:\Users\mstaab\Documents\GitHub\daiber\vendor\plugins\rocket\lib\Rocket.php(311):
     require_once('C:\\Users\\mstaab...')
     #3 [internal function]: Rocket::autoload('StatisticContro...')
     #4 [internal function]: spl_autoload_call('StatisticContro...')
     #5
     phar://C:/Users/mstaab/Documents/GitHub/daiber/vendor-bin/phpstan/vendor/phpstan/phpstan/phpstan/src/Reflection/R
     untime/RuntimeReflectionProvider.php(129): class_exists('StatisticContro...')
     #6 phar://C:/Users
     #0 [internal function]: fatal_error_handler()
     #1 {main}

I am wondering that phpstan is not able to find the class, since its stored within one of the a parameters.path defined in my phpstan.neon.dist.

does phpstan expect the classes to have a certain naming convention?

clearing the result cache did not fix the problem

@ondrejmirtes
Copy link
Member

Just made that with the "some jobs remaining" situation you also get the real error mesage causing the situation as well: phpstan/phpstan-src@6c61e49

About Application_Trait_ShopTrait - you need to autoload that. Put it to autoload in composer.json, or in bootstrapFiles in phpstan.neon.

@staabm
Copy link
Contributor Author

staabm commented Oct 2, 2020

About Application_Trait_ShopTrait - you need to autoload that. Put it to autoload in composer.json, or in bootstrapFiles in phpstan.neon.

shouln't it automatically be aware of classes withihn the path property?

it also doesn't find the class when I add it via scanDirectories

@ondrejmirtes
Copy link
Member

The problem is that you're using the trait in a class which you autoload, probably through composer.json, but the used trait isn't autoloaded, leading to this error.

If the root class wasn't autoloaded but it was discovered through analysed paths/scanFiles/scanDirectories then it wouldn't crash like that and you'd be correct.

@staabm
Copy link
Contributor Author

staabm commented Oct 3, 2020

The problem is that you're using the trait in a class which you autoload, probably through composer.json, but the used trait isn't autoloaded, leading to this error.

If the root class wasn't autoloaded but it was discovered through analysed paths/scanFiles/scanDirectories then it wouldn't crash like that and you'd be correct.

Ahh that makes sense. Wdyt about making this more obvious in the exception message?

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants