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

Uncaught InvalidArgumentException: Could not get class storage for dokuwiki_auth_plugin #9258

Closed
kamil-tekiela opened this issue Feb 10, 2023 · 6 comments

Comments

@kamil-tekiela
Copy link
Contributor

I don't know if it can be analyzed from stack trace. I can't run the debugger now but if this is not enough I can debug it later.

Uncaught InvalidArgumentException: Could not get class storage for dokuwiki_auth_plugin in C:\Users\tekie\AppData\Roaming\Composer\vendor\vimeo\psalm\src\Psalm\Internal\Provider\ClassLikeStorageProvider.php:45
Stack trace:
#0 C:\Users\tekie\AppData\Roaming\Composer\vendor\vimeo\psalm\src\Psalm\Internal\Analyzer\ClassAnalyzer.php(783): Psalm\Internal\Provider\ClassLikeStorageProvider->get('DokuWiki_Auth_P...')
#1 C:\Users\tekie\AppData\Roaming\Composer\vendor\vimeo\psalm\src\Psalm\Internal\Analyzer\ClassAnalyzer.php(416): Psalm\Internal\Analyzer\ClassAnalyzer::addContextProperties(Object(Psalm\Internal\Analyzer\ClassAnalyzer), Object(Psalm\Storage\ClassLikeStorage), Object(Psalm\Context), 'testable_auth_p...', 'auth_plugin_aut...', Array)
#2 C:\Users\tekie\AppData\Roaming\Composer\vendor\vimeo\psalm\src\Psalm\Internal\Analyzer\FileAnalyzer.php(203): Psalm\Internal\Analyzer\ClassAnalyzer->analyze(Object(Psalm\Context), Object(Psalm\Context))
#3 C:\Users\tekie\AppData\Roaming\Composer\vendor\vimeo\psalm\src\Psalm\Internal\Codebase\Analyzer.php(1581): Psalm\Internal\Analyzer\FileAnalyzer->analyze()
#4 C:\Users\tekie\AppData\Roaming\Composer\vendor\vimeo\psalm\src\Psalm\Internal\Codebase\Analyzer.php(522): Psalm\Internal\Codebase\Analyzer->analysisWorker(608, 'D:\\projects\\dok...')
#5 C:\Users\tekie\AppData\Roaming\Composer\vendor\vimeo\psalm\src\Psalm\Internal\Codebase\Analyzer.php(272): Psalm\Internal\Codebase\Analyzer->doAnalysis(Object(Psalm\Internal\Analyzer\ProjectAnalyzer), 1)
#6 C:\Users\tekie\AppData\Roaming\Composer\vendor\vimeo\psalm\src\Psalm\Internal\Analyzer\ProjectAnalyzer.php(669): Psalm\Internal\Codebase\Analyzer->analyzeFiles(Object(Psalm\Internal\Analyzer\ProjectAnalyzer), 1, false, true)
#7 C:\Users\tekie\AppData\Roaming\Composer\vendor\vimeo\psalm\src\Psalm\Internal\Cli\Psalm.php(369): Psalm\Internal\Analyzer\ProjectAnalyzer->check('D:\\projects\\dok...', true)
#8 C:\Users\tekie\AppData\Roaming\Composer\vendor\vimeo\psalm\psalm(9): Psalm\Internal\Cli\Psalm::run(Array)
#9 C:\Users\tekie\AppData\Roaming\Composer\vendor\bin\psalm(120): include('C:\\Users\\tekie\\...')
#10 {main}
(Psalm 5.6.0@e784128902dfe01d489c4123d69918a9f3c1eac5 crashed due to an uncaught Throwable)
@psalm-github-bot
Copy link

Hey @kamil-tekiela, can you reproduce the issue on https://psalm.dev ?

@orklah
Copy link
Collaborator

orklah commented Feb 11, 2023

