mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-02-06 00:59:39 +03:00
[Support Request]: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bookstackapp.mfa_values' doesn't exist #2534
Reference in New Issue
Block 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 @alexgdi on GitHub (Dec 19, 2021).
Attempted Debugging
Searched GitHub Issues
Describe the Scenario
After installing Bookstack I'm open http://localhost:6875/ and get a blank page. I'm enable
APP_DEBUG=trueand getNext, I go to container and run
php artisan migrate:statusand getNext I try to run
php artisan migrategetAfter run
php artisan migrateagain getPlease help. Thanx.
Exact BookStack Version
v21.11.3
Log Content
laravel.log
error.log
error.log
PHP Version
7.4.26
Hosting Environment
Docker on Windows. Bookstack is installed with LinuxServer.io Docker image.
@ssddanbrown commented on GitHub (Dec 19, 2021):
Hi @alexgdi,
It looks like something may have gone wrong part way through a previous migration leaving the database in a state it can't migrate further upon.
We'd need to address the
Duplicate column name 'template'issue first, then re-run the migration ensuring any initial errors on re-run are caught since that may be the real reason things have gone wrong here.Do you have direct access to the database? The
templatecolumn on thepagestable needs to be dropped. Backup the database via a database dump beforehand.@alexgdi commented on GitHub (Dec 20, 2021):
and
ALTER TABLE pages DROP COLUMN template;working. Thank you! I wonder why this happened on a clean bookstack installation. There may be an error in the container image...@ssddanbrown commented on GitHub (Dec 21, 2021):
Oh, It was a clean install? That's very odd then, although I think I vaguely remember a similar case with a docker user. Might be some possible network through he container that occurred at that specific time? Who knows, hard to track something like that down.
Since it's now working I'll close this off.
@jamolnng commented on GitHub (Mar 11, 2022):
@ssddanbrown I also have this issue with docker, it seems that database/migrations/2019_07_07_112515_add_template_support.php:20 fails on install
SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'template' (SQL: alter table `pages` add `template` tinyint(1) not null default '0')this causes the program to exit and the tables to not be created, causing subsequent errors. Trying to manually fix, running
php artisan migrate:refreshcauses another crash at the same lineSQLSTATE[HY000] [2002] Connection refused (SQL: alter table `pages` add index `pages_template_index`(`template`))@ssddanbrown commented on GitHub (Mar 11, 2022):
@jamolnng
That command isn't intended to be used to fix this.
migrate:refreshcan cause loss of database data.If you need some level of support it'd be better to open a new support issue so we can gather details of your specific instance.
@jamolnng commented on GitHub (Mar 11, 2022):
@ssddanbrown
This is also a clean install from docker on Debian 11.2.0 amd64
This may be an issue with the way the linuxserver bookstack image is handling the install. Will go look there when I get a chance and open a ticket in whichever repository is causing the issue when i find out
@sdkcarlos commented on GitHub (Mar 17, 2022):
For anyone that's trying to test BookStack with Docker and is unable to make it work, this could be of help. I just launched a fresh instance of Docker Bookstack and found a similar issue. In my case, I wasn't able to login to the application, so I decided to run
php artisan migrateto fix the database schema, however the following error appeared:To solve it, I accessed the DB instance, opened MySQL and ran the following query to remove the column that already existed:
It seems as well that Laravel actually caches the config file, so I had to clean it as well because after removing the duplicated column and re-running the migration, I got another error:
I fixed it clearing the cache of the configuration files with:
php artisan config:clearFinally run the migration:
php artisan migrateIt should succeed now. I was able to access Bookstack using the default credentials
admin@admin.comandpassword.@Nicks182 commented on GitHub (Aug 17, 2022):
I know this is a closed issue, but I've been struggling with the exact same issue and getting the exact same error message with a clean setup using the docker containers I pulled today. If I do a search for '1146' under issues quite a few pop up and they are all marked as closed.
Not sure if this is a bookstack issue or a issue with the containers, but the issue seems to still be there either way.
I just wanted a quick local instance for some demo purposes and I'm using Windows 10. sdkcalos post above help me get around it, but I just wanted to make the devs aware. ;)
@ssddanbrown commented on GitHub (Aug 17, 2022):
@Nicks182
Likely related to https://github.com/linuxserver/docker-bookstack/issues/125
@Nicks182 commented on GitHub (Aug 17, 2022):
I see... obviously it's a windows issue. We would host it properly on Linux anyway. Sorry to bother and thank you.
@balalogic commented on GitHub (Dec 6, 2022):
Not sure if it's only a Windows issue. The problem occurs even on WSL2, where Docker is running within the WSL instance, rather than directly on Windows.
@balalogic commented on GitHub (Dec 6, 2022):
What I mean is that WSL2 uses a Linux VM running on HyperV. The Linux VM effectively isolates Windows from the VM. Docker is installed and running within the Linux VM rather than on the host. So broadly speaking, the error is not "Windows only"
@ssddanbrown commented on GitHub (Dec 6, 2022):
@balalogic Sure, but I don't think anyone has said it's a "Windows only" issue, but from what we've seen so far this has only seen to be an issue with windows involved. A Linux docker environment via WSL is not fully insulated from the host, extra layers of abstraction and adaption can always provide extra layers of complexity that can affect things.
@shaig4 commented on GitHub (Jun 30, 2023):
why nobody fix this bug reported 2 years ago?
@ssddanbrown commented on GitHub (Jun 30, 2023):
@shaig4 because this occurs in a particular complex stack of technologies where emulation is at play, and many of the software projects involved probably don't see this issue in scope of their support, like I effectively don't for BookStack.
@shaig4 commented on GitHub (Jul 5, 2023):
@ssddanbrown its happening when trying to run it by docker. Fresh without any mounts. Very common case
@ssddanbrown commented on GitHub (Jul 5, 2023):
@shaig4 Okay. If you find that the particular cause of the issue is within our project feel free to detail the issue within a fresh bug report here, otherwise I wouldn't look to add environment specific workarounds for what are likely external issues.
There are likely some alternative approaches you could likely take. I'd guess that running MySQL natively (out of docker) may help.
@garrettHensley commented on GitHub (Apr 25, 2024):
So then is the linuxserver.io install just completely broken then? I've ran into all of the issues above.
@ssddanbrown commented on GitHub (Apr 25, 2024):
@garrettHensley Nope, but you can run into issues if you have a specific combination of OS and volume storage option as mentioned in the discussions above.
@garrettHensley commented on GitHub (Apr 25, 2024):
Gotcha, makes sense I must fall into that category. I'm running into all the issues above from a clean install.
edit: Yeah, I was able to get it working using the workaround in the linked thread above. Thanks for all your hard work.