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

Error 500 on some urls #12

Open
al3xLvs opened this issue Mar 30, 2020 · 2 comments
Open

Error 500 on some urls #12

al3xLvs opened this issue Mar 30, 2020 · 2 comments

Comments

@al3xLvs
Copy link

al3xLvs commented Mar 30, 2020

error on my log file.

[2020-03-30 05:36:30] production.ERROR: TypeError: Argument 2 passed to AmauryCarrade\FlarumFeeds\Controller\AbstractFeedController::getRelationship() must be an instance of stdClass, null given, called in /flarum/app/vendor/amaurycarrade/flarum-ext-syndication/src/Controller/DiscussionFeedController.php on line 104 and defined in /flarum/app/vendor/amaurycarrade/flarum-ext-syndication/src/Controller/AbstractFeedController.php:207
Stack trace:
#0 /flarum/app/vendor/amaurycarrade/flarum-ext-syndication/src/Controller/DiscussionFeedController.php(104): AmauryCarrade\FlarumFeeds\Controller\AbstractFeedController->getRelationship(Object(stdClass), NULL)
#1 /flarum/app/vendor/amaurycarrade/flarum-ext-syndication/src/Controller/AbstractFeedController.php(123): AmauryCarrade\FlarumFeeds\Controller\DiscussionFeedController->getFeedContent(Object(Laminas\Diactoros\ServerRequest))
#2 /flarum/app/vendor/flarum/core/src/Http/RouteHandlerFactory.php(38): AmauryCarrade\FlarumFeeds\Controller\AbstractFeedController->handle(Object(Laminas\Diactoros\ServerRequest))
#3 /flarum/app/vendor/flarum/core/src/Http/Middleware/DispatchRoute.php(65): Flarum\Http\RouteHandlerFactory->Flarum\Http\{closure}(Object(Laminas\Diactoros\ServerReque
st), Array)
#4 /flarum/app/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\DispatchRoute->process(Object(Laminas\Diactoros\ServerRequest), Object(Closu
re))
#5 /flarum/app/vendor/flarum/core/src/Http/Middleware/ShareErrorsFromSession.php(56): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#6 /flarum/app/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\ShareErrorsFromSession->process(Object(Laminas\Diactoros\ServerRequest), Obj
ect(Laminas\Stratigility\Next))
#7 /flarum/app/vendor/flarum/core/src/Http/Middleware/SetLocale.php(50): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#8 /flarum/app/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\SetLocale->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\S
tratigility\Next))
#9 /flarum/app/vendor/flarum/core/src/Http/Middleware/CheckCsrfToken.php(23): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#10 /flarum/app/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\CheckCsrfToken->process(Object(Laminas\Diactoros\ServerRequest), Object(Lam
inas\Stratigility\Next))
#11 /flarum/app/vendor/flarum/core/src/Http/Middleware/AuthenticateWithSession.php(32): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#12 /flarum/app/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\AuthenticateWithSession->process(Object(Laminas\Diactoros\ServerRequest), O
bject(Laminas\Stratigility\Next))
#13 /flarum/app/vendor/flarum/core/src/Http/Middleware/RememberFromCookie.php(51): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#14 /flarum/app/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\RememberFromCookie->process(Object(Laminas\Diactoros\ServerRequest), Object
(Laminas\Stratigility\Next))
#15 /flarum/app/vendor/flarum/core/src/Http/Middleware/StartSession.php(61): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#16 /flarum/app/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\StartSession->process(Object(Laminas\Diactoros\ServerRequest), Object(Lamin
as\Stratigility\Next))
#17 /flarum/app/vendor/flarum/core/src/Http/Middleware/CollectGarbage.php(46): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#18 /flarum/app/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\CollectGarbage->process(Object(Laminas\Diactoros\ServerRequest), Object(Lam
inas\Stratigility\Next))
#19 /flarum/app/vendor/flarum/core/src/Http/Middleware/ParseJsonBody.php(28): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#20 /flarum/app/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\ParseJsonBody->process(Object(Laminas\Diactoros\ServerRequest), Object(Lami
nas\Stratigility\Next))
#21 /flarum/app/vendor/flarum/core/src/Http/Middleware/HandleErrors.php(57): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#22 /flarum/app/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\HandleErrors->process(Object(Laminas\Diactoros\ServerRequest), Object(Lamin
as\Stratigility\Next))
#23 /flarum/app/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(84): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#24 /flarum/app/vendor/middlewares/request-handler/src/RequestHandler.php(84): Laminas\Stratigility\MiddlewarePipe->process(Object(Laminas\Diactoros\ServerRequest), Obj
ect(Laminas\Stratigility\Next))
#25 /flarum/app/vendor/laminas/laminas-stratigility/src/Next.php(61): Middlewares\RequestHandler->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Strati
gility\Next))
#26 /flarum/app/vendor/middlewares/base-path-router/src/BasePathRouter.php(97): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#27 /flarum/app/vendor/laminas/laminas-stratigility/src/Next.php(61): Middlewares\BasePathRouter->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Strati
gility\Next))
#28 /flarum/app/vendor/laminas/laminas-stratigility/src/Middleware/OriginalMessages.php(42): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#29 /flarum/app/vendor/laminas/laminas-stratigility/src/Next.php(61): Laminas\Stratigility\Middleware\OriginalMessages->process(Object(Laminas\Diactoros\ServerRequest),
 Object(Laminas\Stratigility\Next))
#30 /flarum/app/vendor/middlewares/base-path/src/BasePath.php(53): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#31 /flarum/app/vendor/laminas/laminas-stratigility/src/Next.php(61): Middlewares\BasePath->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility
\Next))
#32 /flarum/app/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(84): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#33 /flarum/app/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(73): Laminas\Stratigility\MiddlewarePipe->process(Object(Laminas\Diactoros\ServerRequest), Ob
ject(Laminas\Stratigility\EmptyPipelineHandler))
#34 /flarum/app/vendor/laminas/laminas-httphandlerrunner/src/RequestHandlerRunner.php(96): Laminas\Stratigility\MiddlewarePipe->handle(Object(Laminas\Diactoros\ServerRe
quest))
#35 /flarum/app/vendor/flarum/core/src/Http/Server.php(42): Laminas\HttpHandlerRunner\RequestHandlerRunner->run()
#36 /flarum/app/public/index.php(26): Flarum\Http\Server->listen()
#37 {main}
@splitbrain
Copy link

I can confirm this problem. I'm getting the same on the main /atom feed

@splitbrain
Copy link

I believe the problem occurs when a user is deleted but the post remains. The post will have NULL as the user and thus no relation is passed. The same happens in the DiscussionsActivityFeedController.

I think the code needs to check if the relationship exists before using it, falling back to the username [deleted] otherwise

splitbrain added a commit to splitbrain-forks/flarum-ext-syndication that referenced this issue May 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants