The issue
I had sucessfully installed a flarum site by using RikoDEV's docker image This site has been smoothly ran for half a year.
Now I have a problem about starting/running flarum properly. I don't know whether it's caused by what I did yesterday. I was trying to move the site root from http://my_ip_address:8080 to http://my_ip_address:8080/forum. I did so by chaning the FORUM_URL in flarum.env. I also made a change in host's nginx configuration by adding section of "location /forum". It turns out that the flarum forum didn't run properly, so I gave up. Then I restored the above two settings.
After that I find the forum can't run appropriately. After login, the webpage do show the contents of posts, but all styles are missing, and navigation is also missing. The webpage shows a message with yellow backgound saying that thereis an error in loading the forum and refresh the page again.
In the flarum log file, there shows the follwing error:
[2024-09-07 10:16:07] flarum.ERROR: PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'flarum.flarum_fcl_levels' doesn't exist in /flarum/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:82
Stack trace:
#0 /flarum/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(82): PDO->prepare()
#1 /flarum/app/vendor/illuminate/database/Connection.php(368): Doctrine\DBAL\Driver\PDOConnection->prepare()
#2 /flarum/app/vendor/illuminate/database/Connection.php(705): Illuminate\Database\Connection->Illuminate\Database\{closure}()
.....
#90 /flarum/app/vendor/laminas/laminas-httphandlerrunner/src/RequestHandlerRunner.php(73): Laminas\Stratigility\MiddlewarePipe->handle()
#91 /flarum/app/vendor/flarum/core/src/Http/Server.php(45): Laminas\HttpHandlerRunner\RequestHandlerRunner->run()
#92 /flarum/app/public/index.php(26): Flarum\Http\Server->listen()
#93 {main}
Next Doctrine\DBAL\Driver\PDO\Exception: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'flarum.flarum_fcl_levels' doesn't exist in /flarum/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:18
Stack trace:
#0 /flarum/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(87): Doctrine\DBAL\Driver\PDO\Exception::new()
#1 /flarum/app/vendor/illuminate/database/Connection.php(368): Doctrine\DBAL\Driver\PDOConnection->prepare()
....
#90 /flarum/app/vendor/laminas/laminas-httphandlerrunner/src/RequestHandlerRunner.php(73): Laminas\Stratigility\MiddlewarePipe->handle()
#91 /flarum/app/vendor/flarum/core/src/Http/Server.php(45): Laminas\HttpHandlerRunner\RequestHandlerRunner->run()
#92 /flarum/app/public/index.php(26): Flarum\Http\Server->listen()
#93 {main}
Next Illuminate\Database\QueryException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'flarum.flarum_fcl_levels' doesn't exist (SQL: select count(*) as aggregate from `flarum_notifications` where `flarum_notifications`.`user_id` = 1 and `flarum_notifications`.`user_id` is not null and `type` in (discussionRenamed, postMentioned, userMentioned, groupMentioned, newPost, newDiscussionInTag, newPostInTag, newDiscussionTag, postLiked, levelUpdated, discussionMerged, selectBestAnswer, awardedBestAnswer) and `read_at` is null and `is_deleted` = 0 and ((`type` in (discussionRenamed, newPost, newDiscussionInTag, newPostInTag, newDiscussionTag, discussionMerged, selectBestAnswer, awardedBestAnswer, bestAnswerInDiscussion) and exists (select 1 from `flarum_discussions` where `id` = `subject_id` and (`flarum_discussions`.`id` not in (select `discussion_id` from `flarum_discussion_tag` where `tag_id` not in (select `flarum_tags`.`id` from `flarum_tags` where (`flarum_tags`.`id` in (select `flarum_perm_tags`.`id` from `flarum_tags` as `flarum_perm_tags`) and (`flarum_tags`.`parent_id` in (select `flarum_perm_tags`.`id` from `flarum_tags` as `flarum_perm_tags`) or `flarum_tags`.`parent_id` is null))))) and (`flarum_discussions`.`is_private` = 0))) or (`type` in (postMentioned, userMentioned, groupMentioned, postLiked) and exists (select 1 from `flarum_posts` where `id` = `subject_id` and exists (select 1 from `flarum_discussions` where `flarum_discussions`.`id` = `flarum_posts`.`discussion_id` and (`flarum_discussions`.`id` not in (select `discussion_id` from `flarum_discussion_tag` where `tag_id` not in (select `flarum_tags`.`id` from `flarum_tags` where (`flarum_tags`.`id` in (select `flarum_perm_tags`.`id` from `flarum_tags` as `flarum_perm_tags`) and (`flarum_tags`.`parent_id` in (select `flarum_perm_tags`.`id` from `flarum_tags` as `flarum_perm_tags`) or `flarum_tags`.`parent_id` is null))))) and (`flarum_discussions`.`is_private` = 0)) and (`flarum_posts`.`is_private` = 0))) or (`type` in (levelUpdated) and exists (select 1 from `flarum_fcl_levels` where `id` = `subject_id`)))) in /flarum/app/vendor/illuminate/database/Connection.php:712
Stack trace:
#0 /flarum/app/vendor/illuminate/database/Connection.php(672): Illuminate\Database\Connection->runQueryCallback()
#1 /flarum/app/vendor/illuminate/database/Connection.php(359): Illuminate\Database\Connection->run()
#2 /flarum/app/vendor/illuminate/database/Query/Builder.php(2413): Illuminate\Database\Connection->select()
...
````
Can anyone help me resoving this problem?
Thanks!
### Flarum information
php flarum info
Flarum core: 1.8.5
PHP version: 8.2.13
MySQL version: 11.2.3-MariaDB-1:11.2.3+mariaubu2204
Loaded extensions: Core, date, libxml, pcre, zlib, filter, hash, json, random, readline, Reflection, SPL, session, zend_test, ctype, curl, dom, fileinfo, gd, gmp, iconv, intl, mbstring, openssl, PDO, standard, tokenizer, xmlwriter, zip, exif, mysqlnd, Phar, pdo_mysql, apcu, Zend OPcache
+--------------------------------+------------+--------+
| Flarum Extensions | | |
+--------------------------------+------------+--------+
| ID | Version | Commit |
+--------------------------------+------------+--------+
| flarum-tags | v1.8.0 | |
| flarum-mentions | v1.8.3 | |
| flarum-subscriptions | v1.8.0 | |
| fof-follow-tags | 1.2.6 | |
| flarum-likes | v1.8.0 | |
| the-turk-mathren | 1.0.7 | |
| sycho-profile-cover | v1.3.5 | |
| justoverclock-hashtag | 1.0.1 | |
| foskym-custom-levels | v3.4.0 | |
| fof-user-bio | 1.4.0 | |
| fof-upload | 1.5.5 | |
| fof-profile-image-crop | 1.1.6 | |
| fof-merge-discussions | 1.4.1 | |
| fof-formatting | 1.0.3 | |
| fof-default-user-preferences | 1.2.1 | |
| fof-default-group | 1.1.2 | |
| fof-best-answer | 1.4.5 | |
| flarum-sticky | v1.8.0 | |
| flarum-statistics | v1.8.0 | |
| flarum-nicknames | v1.8.0 | |
| flarum-markdown | v1.8.0 | |
| flarum-lang-chinese-simplified | dev-master | |
| flarum-flags | v1.8.0 | |
| flarum-bbcode | v1.8.0 | |
| datlechin-copy-links | v1.0.1 | |
| darkle-fancybox | 1.1.4 | |
| clarkwinkelmann-scout | 0.3.5 | |
| clarkwinkelmann-likes-received | 1.0.2 | |
+--------------------------------+------------+--------+
Base URL: http://my_ip_address:8080
Installation path: /flarum/app
Queue driver: sync
Session driver: file
Scheduler status: 从未运行
Mail driver: smtp
Debug mode: off