Run to error while login #183

Closed
opened 2026-02-04 17:28:45 +03:00 by OVERLORD · 10 comments
Owner

Originally created by @CordlessWool on GitHub (Oct 19, 2016).

For Feature Requests

Desired Feature: Login

For Bug Reports

PHP Version: officle Docker container, php version 7.0

MySQL Version: 5.7

Expected Behavior:

Actual Behavior:
When I am try to loggin, some times I get an error message that runs something wrong (today it was first login after restarting the server). One time I replace the docker container with a new one, I was not able to Login again. I had to make a database dump and recreate the database with default user to get it work again.

Greate work till now, thanks

Originally created by @CordlessWool on GitHub (Oct 19, 2016). ### For Feature Requests Desired Feature: Login ### For Bug Reports PHP Version: officle Docker container, php version 7.0 MySQL Version: 5.7 Expected Behavior: Actual Behavior: When I am try to loggin, some times I get an error message that runs something wrong (today it was first login after restarting the server). One time I replace the docker container with a new one, I was not able to Login again. I had to make a database dump and recreate the database with default user to get it work again. Greate work till now, thanks
OVERLORD added the 🐕 Support label 2026-02-04 17:28:45 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Oct 19, 2016):

Hi @CordlessWool,
Sorry to hear you are having issues. You mentioned using a docker container. Could you please provide more details about your setup. Are you running a specific docker setup for BookStack or is it something you've configured yourself?

Are you using a docker-compose setup or are you connecting containers manually?

Do you have any additional information on the errors, Is there anything in the logs?
This page has some information about debugging BookStack to find issues.

@ssddanbrown commented on GitHub (Oct 19, 2016): Hi @CordlessWool, Sorry to hear you are having issues. You mentioned using a docker container. Could you please provide more details about your setup. Are you running a specific docker setup for BookStack or is it something you've configured yourself? Are you using a docker-compose setup or are you connecting containers manually? Do you have any additional information on the errors, Is there anything in the logs? [This page](https://www.bookstackapp.com/docs/admin/debugging) has some information about debugging BookStack to find issues.
Author
Owner

@CordlessWool commented on GitHub (Oct 21, 2016):

Hi ssddanbrown,

I set it up with docker container from solidnerd: https://github.com/solidnerd/docker-bookstack
I connect container manually. I have a nginx container in front.

Bookstack hardly crashed when I replace the bookstack container. After replacement I could not loggin anymore and I had to recreate the database schema. I do not know if the last one was an issue of the container or bookstack its self.

Right now the error message appers only sometimes and by the secound try to login it works.

@CordlessWool commented on GitHub (Oct 21, 2016): Hi ssddanbrown, I set it up with docker container from solidnerd: https://github.com/solidnerd/docker-bookstack I connect container manually. I have a nginx container in front. Bookstack hardly crashed when I replace the bookstack container. After replacement I could not loggin anymore and I had to recreate the database schema. I do not know if the last one was an issue of the container or bookstack its self. Right now the error message appers only sometimes and by the secound try to login it works.
Author
Owner

@ssddanbrown commented on GitHub (Oct 23, 2016):

Hi @CordlessWool,

  • Are you defining any volumes when creating your database container?
  • Are you using the same DB container for any other applications and, if so, is the data for those also going missing?
@ssddanbrown commented on GitHub (Oct 23, 2016): Hi @CordlessWool, - Are you defining any volumes when creating your database container? - Are you using the same DB container for any other applications and, if so, is the data for those also going missing?
Author
Owner

@CordlessWool commented on GitHub (Oct 31, 2016):

Hi @ssddanbrown,

the database container has no volumn to host system or others system that are not defined by default. I am using the regular MySQL:5.7 container.

I also use the database container for other database, each get a seperated user.

The bookstack data are not lost. Only problem is logging in after replace the container.
I re-setup the whole server this weekend and make a database dump before this.

I tested following scenarios:

  1. When I created the schema before starting the bookstack container it try to login. It also rember the login, because when I recall the site I get only error message and no login prompt. After restarting the container I get the login prompt again, but after trying to login its the same as before.
  2. I start the container and let the container create tables. Login in with default user works. I inserted all old data from the dump to the database (also user table) and have the same issue as in point 1.
  3. I start the container like in point 2, but inserted all data without the table with user login data. Login in with default user works. I could create users read article, also the roles existing. I created the users like I do on old system, all works fine again.

It seems the new instance of bookstack has problems after decrypt the passwords of existing users from old instance. Are there informations about users saved outside the database?

@CordlessWool commented on GitHub (Oct 31, 2016): Hi @ssddanbrown, the database container has no volumn to host system or others system that are not defined by default. I am using the regular MySQL:5.7 container. I also use the database container for other database, each get a seperated user. The bookstack data are not lost. Only problem is logging in after replace the container. I re-setup the whole server this weekend and make a database dump before this. I tested following scenarios: 1. When I created the schema before starting the bookstack container it try to login. It also rember the login, because when I recall the site I get only error message and no login prompt. After restarting the container I get the login prompt again, but after trying to login its the same as before. 2. I start the container and let the container create tables. Login in with default user works. I inserted all old data from the dump to the database (also user table) and have the same issue as in point 1. 3. I start the container like in point 2, but inserted all data without the table with user login data. Login in with default user works. I could create users read article, also the roles existing. I created the users like I do on old system, all works fine again. It seems the new instance of bookstack has problems after decrypt the passwords of existing users from old instance. Are there informations about users saved outside the database?
Author
Owner

