mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-02-16 19:06:45 +03:00
"HTTP ERROR 500" error message after upgrading Bookstack and login #4290
Closed
opened 2026-02-05 08:26:53 +03:00 by OVERLORD
·
11 comments
No Branch/Tag Specified
development
l10n_development
release
v25-12
llm_only
vectors
v25-11
docker_env
drawio_rendering
user_permissions
ldap_host_failover
svg_image
prosemirror
captcha_example
fix/video-export
v25.12.3
v25.12.2
v25.12.1
v25.12
v25.11.6
v25.11.5
v25.11.4
v24.11.4
v25.11.3
v25.11.2
v25.11.1
v25.11
v25.07.3
v25.07.2
v25.07.1
v25.07
v25.05.2
v25.05.1
v25.05
v25.02.5
v25.02.4
v25.02.3
v25.02.2
v25.02.1
v25.02
v24.12.1
v24.12
v24.10.3
v24.10.2
v24.10.1
v24.10
v24.05.4
v24.05.3
v24.05.2
v24.05.1
v24.05
v24.02.3
v24.02.2
v24.02.1
v24.02
v23.12.3
v23.12.2
v23.12.1
v23.12
v23.10.4
v23.10.3
v23.10.2
v23.10.1
v23.10
v23.08.3
v23.08.2
v23.08.1
v23.08
v23.06.2
v23.06.1
v23.06
v23.05.2
v23.05.1
v23.05
v23.02.3
v23.02.2
v23.02.1
v23.02
v23.01.1
v23.01
v22.11.1
v22.11
v22.10.2
v22.10.1
v22.10
v22.09.1
v22.09
v22.07.3
v22.07.2
v22.07.1
v22.07
v22.06.2
v22.06.1
v22.06
v22.04.2
v22.04.1
v22.04
v22.03.1
v22.03
v22.02.3
v22.02.2
v22.02.1
v22.02
v21.12.5
v21.12.4
v21.12.3
v21.12.2
v21.12.1
v21.12
v21.11.3
v21.11.2
v21.11.1
v21.11
v21.10.3
v21.10.2
v21.10.1
v21.10
v21.08.6
v21.08.5
v21.08.4
v21.08.3
v21.08.2
v21.08.1
v21.08
v21.05.4
v21.05.3
v21.05.2
v21.05.1
v21.05
v21.04.6
v21.04.5
v21.04.4
v21.04.3
v21.04.2
v21.04.1
v21.04
v0.31.8
v0.31.7
v0.31.6
v0.31.5
v0.31.4
v0.31.3
v0.31.2
v0.31.1
v0.31.0
v0.30.7
v0.30.6
v0.30.5
v0.30.4
v0.30.3
v0.30.2
v0.30.1
v0.30.0
v0.29.3
v0.29.2
v0.29.1
v0.29.0
v0.28.3
v0.28.2
v0.28.1
v0.28.0
v0.27.5
v0.27.4
v0.27.3
v0.27.2
v0.27.1
v0.27
v0.26.4
v0.26.3
v0.26.2
v0.26.1
v0.26.0
v0.25.5
v0.25.4
v0.25.3
v0.25.2
v0.25.1
v0.25.0
v0.24.3
v0.24.2
v0.24.1
v0.24.0
v0.23.2
v0.23.1
v0.23.0
v0.22.0
v0.21.0
v0.20.3
v0.20.2
v0.20.1
v0.20.0
v0.19.0
v0.18.5
v0.18.4
v0.18.3
v0.18.2
v0.18.1
v0.18.0
v0.17.4
v0.17.3
v0.17.2
v0.17.1
v0.17.0
v0.16.3
v0.16.2
v0.16.1
v0.16.0
v0.15.3
v0.15.2
v0.15.1
v0.15.0
v0.14.3
v0.14.2
v0.14.1
v0.14.0
v0.13.1
v0.13.0
v0.12.2
v0.12.1
v0.12.0
v0.11.2
v0.11.1
v0.11.0
v0.10.0
v0.9.3
v0.9.2
v0.9.1
v0.9.0
v0.8.2
v0.8.1
v0.8.0
v0.7.6
v0.7.5
v0.7.4
v0.7.3
0.7.2
v.0.7.1
v0.7.0
v0.6.3
v0.6.2
v0.6.1
v0.6.0
v0.5.0
Labels
Clear labels
🎨 Design
📖 Docs Update
🐛 Bug
🐛 Bug
:cat2:🐈 Possible duplicate
💿 Database
☕ Open to discussion
💻 Front-End
🐕 Support
🚪 Authentication
🌍 Translations
🔌 API Task
🏭 Back-End
⛲ Upstream
🔨 Feature Request
🛠️ Enhancement
🛠️ Enhancement
🛠️ Enhancement
❤️ Happy feedback
🔒 Security
🔍 Pending Validation
💆 UX
📝 WYSIWYG Editor
🌔 Out of scope
🔩 API Request
:octocat: Admin/Meta
🖌️ View Customization
❓ Question
🚀 Priority
🛡️ Blocked
🚚 Export System
♿ A11y
🔧 Maintenance
> Markdown Editor
pull-request
Mirrored from GitHub Pull Request
No Label
🐕 Support
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: starred/BookStack#4290
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @bobinator83 on GitHub (Nov 1, 2023).
Attempted Debugging
Searched GitHub Issues
Describe the Scenario
I have updated my Bookstack App from version 22.03.1 to the latest one. Should be v23.10, but I'm not 100% sure, because of I can not login anymore. After the update I get the login page, but when I'm login with my credentials, I get the error message "HTTP ERROR 500"
I have some experience with accessing or interacting with databases and hope it is enought to fix this issue together with you ;-)
Exact BookStack Version
latest, should be v23.10.
Log Content
[migrations] started
[migrations] 01-nginx-site-confs-default: skipped
[migrations] 02-default-location: skipped
[migrations] done
usermod: no changes
───────────────────────────────────────
██╗ ███████╗██╗ ██████╗
██║ ██╔════╝██║██╔═══██╗
██║ ███████╗██║██║ ██║
██║ ╚════██║██║██║ ██║
███████╗███████║██║╚██████╔╝
╚══════╝╚══════╝╚═╝ ╚═════╝
Brought to you by linuxserver.io
───────────────────────────────────────
To support LSIO projects visit:
https://www.linuxserver.io/donate/
───────────────────────────────────────
GID/UID
───────────────────────────────────────
User UID: 1026
User GID: 100
───────────────────────────────────────
using keys found in /config/keys
App Key found - setting variable for seds
Running config - DB_HOST set
Waiting for DB to be available
PHP Warning: PHP Startup: Invalid date.timezone value '', using 'UTC' instead in Unknown on line 0
INFO Running migrations.
2021_12_07_111343_create_webhooks_table ........................... 3ms FAIL
Illuminate\Database\QueryException
SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'webhooks' already exists (SQL: create table
webhooks(idint unsigned not null auto_increment primary key,namevarchar(150) not null,activetinyint(1) not null,endpointvarchar(500) not null,created_attimestamp null,updated_attimestamp null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')at /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php:760
756▕ // If an exception occurs when attempting to run a query, we'll format the error
757▕ // message to include the bindings with SQL, which will make this exception a
758▕ // lot more helpful to the developer instead of just the database's errors.
759▕ catch (Exception $e) {
➜ 760▕ throw new QueryException(
761▕ $query, $this->prepareBindings($bindings), $e
762▕ );
763▕ }
764▕ }
+9 vendor frames
10 /app/www/database/migrations/2021_12_07_111343_create_webhooks_table.php:16
Illuminate\Support\Facades\Facade::__callStatic()
+25 vendor frames
36 /app/www/artisan:35
Illuminate\Foundation\Console\Kernel::handle()
**** The following site-confs have extensions other than .conf ****
**** This may be due to user customization. ****
**** You should review the files and rename them to use the .conf extension or remove them. ****
**** nginx.conf will only include site-confs with the .conf extension. ****
/config/nginx/site-confs/._DAV/default.conf.pag
/config/nginx/site-confs/._DAV/default.conf.dir
/config/nginx/site-confs/default
[custom-init] No custom files found, skipping...
[31-Oct-2023 21:26:26] NOTICE: PHP message: PHP Warning: PHP Startup: Invalid date.timezone value '', using 'UTC' instead in Unknown on line 0
[ls.io-init] done.
-- Content from /config/log/nginx/error.log
2023/10/31 21:29:28 [error] 272#272: *17 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'view' in 'where clause' in /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php:414
Stack trace:
#0 /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(414): PDO->prepare()
#1 /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(753): Illuminate\Database\Connection->Illuminate\Database{closure}()
#2 /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(720): Illuminate\Database\Connection->runQueryCallback()
#3 /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(405): Illuminate\Database\Connection->run()
#4 /app/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2705): Illuminate\Database\Connection->select()
#5 /app/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2694): Illuminate\Database\Query\Builder->runSelect()
#6 /app/www/vendor/laravel/fr...; PHP message: PHP Fatal error: Uncaught PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'view' in 'where clause' in /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php:414
Stack trace:
#0 /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(414): PDO->prepare()
#1 /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(753): Illuminate\Database\Connection->Illuminate\Database{closure}()
#2 /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(720): Illuminate\Database\Connection->runQueryCallback()
#3 /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(405): Illuminate\Database\Connection->run()
#4 /app/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2705): Illuminate\Database\Connection->select()
#5 /app/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2694): Illuminate\Database\Query\Bu
Hosting Environment
running docker on a Synology and manage a bookstack stack with portainer:
version: "2"
services:
bookstack:
image: lscr.io/linuxserver/bookstack
container_name: bookstack_test
environment:
- PUID=1026
- PGID=100
- APP_URL=https://kb.domain.de
- APP_KEY=base64:SPlSs5IxxxxxxxxxxxxxxxxxxxxxxxxxxhhM+hikB/M0=
- DB_HOST=bookstack_db
- DB_PORT=3306
- DB_USER=bookstack
- DB_PASS=password
- DB_DATABASE=bookstackapp
volumes:
- /volume1/docker/bookstack_test/app:/config
ports:
- 6875:80
restart: unless-stopped
depends_on:
- bookstack_db
bookstack_db:
image: lscr.io/linuxserver/mariadb
container_name: bookstack_db_test
environment:
- PUID=1026
- PGID=100
- MYSQL_ROOT_PASSWORD=password
- TZ=Europe/Berlin
- MYSQL_DATABASE=bookstackapp
- MYSQL_USER=bookstack
- MYSQL_PASSWORD=password
volumes:
- /volume1/docker/bookstack_test/db:/config
restart: unless-stopped
@ssddanbrown commented on GitHub (Nov 1, 2023):
Awesome! To create a plan of action, it'll be good to know the following:
migrationstable of the database?select * from migrations order by migration desc limit 5;webhooks,webhook_tracked_events,jobs.If you're unsure how to access the database container to query these details, just let me know.
Unfortunately we won't know the underlying cause right away before attempting to fix, this would have been an issue from when you originally upgrading to a
v22.*release (or initial install) but has just gone unnoticed until now.BTW, I'm about to go offline as it's getting late here, so it'll probably be a good few hours before I can respond again, so no rush to get these details right now.
@bobinator83 commented on GitHub (Nov 2, 2023):
Hi Dan,
Many many thanks for our support!
Here are the last 5 entries of the migrations table
Next, all three tables "webhooks, webhook_tracked_events, jobs" exists.
I already have created a sqldump. With this dump I was able to create a working (test) docker container with the following specs.
bookstack:
image: linuxserver/bookstack:22.03.1
bookstack_db:
image: lscr.io/linuxserver/mariadb
Afterwards I have updated the bookstack app with the image "image: lscr.io/linuxserver/bookstack" to the latest version and get the same error message.
So it would be really nice if we get my test environment working, so that I have a plan how to migrate my bookstack to the latest version. Then I should be able to migrate my production.
I hope you now what my plan is and that it is possible. Important is, we can try it on my test environment and will not damage my production.
@ssddanbrown commented on GitHub (Nov 2, 2023):
Thanks for the info.
Strange though, I would not expect the
jobstable to exist, unless you've at some point imported a database dump over the database for a later version.What about a
referencestable, does that exist?And are the results provided above from your test instance (Made from the dump) or the original instance? Just want to make sure I'm not following issues that are only present in the test instance due to import process or something.
@bobinator83 commented on GitHub (Nov 5, 2023):
Hi Dan,
sorry for the delay.
The references table exists and the results comes from the test instance. But I think I need to tell you a few more details what I did.
First instance (prod instance)
My first boockstack instance was created round about 2 years ago. I have used Portainer to create a docker container for only the bookstack app (linuxserver/bookstack:21.10.3)
I have configured the container so that it uses a mariadb database from synology (seperate database for bookstack). Now I know that it is better to have a seperate instance for the database and the best way is to have one container for the app and one for the database.
Some month ago I decided to update my bookstack app to the latest version (sorry, I can't remember the exact version). I shutdown the container, pulled the latest version of bookstack and started the bookstack container. Then I got an HTTP error and my bookstack was no longer reachable.
So I had become afraid, shutdown the container again, pulled the old image linuxserver/bookstack:21.10.3 and started the container. There was still an web server issue but I got it fix with support of my friend. I only need to restore the nginx.conf.
Thats the current status of my prod instance. I have checked the tables in the prod instance and the tables webhooks, webhook_tracked_events, jobs and references are not there.
Second instance (test instance)
Because I'm afraid of breaking my prod instance again, I decided to take a dump from my prod instance and I have created a new stack with portainer. But now I have created a container for bookstack app (linuxserver/bookstack:21.10.3) and one for the database (lscr.io/linuxserver/mariadb)
Afterwards I was able to import the dump from the prod instance to the test instance and I had a working bookstack app. Then I tried to update the bookstack app but it was only possible to version (linuxserver/bookstack:22.03.1) All versions above failed with different errors.
So I decided to update to the latest version again and asked you for support to fix the issue.
In the test instance the tables webhooks, webhook_tracked_events, jobs and references are there.
Thats the current status of my test instance.
Sorry for the confusion. But my only plan is to update my (working) prod instance to the latest version and migrate the database in a own docker container and I would like to test it first. I hope that is still possible and I haven't ruined it for myself
@ssddanbrown commented on GitHub (Nov 5, 2023):
Okay, the issues you're originally reporting here are likely due to the specific import process for the test instance.
You imported a database dump for an older version, over a database scheme created for a later version of BookStack.
Therefore BookStack is getting configured when attempting to upgrade the database, but finding that changes it's trying to do have already been made.
Ideally imports of database dumps should be done into an empty database instance. In a docker setup you'd usually achieve this by only starting the database container within the stack, import the database dump, then bring all containers up.
Are you in a position where you can re-import for the test instance (from an empty database instance) or do you now have data in there which you need to retain?
@bobinator83 commented on GitHub (Nov 5, 2023):
Yes, we can use the test instance for a re-import of a dump. Do you need some more information?
Is there a speacial way to export and import the dump?
@ssddanbrown commented on GitHub (Nov 9, 2023):
Not really, just make sure you import into an empty database environment, before the BookStack container has run against it, then you should be fine. Watch and record any errors upon first BookStack container boot as any errors may be different and less clear on a second attempt.
@bobinator83 commented on GitHub (Nov 9, 2023):
Ok then I will try this. Is it important which version of bookstack and MariaDB I have installed? Could I use direct the latest version?
@ssddanbrown commented on GitHub (Nov 10, 2023):
Yeah, for BookStack you can use the latest version. When you run the BookStack container it'll attempt to update the BookStack database schema on startup, which is what's going wrong at the moment. I try to make sure that with BookStack you can jump forward to any future versions, just don't go backwards.
Just make sure you restore the backup into the empty database, before the bookstack container is started.
@bobinator83 commented on GitHub (Nov 10, 2023):
Hi Dan,
you make my day! I have successfully imported the dump into a new BookStack instance and it works fine.
Here my steps:
Many many thanks Dan. From now on I will. Frequently update and only forwards.
@ssddanbrown commented on GitHub (Nov 10, 2023):
@bobinator83 Happy to help, good to hear you got things sorted!