The issue
I'm trying to log into flarum via the API and I am getting the following error:
Server error: `POST http://flarum.craft.test/api/users` resulted in a `500 Internal Server Error` response:
{"errors":[{"status":"500","code":"unknown"}]}
Error log:
[2024-02-01 20:01:44] flarum.ERROR: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'user_id' cannot be null in /Users/mikey/sites/flarum/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:117
Stack trace:
#0 /Users/mikey/sites/flarum/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(117): PDOStatement->execute(NULL)
#1 /Users/mikey/sites/flarum/vendor/illuminate/database/Connection.php(501): Doctrine\DBAL\Driver\PDOStatement->execute()
#2 /Users/mikey/sites/flarum/vendor/illuminate/database/Connection.php(705): Illuminate\Database\Connection->Illuminate\Database\{closure}('insert into `no...', Array)
#3 /Users/mikey/sites/flarum/vendor/illuminate/database/Connection.php(672): Illuminate\Database\Connection->runQueryCallback('insert into `no...', Array, Object(Closure))
#4 /Users/mikey/sites/flarum/vendor/illuminate/database/Connection.php(490): Illuminate\Database\Connection->run('insert into `no...', Array, Object(Closure))
#5 /Users/mikey/sites/flarum/vendor/illuminate/database/Connection.php(454): Illuminate\Database\Connection->statement('insert into `no...', Array)
#6 /Users/mikey/sites/flarum/vendor/illuminate/database/Query/Builder.php(2978): Illuminate\Database\Connection->insert('insert into `no...', Array)
#7 /Users/mikey/sites/flarum/vendor/illuminate/database/Eloquent/Builder.php(1657): Illuminate\Database\Query\Builder->insert(Array)
#8 /Users/mikey/sites/flarum/vendor/illuminate/support/Traits/ForwardsCalls.php(23): Illuminate\Database\Eloquent\Builder->__call('insert', Array)
#9 /Users/mikey/sites/flarum/vendor/illuminate/database/Eloquent/Model.php(2132): Illuminate\Database\Eloquent\Model->forwardCallTo(Object(Illuminate\Database\Eloquent\Builder), 'insert', Array)
#10 /Users/mikey/sites/flarum/vendor/flarum/core/src/Database/AbstractModel.php(224): Illuminate\Database\Eloquent\Model->__call('insert', Array)
#11 /Users/mikey/sites/flarum/vendor/illuminate/database/Eloquent/Model.php(2144): Flarum\Database\AbstractModel->__call('insert', Array)
#12 /Users/mikey/sites/flarum/vendor/flarum/core/src/Notification/Notification.php(228): Illuminate\Database\Eloquent\Model::__callStatic('insert', Array)
#13 /Users/mikey/sites/flarum/vendor/flarum/core/src/Notification/Job/SendNotificationsJob.php(37): Flarum\Notification\Notification::notify(Array, Object(Flarum\Suspend\Notification\UserUnsuspendedBlueprint))
#14 /Users/mikey/sites/flarum/vendor/illuminate/container/BoundMethod.php(36): Flarum\Notification\Job\SendNotificationsJob->handle()
#15 /Users/mikey/sites/flarum/vendor/illuminate/container/Util.php(40): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#16 /Users/mikey/sites/flarum/vendor/illuminate/container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure(Object(Closure))
#17 /Users/mikey/sites/flarum/vendor/illuminate/container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Container\Container), Array, Object(Closure))
#18 /Users/mikey/sites/flarum/vendor/illuminate/container/Container.php(653): Illuminate\Container\BoundMethod::call(Object(Illuminate\Container\Container), Array, Array, NULL)
#19 /Users/mikey/sites/flarum/vendor/illuminate/bus/Dispatcher.php(128): Illuminate\Container\Container->call(Array)
#20 /Users/mikey/sites/flarum/vendor/illuminate/pipeline/Pipeline.php(128): Illuminate\Bus\Dispatcher->Illuminate\Bus\{closure}(Object(Flarum\Notification\Job\SendNotificationsJob))
#21 /Users/mikey/sites/flarum/vendor/illuminate/pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Flarum\Notification\Job\SendNotificationsJob))
#22 /Users/mikey/sites/flarum/vendor/illuminate/bus/Dispatcher.php(132): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#23 /Users/mikey/sites/flarum/vendor/illuminate/queue/CallQueuedHandler.php(119): Illuminate\Bus\Dispatcher->dispatchNow(Object(Flarum\Notification\Job\SendNotificationsJob), false)
#24 /Users/mikey/sites/flarum/vendor/illuminate/pipeline/Pipeline.php(128): Illuminate\Queue\CallQueuedHandler->Illuminate\Queue\{closure}(Object(Flarum\Notification\Job\SendNotificationsJob))
#25 /Users/mikey/sites/flarum/vendor/illuminate/pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Flarum\Notification\Job\SendNotificationsJob))
#26 /Users/mikey/sites/flarum/vendor/illuminate/queue/CallQueuedHandler.php(118): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#27 /Users/mikey/sites/flarum/vendor/illuminate/queue/CallQueuedHandler.php(70): Illuminate\Queue\CallQueuedHandler->dispatchThroughMiddleware(Object(Illuminate\Queue\Jobs\SyncJob), Object(Flarum\Notification\Job\SendNotificationsJob))
#28 /Users/mikey/sites/flarum/vendor/illuminate/queue/Jobs/Job.php(98): Illuminate\Queue\CallQueuedHandler->call(Object(Illuminate\Queue\Jobs\SyncJob), Array)
#29 /Users/mikey/sites/flarum/vendor/illuminate/queue/SyncQueue.php(43): Illuminate\Queue\Jobs\Job->fire()
#30 /Users/mikey/sites/flarum/vendor/flarum/core/src/Notification/Driver/AlertNotificationDriver.php(35): Illuminate\Queue\SyncQueue->push(Object(Flarum\Notification\Job\SendNotificationsJob))
#31 /Users/mikey/sites/flarum/vendor/flarum/core/src/Notification/NotificationSyncer.php(110): Flarum\Notification\Driver\AlertNotificationDriver->send(Object(Flarum\Suspend\Notification\UserUnsuspendedBlueprint), Array)
#32 /Users/mikey/sites/flarum/vendor/flarum/suspend/src/Listener/SendNotificationWhenUserIsUnsuspended.php(33): Flarum\Notification\NotificationSyncer->sync(Object(Flarum\Suspend\Notification\UserUnsuspendedBlueprint), Array)
#33 /Users/mikey/sites/flarum/vendor/illuminate/events/Dispatcher.php(424): Flarum\Suspend\Listener\SendNotificationWhenUserIsUnsuspended->handle(Object(Flarum\Suspend\Event\Unsuspended))
#34 /Users/mikey/sites/flarum/vendor/illuminate/events/Dispatcher.php(249): Illuminate\Events\Dispatcher->Illuminate\Events\{closure}('Flarum\\Suspend\\...', Array)
#35 /Users/mikey/sites/flarum/vendor/flarum/suspend/src/Listener/SaveSuspensionToDatabase.php(68): Illuminate\Events\Dispatcher->dispatch('Flarum\\Suspend\\...')
#36 /Users/mikey/sites/flarum/vendor/illuminate/events/Dispatcher.php(424): Flarum\Suspend\Listener\SaveSuspensionToDatabase->handle(Object(Flarum\User\Event\Saving))
#37 /Users/mikey/sites/flarum/vendor/illuminate/events/Dispatcher.php(249): Illuminate\Events\Dispatcher->Illuminate\Events\{closure}('Flarum\\User\\Eve...', Array)
#38 /Users/mikey/sites/flarum/vendor/flarum/core/src/User/Command/RegisterUserHandler.php(108): Illuminate\Events\Dispatcher->dispatch('Flarum\\User\\Eve...')
#39 /Users/mikey/sites/flarum/vendor/illuminate/bus/Dispatcher.php(122): Flarum\User\Command\RegisterUserHandler->handle(Object(Flarum\User\Command\RegisterUser))
#40 /Users/mikey/sites/flarum/vendor/illuminate/pipeline/Pipeline.php(128): Illuminate\Bus\Dispatcher->Illuminate\Bus\{closure}(Object(Flarum\User\Command\RegisterUser))
#41 /Users/mikey/sites/flarum/vendor/illuminate/pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Flarum\User\Command\RegisterUser))
#42 /Users/mikey/sites/flarum/vendor/illuminate/bus/Dispatcher.php(132): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#43 /Users/mikey/sites/flarum/vendor/illuminate/bus/Dispatcher.php(78): Illuminate\Bus\Dispatcher->dispatchNow(Object(Flarum\User\Command\RegisterUser))
#44 /Users/mikey/sites/flarum/vendor/flarum/core/src/Api/Controller/CreateUserController.php(45): Illuminate\Bus\Dispatcher->dispatch(Object(Flarum\User\Command\RegisterUser))
#45 /Users/mikey/sites/flarum/vendor/flarum/core/src/Api/Controller/AbstractSerializeController.php(116): Flarum\Api\Controller\CreateUserController->data(Object(Laminas\Diactoros\ServerRequest), Object(Tobscure\JsonApi\Document))
#46 /Users/mikey/sites/flarum/vendor/flarum/core/src/Api/Controller/AbstractCreateController.php(22): Flarum\Api\Controller\AbstractSerializeController->handle(Object(Laminas\Diactoros\ServerRequest))
#47 /Users/mikey/sites/flarum/vendor/flarum/core/src/Http/RouteHandlerFactory.php(41): Flarum\Api\Controller\AbstractCreateController->handle(Object(Laminas\Diactoros\ServerRequest))
#48 /Users/mikey/sites/flarum/vendor/flarum/core/src/Http/Middleware/ExecuteRoute.php(27): Flarum\Http\RouteHandlerFactory->Flarum\Http\{closure}(Object(Laminas\Diactoros\ServerRequest), Array)
#49 /Users/mikey/sites/flarum/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Http\Middleware\ExecuteRoute->process(Object(Laminas\Diactoros\ServerRequest), Object(Closure))
#50 /Users/mikey/sites/flarum/vendor/flarum/core/src/Api/Middleware/ThrottleApi.php(33): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#51 /Users/mikey/sites/flarum/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Api\Middleware\ThrottleApi->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#52 /Users/mikey/sites/flarum/vendor/flarum/core/src/Http/Middleware/CheckCsrfToken.php(40): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#53 /Users/mikey/sites/flarum/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Http\Middleware\CheckCsrfToken->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#54 /Users/mikey/sites/flarum/vendor/flarum/core/src/Http/Middleware/ResolveRoute.php(69): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#55 /Users/mikey/sites/flarum/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Http\Middleware\ResolveRoute->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#56 /Users/mikey/sites/flarum/vendor/flarum/core/src/Http/Middleware/SetLocale.php(51): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#57 /Users/mikey/sites/flarum/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Http\Middleware\SetLocale->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#58 /Users/mikey/sites/flarum/vendor/flarum/core/src/Http/Middleware/AuthenticateWithHeader.php(58): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#59 /Users/mikey/sites/flarum/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Http\Middleware\AuthenticateWithHeader->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#60 /Users/mikey/sites/flarum/vendor/flarum/core/src/Http/Middleware/AuthenticateWithSession.php(31): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#61 /Users/mikey/sites/flarum/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Http\Middleware\AuthenticateWithSession->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#62 /Users/mikey/sites/flarum/vendor/flarum/core/src/Http/Middleware/RememberFromCookie.php(52): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#63 /Users/mikey/sites/flarum/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Http\Middleware\RememberFromCookie->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#64 /Users/mikey/sites/flarum/vendor/flarum/core/src/Http/Middleware/StartSession.php(61): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#65 /Users/mikey/sites/flarum/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Http\Middleware\StartSession->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#66 /Users/mikey/sites/flarum/vendor/flarum/core/src/Api/Middleware/FakeHttpMethods.php(29): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#67 /Users/mikey/sites/flarum/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Api\Middleware\FakeHttpMethods->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#68 /Users/mikey/sites/flarum/vendor/flarum/core/src/Http/Middleware/ParseJsonBody.php(28): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#69 /Users/mikey/sites/flarum/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Http\Middleware\ParseJsonBody->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#70 /Users/mikey/sites/flarum/vendor/flarum/core/src/Http/Middleware/HandleErrors.php(57): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#71 /Users/mikey/sites/flarum/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Http\Middleware\HandleErrors->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#72 /Users/mikey/sites/flarum/vendor/flarum/core/src/Http/Middleware/InjectActorReference.php(25): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#73 /Users/mikey/sites/flarum/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Http\Middleware\InjectActorReference->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#74 /Users/mikey/sites/flarum/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(75): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#75 /Users/mikey/sites/flarum/vendor/middlewares/request-handler/src/RequestHandler.php(84): Laminas\Stratigility\MiddlewarePipe->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#76 /Users/mikey/sites/flarum/vendor/laminas/laminas-stratigility/src/Next.php(49): Middlewares\RequestHandler->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#77 /Users/mikey/sites/flarum/vendor/middlewares/base-path-router/src/BasePathRouter.php(99): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#78 /Users/mikey/sites/flarum/vendor/laminas/laminas-stratigility/src/Next.php(49): Middlewares\BasePathRouter->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#79 /Users/mikey/sites/flarum/vendor/laminas/laminas-stratigility/src/Middleware/OriginalMessages.php(36): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#80 /Users/mikey/sites/flarum/vendor/laminas/laminas-stratigility/src/Next.php(49): Laminas\Stratigility\Middleware\OriginalMessages->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#81 /Users/mikey/sites/flarum/vendor/middlewares/base-path/src/BasePath.php(73): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#82 /Users/mikey/sites/flarum/vendor/laminas/laminas-stratigility/src/Next.php(49): Middlewares\BasePath->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#83 /Users/mikey/sites/flarum/vendor/flarum/core/src/Http/Middleware/ProcessIp.php(24): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#84 /Users/mikey/sites/flarum/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Http\Middleware\ProcessIp->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#85 /Users/mikey/sites/flarum/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(75): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#86 /Users/mikey/sites/flarum/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(64): Laminas\Stratigility\MiddlewarePipe->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\EmptyPipelineHandler))
#87 /Users/mikey/sites/flarum/vendor/laminas/laminas-httphandlerrunner/src/RequestHandlerRunner.php(73): Laminas\Stratigility\MiddlewarePipe->handle(Object(Laminas\Diactoros\ServerRequest))
#88 /Users/mikey/sites/flarum/vendor/flarum/core/src/Http/Server.php(45): Laminas\HttpHandlerRunner\RequestHandlerRunner->run()
#89 /Users/mikey/sites/flarum/public/index.php(26): Flarum\Http\Server->listen()
#90 /Applications/Herd.app/Contents/Resources/valet/server.php(120): require('/Users/mikey/si...')
#91 {main}
Seems like it's trying to send a notification saying someones been unsuspended? But I don't see how I can clear that out?
Flarum information
➜ flarum php flarum info
Flarum core: 1.8.5
PHP version: 8.3.0
MySQL version: 8.0.33
Loaded extensions: Core, date, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dba, dom, hash, FFI, fileinfo, filter, ftp, gd, gmp, json, iconv, SPL, session, intl, standard, ldap, mbstring, mysqlnd, mysqli, pcntl, exif, imap, PDO, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, random, readline, redis, Reflection, imagick, shmop, SimpleXML, soap, sockets, sodium, sysvmsg, sysvsem, sysvshm, tokenizer, xml, xmlreader, xmlwriter, xsl, zip, Zend OPcache
+----------------------+---------+--------+
| Flarum Extensions | | |
+----------------------+---------+--------+
| ID | Version | Commit |
+----------------------+---------+--------+
| flarum-flags | v1.8.0 | |
| flarum-approval | v1.8.1 | |
| flarum-tags | v1.8.0 | |
| flarum-suspend | v1.8.1 | |
| flarum-subscriptions | v1.8.0 | |
| flarum-sticky | v1.8.0 | |
| flarum-statistics | v1.8.0 | |
| flarum-mentions | v1.8.3 | |
| flarum-markdown | v1.8.0 | |
| flarum-lock | v1.8.0 | |
| flarum-likes | v1.8.0 | |
| flarum-lang-english | v1.8.0 | |
| flarum-emoji | v1.8.0 | |
| flarum-bbcode | v1.8.0 | |
+----------------------+---------+--------+
Base URL: http://flarum.craft.test
Installation path: /Users/mikey/sites/flarum
Queue driver: sync
Session driver: file
Mail driver: mail
Debug mode: off