@ssddanbrown commented on GitHub (Nov 1, 2016):

Hi @CordlessWool,
As long as the database persists login passwords should remain okay. The only thing related to users that are not saved in the database are the user sessions.

I've tried to replicate this by doing the following actions:

  1. Create a BookStack instance via docker.
  2. Login in as a user.
  3. Stop and delete the BookStack and database container.
  4. Re-run the containers, using the same database data persisted from the containers before.
  5. Log in again.

In the above scenario there were no problems with logging in. My login sessions was not remembered due to the sessions data being destroyed but that's as expected.

Can you possibly produce some easy-to-follow instructions that replicate the error in your scenario 1?

@ssddanbrown commented on GitHub (Nov 1, 2016): Hi @CordlessWool, As long as the database persists login passwords should remain okay. The only thing related to users that are not saved in the database are the user sessions. I've tried to replicate this by doing the following actions: 1. Create a BookStack instance via docker. 2. Login in as a user. 3. Stop and delete the BookStack and database container. 4. Re-run the containers, using the same database data persisted from the containers before. 5. Log in again. In the above scenario there were no problems with logging in. My login sessions was not remembered due to the sessions data being destroyed but that's as expected. Can you possibly produce some easy-to-follow instructions that replicate the error in your scenario 1?
Author
Owner

@CordlessWool commented on GitHub (Nov 10, 2016):

Hi @ssddanbrown

the steps i do before I reset my server:

  1. start database container
  2. create database schema for bookstack
  3. create user which can only access bookstack data
    3a. give user all rights on shema without grant option
  4. start bookstack container with data of database conection
  5. create a new role in bookstack and an new user
    5a. change data of default user (email and password)
  6. create a book and write something
  7. stop and remove bookstack container
  8. start a new container with some command as at point 4.
    !!!! At this point I could not login again. But I go on..
  9. create dump of all tables in bookstack schema

then I replace harddriver of my server an set it up complitly new. But thats not needed to run in the issue.
10. set up database container, user and schema like in 1,2,3,3a
11. write dump to bookstack schema. (create tables and insert data)
12. create and start bookstack container link in point 4 and 8
!!! i could not login

What does work is (after had make a dump):
13. set up database container like in point 10.
14 start bookstack container and let it create tables.
15. insert dump without the table with userdata (username and password) (only overwrite data)
16. login in with default user
17. create new user like in 5.

Now all books and sites created by "old user" are matched to the new user.

Hope this will help.

@CordlessWool commented on GitHub (Nov 10, 2016): Hi @ssddanbrown the steps i do before I reset my server: 1. start database container 2. create database schema for bookstack 3. create user which can only access bookstack data 3a. give user all rights on shema without grant option 4. start bookstack container with data of database conection 5. create a new role in bookstack and an new user 5a. change data of default user (email and password) 6. create a book and write something 7. stop and remove bookstack container 8. start a new container with some command as at point 4. !!!! At this point I could not login again. But I go on.. 9. create dump of all tables in bookstack schema then I replace harddriver of my server an set it up complitly new. But thats not needed to run in the issue. 10. set up database container, user and schema like in 1,2,3,3a 11. write dump to bookstack schema. (create tables and insert data) 12. create and start bookstack container link in point 4 and 8 !!! i could not login What does work is (after had make a dump): 13. set up database container like in point 10. 14 start bookstack container and let it create tables. 15. insert dump without the table with userdata (username and password) (only overwrite data) 16. login in with default user 17. create new user like in 5. Now all books and sites created by "old user" are matched to the new user. Hope this will help.
Author
Owner

@CordlessWool commented on GitHub (Dec 3, 2016):

Hi @ssddanbrown,

i have some error at new version 0.13.1, but if I do the steps I done with release 0.12.1 I get an error after restarting the container:

  [Illuminate\Database\QueryException]                                                                                                                
  SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'hidden'; check that column/key exists (SQL: alter table `roles` drop `hidden`)  
                                                                                                                                                      

                                                                                                             
  [PDOException]                                                                                             
  SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'hidden'; check that column/key exists 

I inserted a dump from version 0.12.1

When I migrated the data from from 0.12.1 to 0.13.1 directly I have same old error.

To update to 0.13.1 I make the steps till 16 with bookstack verion 0.12.1 in the post before and then I migrate to 0.13.1 then I create new users. Now it runs.

For testing I try to run a new container version 0.13.1 on the data and have the same issue like with 0.12.1

hope that will help