It might be interesting to run with --debug-by-line to make sure Psalm parsed the file that contains the dokuwiki_auth_plugin class. (Also can you make sure it's written with the same case everywhere in your code?)

@kamil-tekiela
Copy link
Contributor Author

kamil-tekiela commented Feb 12, 2023

This was just an example class. It might not have actually been traversed by Psalm, but the issue is that it crashes instead of reporting a missing class.

The same happens with a different project and different class.

Uncaught InvalidArgumentException: Could not get class storage for curlhandle in D:\projects\phpmyadmin\vendor\vimeo\psalm\src\Psalm\Internal\Provider\ClassLikeStorageProvider.php:45

@mhs-ptcs
Copy link

mhs-ptcs commented Aug 29, 2023

We have same problem, class changes so it's not about some file that could be skipped.

"vimeo/psalm": "5.15.0",

Target PHP version: 8.2 (inferred from current PHP version).
Scanning files...

PHP 8.2.9 (cli) (built: Aug 3 2023 11:39:08) (NTS gcc x86_64)

`Uncaught InvalidArgumentException: Could not get class storage for cwebapplication in /app/vendor/vimeo/psalm/src/Psalm/Internal/Provider/ClassLikeStorageProvider.php:45
Stack trace:
#0 /app/vendor/vimeo/psalm/src/Psalm/Storage/ClassLikeStorage.php(504): Psalm\Internal\Provider\ClassLikeStorageProvider->get('CWebApplication')
#1 /app/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/AtomicPropertyFetchAnalyzer.php(1216): Psalm\Storage\ClassLikeStorage->hasAttributeIncludingParents('AllowDynamicPro...', Object(Psalm\Codebase))
#2 /app/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/AtomicPropertyFetchAnalyzer.php(385): Psalm\Internal\Analyzer\Statements\Expression\Fetch\AtomicPropertyFetchAnalyzer::handleNonExistentProperty(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(Psalm\Codebase), Object(PhpParser\Node\Expr\PropertyFetch), Object(Psalm\Context), Object(Psalm\Config), Object(Psalm\Storage\ClassLikeStorage), 'request', Object(Psalm\Type\Atomic\TNamedObject), NULL, 'application\\com...', false, NULL, false, NULL, false)
#3 /app/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/InstancePropertyFetchAnalyzer.php(238): Psalm\Internal\Analyzer\Statements\Expression\Fetch\AtomicPropertyFetchAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\PropertyFetch), Object(Psalm\Context), false, NULL, NULL, Object(Psalm\Type\Union), Object(Psalm\Type\Atomic\TNamedObject), 'request', false, Array, false)
#4 /app/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php(235): Psalm\Internal\Analyzer\Statements\Expression\Fetch\InstancePropertyFetchAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\PropertyFetch), Object(Psalm\Context), false)
#5 /app/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php(90): Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer::handleExpression(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\PropertyFetch), Object(Psalm\Context), false, NULL, false, NULL, false)
#6 /app/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/Expression/Call/MethodCallAnalyzer.php(65): Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\PropertyFetch), Object(Psalm\Context))
#7 /app/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php(177): Psalm\Internal\Analyzer\Statements\Expression\Call\MethodCallAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\MethodCall), Object(Psalm\Context), true, NULL)
#8 /app/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php(90): Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer::handleExpression(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\MethodCall), Object(Psalm\Context), false, NULL, false, NULL, false)
#9 /app/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php(243): Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\MethodCall), Object(Psalm\Context))
#10 /app/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php(527): Psalm\Internal\Analyzer\Statements\Expression\AssignmentAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Variable), Object(PhpParser\Node\Expr\MethodCall), NULL, Object(Psalm\Context), NULL, Array, NULL)
#11 /app/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php(169): Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer::analyzeAssignment(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Assign), Object(Psalm\Context), true)
#12 /app/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php(90): Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer::handleExpression(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Assign), Object(Psalm\Context), false, Object(Psalm\Context), true, NULL, false)
#13 /app/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php(560): Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Assign), Object(Psalm\Context), false, Object(Psalm\Context), true)
#14 /app/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php(194): Psalm\Internal\Analyzer\StatementsAnalyzer::analyzeStatement(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Stmt\Expression), Object(Psalm\Context), Object(Psalm\Context))
#15 /app/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php(471): Psalm\Internal\Analyzer\StatementsAnalyzer->analyze(Array, Object(Psalm\Context), Object(Psalm\Context), true)
#16 /app/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/ClassAnalyzer.php(1802): Psalm\Internal\Analyzer\FunctionLikeAnalyzer->analyze(Object(Psalm\Context), Object(Psalm\Internal\Provider\NodeDataProvider), Object(Psalm\Context))
#17 /app/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/ClassAnalyzer.php(415): Psalm\Internal\Analyzer\ClassAnalyzer->analyzeClassMethod(Object(PhpParser\Node\Stmt\ClassMethod), Object(Psalm\Storage\ClassLikeStorage), Object(Psalm\Internal\Analyzer\ClassAnalyzer), Object(Psalm\Context), Object(Psalm\Context))
#18 /app/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/FileAnalyzer.php(202): Psalm\Internal\Analyzer\ClassAnalyzer->analyze(Object(Psalm\Context), Object(Psalm\Context))
#19 /app/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Analyzer.php(1591): Psalm\Internal\Analyzer\FileAnalyzer->analyze()
#20 /app/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Analyzer.php(522): Psalm\Internal\Codebase\Analyzer->analysisWorker(246, '/app/php/applic...')
#21 /app/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Analyzer.php(272): Psalm\Internal\Codebase\Analyzer->doAnalysis(Object(Psalm\Internal\Analyzer\ProjectAnalyzer), 1)
#22 /app/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/ProjectAnalyzer.php(564): Psalm\Internal\Codebase\Analyzer->analyzeFiles(Object(Psalm\Internal\Analyzer\ProjectAnalyzer), 1, false, true)
#23 /app/vendor/vimeo/psalm/src/Psalm/Internal/Cli/Psalm.php(379): Psalm\Internal\Analyzer\ProjectAnalyzer->check('/app/', false)
#24 /app/vendor/vimeo/psalm/psalm(9): Psalm\Internal\Cli\Psalm::run(Array)
#25 /app/vendor/bin/psalm(120): include('/app/vendor/vim...')
#26 {main}
(Psalm 5.15.0@5c774aca4746caf3d239d9c8cadb9f882ca29352 crashed due to an uncaught Throwable)
`

@weirdan
Copy link
Collaborator

weirdan commented Aug 29, 2023

@mhs-ptcs judging by the backtrace your issue is fixed in #10159

@kamil-tekiela
Copy link
Contributor Author

I believe this issue might have been fixed already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants