Upgrading bookstack and bookstack_db from v22.10.2 (SQLSTATE[HY000] [1045] Access denied for user 'bookstack'@'bookstack.bookstack_default) #3741

Closed
opened 2026-02-05 07:19:02 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @AlfaJackal on GitHub (Apr 13, 2023).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

After executing
docker-compose pull
docker-compose up -d --remove-orphans
docker image prune

I then upgraded the database with mariadb-upgrade -u root -p. No errors.

Bookstack won't fire back up. Neither per domain (nginx) nor directly per ip:6875.

It has some issues accessing the db.

Phase 1/7: Checking and upgrading mysql database
Processing databases
mysql
mysql.column_stats                                 OK
mysql.columns_priv                                 OK
mysql.db                                           OK
mysql.event                                        OK
mysql.func                                         OK
mysql.global_priv                                  OK
mysql.gtid_slave_pos                               OK
mysql.help_category                                OK
mysql.help_keyword                                 OK
mysql.help_relation                                OK
mysql.help_topic                                   OK
mysql.index_stats                                  OK
mysql.innodb_index_stats                           OK
mysql.innodb_table_stats                           OK
mysql.plugin                                       OK
mysql.proc                                         OK
mysql.procs_priv                                   OK
mysql.proxies_priv                                 OK
mysql.roles_mapping                                OK
mysql.servers                                      OK
mysql.table_stats                                  OK
mysql.tables_priv                                  OK
mysql.time_zone                                    OK
mysql.time_zone_leap_second                        OK
mysql.time_zone_name                               OK
mysql.time_zone_transition                         OK
mysql.time_zone_transition_type                    OK
mysql.transaction_registry                         OK
Phase 2/7: Installing used storage engines... Skipped
Phase 3/7: Fixing views
mysql.user                                         OK
Phase 4/7: Running 'mysql_fix_privilege_tables'
Phase 5/7: Fixing table and database names
Phase 6/7: Checking and upgrading tables
Processing databases
bookstackapp
bookstackapp.activities                            OK
bookstackapp.api_tokens                            OK
bookstackapp.attachments                           OK
bookstackapp.books                                 OK
bookstackapp.bookshelves                           OK
bookstackapp.bookshelves_books                     OK
bookstackapp.cache                                 OK
bookstackapp.chapters                              OK
bookstackapp.comments                              OK
bookstackapp.deletions                             OK
bookstackapp.email_confirmations                   OK
bookstackapp.entity_permissions                    OK
bookstackapp.failed_jobs                           OK
bookstackapp.favourites                            OK
bookstackapp.images                                OK
bookstackapp.jobs                                  OK
bookstackapp.joint_permissions                     OK
bookstackapp.mfa_values                            OK
bookstackapp.migrations                            OK
bookstackapp.page_revisions                        OK
bookstackapp.pages                                 OK
bookstackapp.password_resets                       OK
bookstackapp.permission_role                       OK
bookstackapp.references                            OK
bookstackapp.role_permissions                      OK
bookstackapp.role_user                             OK
bookstackapp.roles                                 OK
bookstackapp.search_terms                          OK
bookstackapp.sessions                              OK
bookstackapp.settings                              OK
bookstackapp.social_accounts                       OK
bookstackapp.tags                                  OK
bookstackapp.user_invites                          OK
bookstackapp.users                                 OK
bookstackapp.views                                 OK
bookstackapp.webhook_tracked_events                OK
bookstackapp.webhooks                              OK
information_schema
performance_schema
sys
sys.sys_config                                     OK
Phase 7/7: Running 'FLUSH PRIVILEGES'
OK

This is my docker-compose.yaml:

---
version: "2"
services:
  bookstack:
    image: linuxserver/bookstack
    container_name: bookstack
    environment:
      - PUID=1000
      - PGID=1000
      - DB_HOST=bookstack_db
      - DB_USER=bookstack
      - DB_PASS=dbbookstack
      - DB_DATABASE=bookstackapp
      - APP_URL=https://bookstack.domain.com
    volumes:
      - /home/vm/bookstack:/config
    ports:
      - 6875:80
    restart: unless-stopped
    depends_on:
      - bookstack_db
  bookstack_db:
    image: linuxserver/mariadb
    container_name: bookstack_db
    environment:
      - PUID=1000
      - PGID=1000
      - MYSQL_ROOT_PASSWORD=dbbookstack
      - TZ=Europe/London
      - MYSQL_DATABASE=bookstackapp
      - MYSQL_USER=bookstack
      - MYSQL_PASSWORD=bookstack
    volumes:
      - /home/vaultgirl/mariadb:/config
    restart: unless-stopped

Exact BookStack Version

v23.02.3

Log Content

GID/UID
───────────────────────────────────────
User UID: 1000
User GID: 1000
───────────────────────────────────────
using keys found in /config/keys
App Key found - setting variable for seds
Running config - DB_HOST set
Waiting for DB to be available
Illuminate\Database\QueryException
SQLSTATE[HY000] [1045] Access denied for user 'bookstack'@'bookstack.bookstack_default' (using password: YES) (SQL: select * from information_schema.tables where table_schema = bookstackapp and table_name = migrations and table_type = 'BASE TABLE')
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▕ }
+36 vendor frames
37 /app/www/artisan:37
Illuminate\Foundation\Console\Kernel::handle()
**** The following active confs have different version dates than the samples that are shipped. ****
**** This may be due to user customization or an update to the samples. ****
**** You should compare the following files to the samples in the same folder and update them. ****
**** Use the link at the top of the file to view the changelog. ****
┌────────────┬────────────┬────────────────────────────────────────────────────────────────────────┐