@CordlessWool commented on GitHub (Dec 3, 2016): Hi @ssddanbrown, i have some error at new version 0.13.1, but if I do the steps I done with release 0.12.1 I get an error after restarting the container: ``` [Illuminate\Database\QueryException] SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'hidden'; check that column/key exists (SQL: alter table `roles` drop `hidden`) [PDOException] SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'hidden'; check that column/key exists ``` I inserted a dump from version 0.12.1 When I migrated the data from from 0.12.1 to 0.13.1 directly I have same old error. To update to 0.13.1 I make the steps till 16 with bookstack verion 0.12.1 in the post before and then I migrate to 0.13.1 then I create new users. Now it runs. For testing I try to run a new container version 0.13.1 on the data and have the same issue like with 0.12.1 hope that will help
Author
Owner

@ssddanbrown commented on GitHub (Dec 3, 2016):

Hi @CordlessWool,

Many of the above issues seem like they could be related to database persistence. Have you tried testing the default docker-compose setup (from the solidnerd/docker-bookstack) and seeing if you can replicate the same issues on that?

@ssddanbrown commented on GitHub (Dec 3, 2016): Hi @CordlessWool, Many of the above issues seem like they could be related to database persistence. Have you tried testing the default docker-compose setup (from the solidnerd/docker-bookstack) and seeing if you can replicate the same issues on that?
Author
Owner

@ssddanbrown commented on GitHub (Jan 30, 2017):

Closing due to lack of response. Feel free to still answer the above and I'll happily re-open this.

@ssddanbrown commented on GitHub (Jan 30, 2017): Closing due to lack of response. Feel free to still answer the above and I'll happily re-open this.
Author
Owner

@RoccoZ9 commented on GitHub (Dec 4, 2023):

Hi i'm using the linuxserver/bookstack to have bookstack i copy and paste the docker compose after add the column that in my log in bookstack said that i do not have i have this error SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'type' (SQL: ALTER TABLE activities CHANGE key type INT DEFAULT NULL)
2023-12-04 10:27:38
2023-12-04 10:27:38 at /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php:760
2023-12-04 10:27:38 756▕ // If an exception occurs when attempting to run a query, we'll format the error
2023-12-04 10:27:38 757▕ // message to include the bindings with SQL, which will make this exception a
2023-12-04 10:27:38 758▕ // lot more helpful to the developer instead of just the database's errors.
2023-12-04 10:27:38 759▕ catch (Exception $e) {
2023-12-04 10:27:38 ➜ 760▕ throw new QueryException(
2023-12-04 10:27:38 761▕ $query, $this->prepareBindings($bindings), $e
2023-12-04 10:27:38 762▕ );
2023-12-04 10:27:38 763▕ }
2023-12-04 10:27:38 764▕ }
2023-12-04 10:27:38
2023-12-04 10:27:38 +9 vendor frames
2023-12-04 10:27:38 10 /app/www/database/migrations/2020_11_07_232321_simplify_activities_table.php:17
2023-12-04 10:27:38 Illuminate\Support\Facades\Facade::__callStatic()
2023-12-04 10:27:38
2023-12-04 10:27:38 +25 vendor frames
2023-12-04 10:27:38 36 /app/www/artisan:35
2023-12-04 10:27:38 Illuminate\Foundation\Console\Kernel::handle()
2023-12-04 10:27:38 [custom-init] No custom files found, skipping...
2023-12-04 10:27:38 [ls.io-init] done. I have try to change key in boolean and varchar no difference so what i need to do?

@RoccoZ9 commented on GitHub (Dec 4, 2023): Hi i'm using the linuxserver/bookstack to have bookstack i copy and paste the docker compose after add the column that in my log in bookstack said that i do not have i have this error SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'type' (SQL: ALTER TABLE activities CHANGE `key` type INT DEFAULT NULL) 2023-12-04 10:27:38 2023-12-04 10:27:38 at /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php:760 2023-12-04 10:27:38 756▕ // If an exception occurs when attempting to run a query, we'll format the error 2023-12-04 10:27:38 757▕ // message to include the bindings with SQL, which will make this exception a 2023-12-04 10:27:38 758▕ // lot more helpful to the developer instead of just the database's errors. 2023-12-04 10:27:38 759▕ catch (Exception $e) { 2023-12-04 10:27:38 ➜ 760▕ throw new QueryException( 2023-12-04 10:27:38 761▕ $query, $this->prepareBindings($bindings), $e 2023-12-04 10:27:38 762▕ ); 2023-12-04 10:27:38 763▕ } 2023-12-04 10:27:38 764▕ } 2023-12-04 10:27:38 2023-12-04 10:27:38 +9 vendor frames 2023-12-04 10:27:38 10 /app/www/database/migrations/2020_11_07_232321_simplify_activities_table.php:17 2023-12-04 10:27:38 Illuminate\Support\Facades\Facade::__callStatic() 2023-12-04 10:27:38 2023-12-04 10:27:38 +25 vendor frames 2023-12-04 10:27:38 36 /app/www/artisan:35 2023-12-04 10:27:38 Illuminate\Foundation\Console\Kernel::handle() 2023-12-04 10:27:38 [custom-init] No custom files found, skipping... 2023-12-04 10:27:38 [ls.io-init] done. I have try to change key in boolean and varchar no difference so what i need to do?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#183