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

PHP fatal error if the requested vocabulary id is not found #1170

Closed
kouralex opened this issue May 28, 2021 · 3 comments · Fixed by #1231
Closed

PHP fatal error if the requested vocabulary id is not found #1170

kouralex opened this issue May 28, 2021 · 3 comments · Fixed by #1231
Assignees
Labels
Milestone

Comments

@kouralex
Copy link
Contributor

Whilst looking at apache2 error log, I noticed that Skosmos throws uncaught PHP fatal errors if the requested vocabulary id is not found. See the following call stack:

Stack trace:
#0 model/Request.php(246): Model->getVocabulary('xyz')
#1 index.php(51): Request->setVocab('xyz')
#2 {main}
thrown in model/Model.php on line 420

These should be caught and handled appropriately.

@kouralex kouralex added bug size-small max 2 hours labels May 28, 2021
@kouralex kouralex added this to the Next Tasks milestone May 28, 2021
@hekl
Copy link

hekl commented Jul 27, 2021

I have something like this, these errors are thrown almost every minute. Sometimes with the last referer statement, mostly not. Everything seems fine, except that the loading of the last section of equivalent concepts seems to stall. Watch it: https://classificaties.cbs.nl/geo/def/gemeenten/GM0359

PHP Fatal error: Uncaught Error: Class 'ValueError' not found in /var/www/Skosmos/model/Model.php:420\nStack trace:\n#0 /var/www/Skosmos/model/Request.php(246): Model->getVocabulary()\n#1 /var/www/Skosmos/index.php(51): Request->setVocab()\n#2 {main}\n thrown in /var/www/Skosmos/model/Model.php on line 420, referer: http://classificaties.cbs.nl/sess-bin/login_session.cgi

@osma
Copy link
Member

osma commented Sep 9, 2021

@hekl It seems that your PHP installation doesn't know about the ValueError class that is used in some parts of Skosmos code since PR #1127 which, among other things, upgraded PHPUnit to version 8. I started investigating why this could happen, and it turns out ValueError was only introduced in PHP 8. But it is also defined by symfony/polyfill-php80 which Skosmos depends on indirectly through twig-gettext-extractor -- but only if development dependencies are installed! So that explains why you are getting this error (you've used composer install --no-dev as instructed in the InstallTutorial) while Skosmos developers usually have the development dependencies, obviously :)

I will open a separate bug report about this "missing ValueError" problem.

@osma
Copy link
Member

osma commented Nov 2, 2021

This was mostly fixed in PR #1215 (and the separate but similar problem with the ValueError class, encountered by @hekl, was fixed in PR #1200).

However, looking at Finto server logs, there are still problems in the REST API; uncaught ValueErrors appear for REST API calls with an unknown vocabulary ID.

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

Successfully merging a pull request may close this issue.

3 participants