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

Internal error: Internal error: Undefined constant "..." in file #7363

Closed
sbuerk opened this issue May 31, 2022 · 4 comments
Closed

Internal error: Internal error: Undefined constant "..." in file #7363

sbuerk opened this issue May 31, 2022 · 4 comments

Comments

@sbuerk
Copy link

sbuerk commented May 31, 2022

Bug report

The nightly ci tests suddenely failing with an internal error,which can be seen here https://github.com/TYPO3/styleguide/runs/6664994203?check_suite_focus=true.

The stated file do not use a constant 'LF' at all (also TYPO3 Core may define them), see: https://github.com/TYPO3/styleguide/blob/main/Classes/Controller/BackendController.php

Cannot see what the issue is and how to fix it, and why it suddenly occured.

PHP 8.1.6 (cli) (built: May 13 2022 22:48:40) (NTS)
 -- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
     Error                                                                                                                                                                          
 -- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
     Internal error: Internal error: Undefined constant "TYPO3\CMS\Core\Page\LF" in file /var/www/work/typo3-play/sbuerk-forks/styleguide/Classes/Controller/BackendController.php  
     Run PHPStan with -v option and post the stack trace to:                                                                                                                        
     https://github.com/phpstan/phpstan/issues/new?template=Bug_report.md                                                                                                           
     Child process error (exit code 1):                                                                                                                                             
 -- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Code snippet that reproduces the problem

Not sure how to reproduce it otherwise. Code does not use a constant with LF.
https://github.com/TYPO3/styleguide/blob/main/Classes/Controller/BackendController.php

Expected output

Tests not failing. (Or a proper stating error message)

Stack Trace

PHP 8.1.6 (cli) (built: May 13 2022 22:48:40) (NTS)
 -- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
     Error                                                                                                                                                                                                                                                                                        
 -- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
     Internal error: Internal error: Undefined constant "TYPO3\CMS\Core\Page\LF" in file /var/www/work/typo3-play/sbuerk-forks/styleguide/Classes/Controller/BackendController.php                                                                                                                
                                                                                                                                                                                                                                                                                                  
     Post the following stack trace to https://github.com/phpstan/phpstan/issues/new?template=Bug_report.md:                                                                                                                                                                                      
     #0 phar:///var/www/work/typo3-play/sbuerk-forks/styleguide/.Build/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/SourceLocator/SourceStubber/ReflectionSourceStubber.php(294): ReflectionClass->getDefaultProperties()                                        
     #1 phar:///var/www/work/typo3-play/sbuerk-forks/styleguide/.Build/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/SourceLocator/SourceStubber/ReflectionSourceStubber.php(97):                                                                                 
     PHPStan\BetterReflection\SourceLocator\SourceStubber\ReflectionSourceStubber->addProperties()                                                                                                                                                                                                
     #2 phar:///var/www/work/typo3-play/sbuerk-forks/styleguide/.Build/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/BetterReflection/SourceLocator/ReflectionClassSourceLocator.php(37): PHPStan\BetterReflection\SourceLocator\SourceStubber\ReflectionSourceStubber->generateClassStub()  
     #3 phar:///var/www/work/typo3-play/sbuerk-forks/styleguide/.Build/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/BetterReflection/SourceLocator/AutoloadFunctionsSourceLocator.php(37):                                                                                                  
     PHPStan\Reflection\BetterReflection\SourceLocator\ReflectionClassSourceLocator->locateIdentifier()                                                                                                                                                                                           
     #4 phar:///var/www/work/typo3-play/sbuerk-forks/styleguide/.Build/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/SourceLocator/Type/AggregateSourceLocator.php(28):                                                                                           
     PHPStan\Reflection\BetterReflection\SourceLocator\AutoloadFunctionsSourceLocator->locateIdentifier()                                                                                                                                                                                         
     #5 phar:///var/www/work/typo3-play/sbuerk-forks/styleguide/.Build/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/SourceLocator/Type/MemoizingSourceLocator.php(33): PHPStan\BetterReflection\SourceLocator\Type\AggregateSourceLocator->locateIdentifier()    
     #6 phar:///var/www/work/typo3-play/sbuerk-forks/styleguide/.Build/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflector/DefaultReflector.php(32): PHPStan\BetterReflection\SourceLocator\Type\MemoizingSourceLocator->locateIdentifier()                   
     #7 phar:///var/www/work/typo3-play/sbuerk-forks/styleguide/.Build/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/BetterReflection/Reflector/MemoizingReflector.php(45): PHPStan\BetterReflection\Reflector\DefaultReflector->reflectClass()                                              
     #8 phar:///var/www/work/typo3-play/sbuerk-forks/styleguide/.Build/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/BetterReflection/BetterReflectionProvider.php(152): PHPStan\Reflection\BetterReflection\Reflector\MemoizingReflector->reflectClass()                                    
     #9 phar:///var/www/work/typo3-play/sbuerk-forks/styleguide/.Build/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/ReflectionProvider/MemoizingReflectionProvider.php(35): PHPStan\Reflection\BetterReflection\BetterReflectionProvider->hasClass()                                        
     #10 phar:///var/www/work/typo3-play/sbuerk-forks/styleguide/.Build/vendor/phpstan/phpstan/phpstan.phar/src/Rules/ClassCaseSensitivityCheck.php(34): PHPStan\Reflection\ReflectionProvider\MemoizingReflectionProvider->hasClass()                                                            
     #11 phar:///var/www/work/typo3-play/sbuerk-forks/styleguide/.Build/vendor/phpstan/phpstan/phpstan.phar/src/Rules/Namespaces/ExistingNamesInUseRule.php(107): PHPStan\Rules\ClassCaseSensitivityCheck->checkClassNames()                                                                      
     #12 phar:///var/www/work/typo3-play/sbuerk-forks/styleguide/.Build/vendor/phpstan/phpstan/phpstan.phar/src/Rules/Namespaces/ExistingNamesInUseRule.php(61): PHPStan\Rules\Namespaces\ExistingNamesInUseRule->checkClasses()                                                                  
     #13 phar:///var/www/work/typo3-play/sbuerk-forks/styleguide/.Build/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/FileAnalyser.php(102): PHPStan\Rules\Namespaces\ExistingNamesInUseRule->processNode()                                                                                    
     #14 phar:///var/www/work/typo3-play/sbuerk-forks/styleguide/.Build/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(380): PHPStan\Analyser\FileAnalyser->PHPStan\Analyser\{closure}()                                                                                  
     #15 phar:///var/www/work/typo3-play/sbuerk-forks/styleguide/.Build/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(325): PHPStan\Analyser\NodeScopeResolver->processStmtNode()                                                                                        
     #16 phar:///var/www/work/typo3-play/sbuerk-forks/styleguide/.Build/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(525): PHPStan\Analyser\NodeScopeResolver->processStmtNodes()                                                                                       
     #17 phar:///var/www/work/typo3-play/sbuerk-forks/styleguide/.Build/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(296): PHPStan\Analyser\NodeScopeResolver->processStmtNode()                                                                                        
     #18 phar:///var/www/work/typo3-play/sbuerk-forks/styleguide/.Build/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/FileAnalyser.php(189): PHPStan\Analyser\NodeScopeResolver->processNodes()                                                                                                
     #19 phar:///var/www/work/typo3-play/sbuerk-forks/styleguide/.Build/vendor/phpstan/phpstan/phpstan.phar/src/Command/WorkerCommand.php(143): PHPStan\Analyser\FileAnalyser->analyseFile()                                                                                                      
     #20 phar:///var/www/work/typo3-play/sbuerk-forks/styleguide/.Build/vendor/phpstan/phpstan/phpstan.phar/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(97): PHPStan\Command\WorkerCommand->PHPStan\Command\{closure}()                                                        
     #21 phar:///var/www/work/typo3-play/sbuerk-forks/styleguide/.Build/vendor/phpstan/phpstan/phpstan.phar/vendor/clue/ndjson-react/src/Decoder.php(110): _PHPStan_9df114220\Evenement\EventEmitter->emit()                                                                                      
     #22 phar:///var/www/work/typo3-play/sbuerk-forks/styleguide/.Build/vendor/phpstan/phpstan/phpstan.phar/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(97): _PHPStan_9df114220\Clue\React\NDJson\Decoder->handleData()                                                        
     #23 phar:///var/www/work/typo3-play/sbuerk-forks/styleguide/.Build/vendor/phpstan/phpstan/phpstan.phar/vendor/react/stream/src/Util.php(62): _PHPStan_9df114220\Evenement\EventEmitter->emit()                                                                                               
     #24 phar:///var/www/work/typo3-play/sbuerk-forks/styleguide/.Build/vendor/phpstan/phpstan/phpstan.phar/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(97): _PHPStan_9df114220\React\Stream\Util::_PHPStan_9df114220\React\Stream\{closure}()                                 
     #25 phar:///var/www/work/typo3-play/sbuerk-forks/styleguide/.Build/vendor/phpstan/phpstan/phpstan.phar/vendor/react/stream/src/DuplexResourceStream.php(154): _PHPStan_9df114220\Evenement\EventEmitter->emit()                                                                              
     #26 phar:///var/www/work/typo3-play/sbuerk-forks/styleguide/.Build/vendor/phpstan/phpstan/phpstan.phar/vendor/react/event-loop/src/StreamSelectLoop.php(201): _PHPStan_9df114220\React\Stream\DuplexResourceStream->handleData()                                                             
     #27 phar:///var/www/work/typo3-play/sbuerk-forks/styleguide/.Build/vendor/phpstan/phpstan/phpstan.phar/vendor/react/event-loop/src/StreamSelectLoop.php(173): _PHPStan_9df114220\React\EventLoop\StreamSelectLoop->waitForStreamActivity()                                                   
     #28 phar:///var/www/work/typo3-play/sbuerk-forks/styleguide/.Build/vendor/phpstan/phpstan/phpstan.phar/src/Command/WorkerCommand.php(106): _PHPStan_9df114220\React\EventLoop\StreamSelectLoop->run()                                                                                        
     #29 phar:///var/www/work/typo3-play/sbuerk-forks/styleguide/.Build/vendor/phpstan/phpstan/phpstan.phar/vendor/symfony/console/Command/Command.php(259): PHPStan\Command\WorkerCommand->execute()                                                                                             
     #30 phar:///var/www/work/typo3-play/sbuerk-forks/styleguide/.Build/vendor/phpstan/phpstan/phpstan.phar/vendor/symfony/console/Application.php(856): _PHPStan_9df114220\Symfony\Component\Console\Command\Command->run()                                                                      
     #31 phar:///var/www/work/typo3-play/sbuerk-forks/styleguide/.Build/vendor/phpstan/phpstan/phpstan.phar/vendor/symfony/console/Application.php(259): _PHPStan_9df114220\Symfony\Component\Console\Application->doRunCommand()                                                                 
     #32 phar:///var/www/work/typo3-play/sbuerk-forks/styleguide/.Build/vendor/phpstan/phpstan/phpstan.phar/vendor/symfony/console/Application.php(157): _PHPStan_9df114220\Symfony\Component\Console\Application->doRun()                                                                        
     #33 phar:///var/www/work/typo3-play/sbuerk-forks/styleguide/.Build/vendor/phpstan/phpstan/phpstan.phar/bin/phpstan(120): _PHPStan_9df114220\Symfony\Component\Console\Application->run()                                                                                                     
     #34 phar:///var/www/work/typo3-play/sbuerk-forks/styleguide/.Build/vendor/phpstan/phpstan/phpstan.phar/bin/phpstan(121): _PHPStan_9df114220\{closure}()                                                                                                                                      
     #35 /var/www/work/typo3-play/sbuerk-forks/styleguide/.Build/vendor/phpstan/phpstan/phpstan(8): require('...')                                                                                                                                                                                
     #36 /var/www/work/typo3-play/sbuerk-forks/styleguide/.Build/bin/phpstan(117): include('...')                                                                                                                                                                                                 
     #37 {main}                                                                                                                                                                                                                                                                                   
     Child process error (exit code 1):                                                                                                                                                                                                                                                           
 -- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
@mergeable
Copy link

mergeable bot commented May 31, 2022

This bug report is missing a link to reproduction at phpstan.org/try.

It will most likely be closed after manual review.

@ondrejmirtes
Copy link
Member

I believe this is gonna fix it: phpstan/phpstan-src#1373

Please test PHPStan 1.7.7 once I release it later today.

@sbuerk
Copy link
Author

sbuerk commented May 31, 2022

Thanks for this fix. We retried the pipeline, and is green again with 1.7.7.
https://github.com/TYPO3/styleguide/runs/6672444130?check_suite_focus=true

@github-actions
Copy link

github-actions bot commented Jul 2, 2022

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 Jul 2, 2022
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

2 participants