│ old date │ new date │ path │

├────────────┼────────────┼────────────────────────────────────────────────────────────────────────┤

│ │ 2022-08-16 │ /config/nginx/nginx.conf │

│ 2018-03-06 │ 2022-10-04 │ /config/nginx/site-confs/default.conf │

└────────────┴────────────┴────────────────────────────────────────────────────────────────────────┘
[custom-init] No custom files found, skipping...
[ls.io-init] done.

PHP Version

No response

Hosting Environment

Proxmox with Ubuntu 22.10

Originally created by @AlfaJackal on GitHub (Apr 13, 2023). ### Attempted Debugging - [X] I have read the debugging page ### Searched GitHub Issues - [X] I have searched GitHub for the issue. ### Describe the Scenario After executing `docker-compose pull` `docker-compose up -d --remove-orphans` `docker image prune` I then upgraded the database with `mariadb-upgrade -u root -p`. No errors. Bookstack won't fire back up. Neither per domain (nginx) nor directly per ip:6875. It has some issues accessing the db. ``` Phase 1/7: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK mysql.columns_priv OK mysql.db OK mysql.event OK mysql.func OK mysql.global_priv OK mysql.gtid_slave_pos OK mysql.help_category OK mysql.help_keyword OK mysql.help_relation OK mysql.help_topic OK mysql.index_stats OK mysql.innodb_index_stats OK mysql.innodb_table_stats OK mysql.plugin OK mysql.proc OK mysql.procs_priv OK mysql.proxies_priv OK mysql.roles_mapping OK mysql.servers OK mysql.table_stats OK mysql.tables_priv OK mysql.time_zone OK mysql.time_zone_leap_second OK mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.transaction_registry OK Phase 2/7: Installing used storage engines... Skipped Phase 3/7: Fixing views mysql.user OK Phase 4/7: Running 'mysql_fix_privilege_tables' Phase 5/7: Fixing table and database names Phase 6/7: Checking and upgrading tables Processing databases bookstackapp bookstackapp.activities OK bookstackapp.api_tokens OK bookstackapp.attachments OK bookstackapp.books OK bookstackapp.bookshelves OK bookstackapp.bookshelves_books OK bookstackapp.cache OK bookstackapp.chapters OK bookstackapp.comments OK bookstackapp.deletions OK bookstackapp.email_confirmations OK bookstackapp.entity_permissions OK bookstackapp.failed_jobs OK bookstackapp.favourites OK bookstackapp.images OK bookstackapp.jobs OK bookstackapp.joint_permissions OK bookstackapp.mfa_values OK bookstackapp.migrations OK bookstackapp.page_revisions OK bookstackapp.pages OK bookstackapp.password_resets OK bookstackapp.permission_role OK bookstackapp.references OK bookstackapp.role_permissions OK bookstackapp.role_user OK bookstackapp.roles OK bookstackapp.search_terms OK bookstackapp.sessions OK bookstackapp.settings OK bookstackapp.social_accounts OK bookstackapp.tags OK bookstackapp.user_invites OK bookstackapp.users OK bookstackapp.views OK bookstackapp.webhook_tracked_events OK bookstackapp.webhooks OK information_schema performance_schema sys sys.sys_config OK Phase 7/7: Running 'FLUSH PRIVILEGES' OK ``` This is my docker-compose.yaml: ``` --- version: "2" services: bookstack: image: linuxserver/bookstack container_name: bookstack environment: - PUID=1000 - PGID=1000 - DB_HOST=bookstack_db - DB_USER=bookstack - DB_PASS=dbbookstack - DB_DATABASE=bookstackapp - APP_URL=https://bookstack.domain.com volumes: - /home/vm/bookstack:/config ports: - 6875:80 restart: unless-stopped depends_on: - bookstack_db bookstack_db: image: linuxserver/mariadb container_name: bookstack_db environment: - PUID=1000 - PGID=1000 - MYSQL_ROOT_PASSWORD=dbbookstack - TZ=Europe/London - MYSQL_DATABASE=bookstackapp - MYSQL_USER=bookstack - MYSQL_PASSWORD=bookstack volumes: - /home/vaultgirl/mariadb:/config restart: unless-stopped ``` ### Exact BookStack Version v23.02.3 ### Log Content GID/UID ─────────────────────────────────────── User UID: 1000 User GID: 1000 ─────────────────────────────────────── using keys found in /config/keys App Key found - setting variable for seds Running config - DB_HOST set Waiting for DB to be available Illuminate\Database\QueryException SQLSTATE[HY000] [1045] Access denied for user 'bookstack'@'bookstack.bookstack_default' (using password: YES) (SQL: select * from information_schema.tables where table_schema = bookstackapp and table_name = migrations and table_type = 'BASE TABLE') 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▕ } +36 vendor frames 37 /app/www/artisan:37 Illuminate\Foundation\Console\Kernel::handle() **** The following active confs have different version dates than the samples that are shipped. **** **** This may be due to user customization or an update to the samples. **** **** You should compare the following files to the samples in the same folder and update them. **** **** Use the link at the top of the file to view the changelog. **** ┌────────────┬────────────┬────────────────────────────────────────────────────────────────────────┐ │ old date │ new date │ path │ ├────────────┼────────────┼────────────────────────────────────────────────────────────────────────┤ │ │ 2022-08-16 │ /config/nginx/nginx.conf │ │ 2018-03-06 │ 2022-10-04 │ /config/nginx/site-confs/default.conf │ └────────────┴────────────┴────────────────────────────────────────────────────────────────────────┘ [custom-init] No custom files found, skipping... [ls.io-init] done. ### PHP Version _No response_ ### Hosting Environment Proxmox with Ubuntu 22.10
OVERLORD added the 🐕 Support label 2026-02-05 07:19:02 +03:00
Author
Owner

@AlfaJackal commented on GitHub (Apr 13, 2023):

I am stupid: Don't know why but password was different - I couldn't see the forest for the trees.

@AlfaJackal commented on GitHub (Apr 13, 2023): I am stupid: Don't know why but password was different - I couldn't see the forest for the trees.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#3741