bookstack randomly returns "SQLSTATE[HY000] [1045] Access denied for user 'user'@'bookstack.netwrok' #1920

Closed
opened 2026-02-05 02:12:46 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @Shadikho on GitHub (Oct 27, 2020).

Hello all,
I have been running bookstack for more than a year now. I have used the following version in docker:
bookstack: solidnerd/bookstack:0.27.5
database: mysql:5.7.12
I'm running everything behind an nginx proxy using lets encrypt certificates. Nearly 2 months ago I started getting the "an unknown error occurred" in bookstack homepage (the bookstack logo was visible) I tried to upgrade bookstack, it didn't help. I then enabled debug mode and I started seeing that the following message is randomly produced.

SQLSTATE[HY000] [1045] Access denied for user 'user'@'bookstack.netwrok' ...

The odd behavior is sometimes when I get this error if I reload the page then it works, and I can go to the books section, then I choose a book and I get this error again, and if I reload 2 or 3 times it works again!!!! I tried granting all privileges to my user in the database but nothing seems to work. My docker-compose.yml file is as follow:

version: '2'
services:

  mysql:
    container_name: name-mysql
    restart: unless-stopped
    image: mysql:5.7.12
    environment:
    - PUID=1000
    - PGID=1000
    - MYSQL_ROOT_PASSWORD=rootpass
    - MYSQL_DATABASE=db
    - MYSQL_USER=user
    - MYSQL_PASSWORD=pass
    volumes:
    - /address/in/host:/var/lib/mysql
    ports:
    - 3307:3306

  bookstack:
    container_name: bookstack
    restart: unless-stopped
    image: solidnerd/bookstack:0.27.5
    depends_on:
    - mysql
    environment:
    - PUID=1000
    - PGID=1000
    - APP_ENV=production
    - APP_DEBUG=true
    - APP_URL=https://bookstack.domain.com
    - VIRTUAL_HOST=bookstack.domain.com
    - LETSENCRYPT_HOST=bookstack.domain.com
    - LETSENCRYPT_EMAIL=email@my.com
    #- WKHTMLTOPDF=
    - DB_HOST=mysql
    - DB_DATABASE=db
    - DB_USERNAME=user
    - DB_PASSWORD=pass
    volumes:
    - /address/in/host:/var/www/bookstack/.env
    - /address/in/host:/var/www/BookStack/public/uploads
    - /address/in/host:/var/www/BookStack/storage/uploads
    ports:
    - "6875:80"
    expose:
    - "6875"
networks:
    default:
       external:
         name: network

I would appreciate if somebody could help me here.

Originally created by @Shadikho on GitHub (Oct 27, 2020). Hello all, I have been running bookstack for more than a year now. I have used the following version in docker: bookstack: solidnerd/bookstack:0.27.5 database: mysql:5.7.12 I'm running everything behind an nginx proxy using lets encrypt certificates. Nearly 2 months ago I started getting the "an unknown error occurred" in bookstack homepage (the bookstack logo was visible) I tried to upgrade bookstack, it didn't help. I then enabled debug mode and I started seeing that the following message is randomly produced. `SQLSTATE[HY000] [1045] Access denied for user 'user'@'bookstack.netwrok' ...` The odd behavior is sometimes when I get this error if I reload the page then it works, and I can go to the books section, then I choose a book and I get this error again, and if I reload 2 or 3 times it works again!!!! I tried granting all privileges to my user in the database but nothing seems to work. My docker-compose.yml file is as follow: ``` version: '2' services: mysql: container_name: name-mysql restart: unless-stopped image: mysql:5.7.12 environment: - PUID=1000 - PGID=1000 - MYSQL_ROOT_PASSWORD=rootpass - MYSQL_DATABASE=db - MYSQL_USER=user - MYSQL_PASSWORD=pass volumes: - /address/in/host:/var/lib/mysql ports: - 3307:3306 bookstack: container_name: bookstack restart: unless-stopped image: solidnerd/bookstack:0.27.5 depends_on: - mysql environment: - PUID=1000 - PGID=1000 - APP_ENV=production - APP_DEBUG=true - APP_URL=https://bookstack.domain.com - VIRTUAL_HOST=bookstack.domain.com - LETSENCRYPT_HOST=bookstack.domain.com - LETSENCRYPT_EMAIL=email@my.com #- WKHTMLTOPDF= - DB_HOST=mysql - DB_DATABASE=db - DB_USERNAME=user - DB_PASSWORD=pass volumes: - /address/in/host:/var/www/bookstack/.env - /address/in/host:/var/www/BookStack/public/uploads - /address/in/host:/var/www/BookStack/storage/uploads ports: - "6875:80" expose: - "6875" networks: default: external: name: network ``` I would appreciate if somebody could help me here.
Author
Owner

@davidnateberg commented on GitHub (Dec 17, 2020):

Did you ever find a fix for this? Having the same issue after moving all the files onto a different server and re-pulling the images and trying to spin it back up again

@davidnateberg commented on GitHub (Dec 17, 2020): Did you ever find a fix for this? Having the same issue after moving all the files onto a different server and re-pulling the images and trying to spin it back up again
Author
Owner

@ssddanbrown commented on GitHub (Nov 25, 2021):

Since the last comment on this issue is relatively old I'm going to close this. If the issue remains and is something you still require to be fixed please open a new issue, referencing this one.

@ssddanbrown commented on GitHub (Nov 25, 2021): Since the last comment on this issue is relatively old I'm going to close this. If the issue remains and is something you still require to be fixed please open a new issue, referencing this one.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1920