Open melroy89 opened 5 days ago
the first: I can't reproduce it the fifth: could be a follow up of the second, but I am not sure the eigth: same as the fourth the eleventh: not my area :sweat_smile:
the eleventh (mbin:cache:build
) did work in the past, right? It's executing the following script: src/Command/ImageCacheCommand.php actually. I really think we forget to update some of those SQL queries in buildEntriesCache
, buildEntryCommentsCache
, buildPostsCache
or something..
I still think we store empty filePaths in the DB.. But this check would prevent errors now: https://github.com/MbinOrg/mbin/pull/1128
the first: I can't reproduce it
Let me try to investigate that one..
ow F*K GitHub replaced the old content.
the first: I can't reproduce it
Let me try to investigate that one..
It seems not fully reproducible always...
However I believe this line 50 is still the issue: https://github.com/MbinOrg/mbin/blob/main/templates/entry/comment/view.html.twig#L50. And I think that this is still (in some very rare cases) resulting into null as input:
comment.root ?? comment
However I believe this line 50 is still the issue: https://github.com/MbinOrg/mbin/blob/main/templates/entry/comment/view.html.twig#L50. And I think that this is still (in some very rare cases) resulting into null as input:
comment.root ?? comment
I also noticed this TODO: https://github.com/MbinOrg/mbin/blob/4d930f6c8cf276bb2ec14ed5e579f4400af4222c/src/Controller/Entry/Comment/EntryCommentViewController.php#L40
This EntryCommentViewController.php
is calling the entry/comment/view.html.twig
with an null comment object.
Also the comment object seems to be an optional parameter: https://github.com/MbinOrg/mbin/blob/4d930f6c8cf276bb2ec14ed5e579f4400af4222c/src/Controller/Entry/Comment/EntryCommentViewController.php#L35
PR created: https://github.com/MbinOrg/mbin/pull/1129
the first: I can't reproduce it
Try to go to a comment from a thread. And click on the date of the comment, so you watch the comment('s thread). Then in the URL remove the comment ID. Which simulate the error 100% for sure.
Regarding 18th: We might need to add more blocked domain checks (isBannedInstance
) where there are getActivityObject
calls. In the following files:
src/MessageHandler/ActivityPub/Inbox/ActivityHandler.php
src/MessageHandler/ActivityPub/Inbox/AddHandler.php
src/Service/ActivityPubManager.php
Describe the bug
I see a long list of errors and warnings in the prod log.
We really need to clean-up some of those and try to fix the PHP warning or PHP or Twig errors we see...
I could make 20+ GitHub Issues out of this single ticket, but that won't help us. And will only cause more overhead. See the list of warnings/errors below under "List of issues".
On which Mbin instance did you find the bug? kbin.melroy.org
Which Mbin version was running on the instance? 1.7.1
To Reproduce Steps to reproduce the behavior:
tail -f var/log/prod-xx-x-x-x.log
Expected behavior
Minimal amount of errors and warnings in the production log. Only some error messages make sense if there is a real error and we still want to keep reporting it to admin of the instance.
Let's just see how much we can resolve in the first 1.7.2 milestone..
List of issues
Directly from the production log output:
I added "feddit.de" to block list (in the admin panel). Why do I still see?
Full stack trace
``` [2024-09-12T20:35:38.330174+02:00] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: ""App\Entity\Entry" object not found by "Symfony\Bridge\Doctrine\ArgumentResolver\EntityValueResolver"." at EntityValueResolver.php line 76 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): \"App\\Entity\\Entry\" object not found by \"Symfony\\Bridge\\Doctrine\\ArgumentResolver\\EntityValueResolver\". at /var/www/kbin.melroy.org/html/vendor/symfony/doctrine-bridge/ArgumentResolver/EntityValueResolver.php:76) [stacktrace] #0 /var/www/kbin.melroy.org/html/vendor/symfony/http-kernel/Controller/ArgumentResolver/TraceableValueResolver.php(37): Symfony\\Bridge\\Doctrine\\ArgumentResolver\\EntityValueResolver->resolve() #1 /var/www/kbin.melroy.org/html/vendor/symfony/http-kernel/Controller/ArgumentResolver.php(90): Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver\\TraceableValueResolver->resolve() #2 /var/www/kbin.melroy.org/html/vendor/symfony/http-kernel/Controller/TraceableArgumentResolver.php(33): Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver->getArguments() #3 /var/www/kbin.melroy.org/html/vendor/symfony/http-kernel/HttpKernel.php(175): Symfony\\Component\\HttpKernel\\Controller\\TraceableArgumentResolver->getArguments() #4 /var/www/kbin.melroy.org/html/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw() #5 /var/www/kbin.melroy.org/html/vendor/symfony/http-kernel/Kernel.php(182): Symfony\\Component\\HttpKernel\\HttpKernel->handle() #6 /var/www/kbin.melroy.org/html/vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php(35): Symfony\\Component\\HttpKernel\\Kernel->handle() #7 /var/www/kbin.melroy.org/html/vendor/autoload_runtime.php(29): Symfony\\Component\\Runtime\\Runner\\Symfony\\HttpKernelRunner->run() #8 /var/www/kbin.melroy.org/html/public/index.php(7): require_once('...') #9 {main} "} [] [2024-09-12T20:35:55.620106+02:00] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: ""App\Entity\Entry" object not found by "Symfony\Bridge\Doctrine\ArgumentResolver\EntityValueResolver"." at EntityValueResolver.php line 76 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): \"App\\Entity\\Entry\" object not found by \"Symfony\\Bridge\\Doctrine\\ArgumentResolver\\EntityValueResolver\". at /var/www/kbin.melroy.org/html/vendor/symfony/doctrine-bridge/ArgumentResolver/EntityValueResolver.php:76) [stacktrace] #0 /var/www/kbin.melroy.org/html/vendor/symfony/http-kernel/Controller/ArgumentResolver/TraceableValueResolver.php(37): Symfony\\Bridge\\Doctrine\\ArgumentResolver\\EntityValueResolver->resolve() #1 /var/www/kbin.melroy.org/html/vendor/symfony/http-kernel/Controller/ArgumentResolver.php(90): Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver\\TraceableValueResolver->resolve() #2 /var/www/kbin.melroy.org/html/vendor/symfony/http-kernel/Controller/TraceableArgumentResolver.php(33): Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver->getArguments() #3 /var/www/kbin.melroy.org/html/vendor/symfony/http-kernel/HttpKernel.php(175): Symfony\\Component\\HttpKernel\\Controller\\TraceableArgumentResolver->getArguments() #4 /var/www/kbin.melroy.org/html/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw() #5 /var/www/kbin.melroy.org/html/vendor/symfony/http-kernel/Kernel.php(182): Symfony\\Component\\HttpKernel\\HttpKernel->handle() #6 /var/www/kbin.melroy.org/html/vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php(35): Symfony\\Component\\HttpKernel\\Kernel->handle() #7 /var/www/kbin.melroy.org/html/vendor/autoload_runtime.php(29): Symfony\\Component\\Runtime\\Runner\\Symfony\\HttpKernelRunner->run() #8 /var/www/kbin.melroy.org/html/public/index.php(7): require_once('...') #9 {main} ``` And also seems to be related: ``` [2024-09-12T20:50:38.827422+02:00] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: ""App\Entity\Post" object not found by "Symfony\Bridge\Doctrine\ArgumentResolver\EntityValueResolver"." at EntityValueResolver.php line 76 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): \"App\\Entity\\Post\" object not found by \"Symfony\\Bridge\\Doctrine\\ArgumentResolver\\EntityValueResolver\". at /var/www/kbin.melroy.org/html/vendor/symfony/doctrine-bridge/ArgumentResolver/EntityValueResolver.php:76) [stacktrace] #0 /var/www/kbin.melroy.org/html/vendor/symfony/http-kernel/Controller/ArgumentResolver/TraceableValueResolver.php(37): Symfony\\Bridge\\Doctrine\\ArgumentResolver\\EntityValueResolver->resolve() #1 /var/www/kbin.melroy.org/html/vendor/symfony/http-kernel/Controller/ArgumentResolver.php(90): Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver\\TraceableValueResolver->resolve() #2 /var/www/kbin.melroy.org/html/vendor/symfony/http-kernel/Controller/TraceableArgumentResolver.php(33): Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver->getArguments() #3 /var/www/kbin.melroy.org/html/vendor/symfony/http-kernel/HttpKernel.php(175): Symfony\\Component\\HttpKernel\\Controller\\TraceableArgumentResolver->getArguments() #4 /var/www/kbin.melroy.org/html/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw() #5 /var/www/kbin.melroy.org/html/vendor/symfony/http-kernel/Kernel.php(182): Symfony\\Component\\HttpKernel\\HttpKernel->handle() #6 /var/www/kbin.melroy.org/html/vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php(35): Symfony\\Component\\HttpKernel\\Kernel->handle() #7 /var/www/kbin.melroy.org/html/vendor/autoload_runtime.php(29): Symfony\\Component\\Runtime\\Runner\\Symfony\\HttpKernelRunner->run() #8 /var/www/kbin.melroy.org/html/public/index.php(7): require_once('...') #9 {main} "} [] ```
Most seen CSRF IDs causing issues are:
vote
)favourite
)Full stack trace
During my testing in DEV mode: ``` [2024-09-12T20:42:54.414611+02:00] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\BadRequestHttpException: "Invalid CSRF token" at AbstractController.php line 39 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\BadRequestHttpException(code: 0): Invalid CSRF token at /var/www/kbin.melroy.org/html/src/Controller/AbstractController.php:39) [stacktrace] #0 /var/www/kbin.melroy.org/html/src/Controller/FavouriteController.php(24): App\\Controller\\AbstractController->validateCsrf() #1 /var/www/kbin.melroy.org/html/vendor/symfony/http-kernel/HttpKernel.php(183): App\\Controller\\FavouriteController->__invoke() #2 /var/www/kbin.melroy.org/html/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw() #3 /var/www/kbin.melroy.org/html/vendor/symfony/http-kernel/Kernel.php(182): Symfony\\Component\\HttpKernel\\HttpKernel->handle() #4 /var/www/kbin.melroy.org/html/vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php(35): Symfony\\Component\\HttpKernel\\Kernel->handle() #5 /var/www/kbin.melroy.org/html/vendor/autoload_runtime.php(29): Symfony\\Component\\Runtime\\Runner\\Symfony\\HttpKernelRunner->run() #6 /var/www/kbin.melroy.org/html/public/index.php(7): require_once('...') #7 {main} "} [] [2024-09-12T20:42:54.657138+02:00] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\BadRequestHttpException: "Invalid CSRF token" at AbstractController.php line 39 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\BadRequestHttpException(code: 0): Invalid CSRF token at /var/www/kbin.melroy.org/html/src/Controller/AbstractController.php:39) [stacktrace] #0 /var/www/kbin.melroy.org/html/src/Controller/FavouriteController.php(24): App\\Controller\\AbstractController->validateCsrf() #1 /var/www/kbin.melroy.org/html/vendor/symfony/http-kernel/HttpKernel.php(183): App\\Controller\\FavouriteController->__invoke() #2 /var/www/kbin.melroy.org/html/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw() #3 /var/www/kbin.melroy.org/html/vendor/symfony/http-kernel/Kernel.php(182): Symfony\\Component\\HttpKernel\\HttpKernel->handle() #4 /var/www/kbin.melroy.org/html/vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php(35): Symfony\\Component\\HttpKernel\\Kernel->handle() #5 /var/www/kbin.melroy.org/html/vendor/autoload_runtime.php(29): Symfony\\Component\\Runtime\\Runner\\Symfony\\HttpKernelRunner->run() #6 /var/www/kbin.melroy.org/html/public/index.php(7): require_once('...') #7 {main} "} [] ``` And from Jerry during PRD mode: ``` {"message":"Uncaught PHP Exception Symfony\\Component\\HttpKernel\\Exception\\BadRequestHttpException: \"Invalid CSRF token\" at AbstractController.php line 39","context":{"exception":{"class":"Symfony\\Component\\HttpKernel\\Exception\\BadRequestHttpException","message":"Invalid CSRF token","code":0,"file":"/var/www/mbin/src/Controller/AbstractController.php:39"}},"level":400,"level_name":"ERROR","channel":"request","datetime":"2024-09-12T18:54:45.620576+00:00","extra":{}} {"message":"Uncaught PHP Exception Symfony\\Component\\HttpKernel\\Exception\\BadRequestHttpException: \"Invalid CSRF token\" at AbstractController.php line 39","context":{"exception":{"class":"Symfony\\Component\\HttpKernel\\Exception\\BadRequestHttpException","message":"Invalid CSRF token","code":0,"file":"/var/www/mbin/src/Controller/AbstractController.php:39"}},"level":400,"level_name":"ERROR","channel":"request","datetime":"2024-09-12T18:54:45.803347+00:00","extra":{}} ```
Full stack trace
``` [2024-09-12T20:46:45.049039+02:00] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "" at EntryCommentRepository.php line 70 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): at /var/www/kbin.melroy.org/html/src/Repository/EntryCommentRepository.php:70) [stacktrace] #0 /var/www/kbin.melroy.org/html/src/Controller/Entry/Comment/EntryCommentFrontController.php(34): App\\Repository\\EntryCommentRepository->findByCriteria() #1 /var/www/kbin.melroy.org/html/vendor/symfony/http-kernel/HttpKernel.php(183): App\\Controller\\Entry\\Comment\\EntryCommentFrontController->front() #2 /var/www/kbin.melroy.org/html/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw() #3 /var/www/kbin.melroy.org/html/vendor/symfony/http-kernel/Kernel.php(182): Symfony\\Component\\HttpKernel\\HttpKernel->handle() #4 /var/www/kbin.melroy.org/html/vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php(35): Symfony\\Component\\HttpKernel\\Kernel->handle() #5 /var/www/kbin.melroy.org/html/vendor/autoload_runtime.php(29): Symfony\\Component\\Runtime\\Runner\\Symfony\\HttpKernelRunner->run() #6 /var/www/kbin.melroy.org/html/public/index.php(7): require_once('...') #7 {main} "} [] ```
invalid input syntax for type integer: \"{user_id}\"
:See also: #1072 (which I will not mention here)