SQLSTATE[HY000] [2002] Connection refused (SQL: alter table pages add index pages_template_index(template)) #4250

Closed
opened 2026-02-05 08:21:16 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @Dhaigvip on GitHub (Sep 29, 2023).

Describe the Bug

Hi, we are evaluating bookstack for managing our help content.
I installed book stack using following docker images -

  1. lscr.io/linuxserver/bookstack:latest
  2. lscr.io/linuxserver/mariadb:latest

The containers is running succesfully, however I see an error in bookstack container, please note that this is a fresh install.
Also, I tried connecting MariaDB from bookstack container and connection works. So, I am surprised to see connection refused error.

2023-09-29 12:39:40   SQLSTATE[HY000] [2002] Connection refused (SQL: alter table `pages` add index `pages_template_index`(`template`))
2023-09-29 12:39:40 
2023-09-29 12:39:40   at /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php:760
2023-09-29 12:39:40     756▕         // If an exception occurs when attempting to run a query, we'll format the error
2023-09-29 12:39:40     757▕         // message to include the bindings with SQL, which will make this exception a
2023-09-29 12:39:40     758▕         // lot more helpful to the developer instead of just the database's errors.
2023-09-29 12:39:40     759▕         catch (Exception $e) {
2023-09-29 12:39:40   ➜ 760▕             throw new QueryException(
2023-09-29 12:39:40     761▕                 $query, $this->prepareBindings($bindings), $e
2023-09-29 12:39:40     762▕             );
2023-09-29 12:39:40     763▕         }
2023-09-29 12:39:40     764▕     }
2023-09-29 12:39:40

Steps to Reproduce

Install bookstack using docker images-

  1. lscr.io/linuxserver/bookstack:latest
  2. lscr.io/linuxserver/mariadb:latest

Expected Behaviour

The fresh installation should work without any error.

Screenshots or Additional Context

Bookstack docker conatainer should be running without any changes to database for fresh installation.

Browser Details

Google Chrome 117.0.5938.92

Exact BookStack Version

V23.6

Originally created by @Dhaigvip on GitHub (Sep 29, 2023). ### Describe the Bug Hi, we are evaluating bookstack for managing our help content. I installed book stack using following docker images - 1. lscr.io/linuxserver/bookstack:latest 2. lscr.io/linuxserver/mariadb:latest The containers is running succesfully, however I see an error in bookstack container, please note that this is a fresh install. Also, I tried connecting MariaDB from bookstack container and connection works. So, I am surprised to see connection refused error. ``` 2023-09-29 12:39:40 SQLSTATE[HY000] [2002] Connection refused (SQL: alter table `pages` add index `pages_template_index`(`template`)) 2023-09-29 12:39:40 2023-09-29 12:39:40 at /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php:760 2023-09-29 12:39:40 756▕ // If an exception occurs when attempting to run a query, we'll format the error 2023-09-29 12:39:40 757▕ // message to include the bindings with SQL, which will make this exception a 2023-09-29 12:39:40 758▕ // lot more helpful to the developer instead of just the database's errors. 2023-09-29 12:39:40 759▕ catch (Exception $e) { 2023-09-29 12:39:40 ➜ 760▕ throw new QueryException( 2023-09-29 12:39:40 761▕ $query, $this->prepareBindings($bindings), $e 2023-09-29 12:39:40 762▕ ); 2023-09-29 12:39:40 763▕ } 2023-09-29 12:39:40 764▕ } 2023-09-29 12:39:40 ``` ### Steps to Reproduce Install bookstack using docker images- 1. lscr.io/linuxserver/bookstack:latest 2. lscr.io/linuxserver/mariadb:latest ### Expected Behaviour The fresh installation should work without any error. ### Screenshots or Additional Context Bookstack docker conatainer should be running without any changes to database for fresh installation. ### Browser Details Google Chrome 117.0.5938.92 ### Exact BookStack Version V23.6
OVERLORD added the 🐛 Bug label 2026-02-05 08:21:16 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Sep 29, 2023):

Hi @Dhaigvip,
Can you confirm what operating system your docker host is running?

@ssddanbrown commented on GitHub (Sep 29, 2023): Hi @Dhaigvip, Can you confirm what operating system your docker host is running?
Author
Owner

@Dhaigvip commented on GitHub (Sep 29, 2023):

Can you confirm what operating system your docker host is running?

Hi, I am running it on windows 10

@Dhaigvip commented on GitHub (Sep 29, 2023): > Can you confirm what operating system your docker host is running? Hi, I am running it on windows 10
Author
Owner

@ssddanbrown commented on GitHub (Sep 29, 2023):

I that case, you're likely running into the issues found in https://github.com/linuxserver/docker-bookstack/issues/125, with unstable behaviour of database activity when database volumes are mounted to host locations on windows hosts.

Not really a problem I see on the BookStack side to be honest (Nor a problem for the linuxserver team either).
You can try looking for solutions in that thread (Alternative database container image or alternative handling of volume locations).

@ssddanbrown commented on GitHub (Sep 29, 2023): I that case, you're likely running into the issues found in https://github.com/linuxserver/docker-bookstack/issues/125, with unstable behaviour of database activity when database volumes are mounted to host locations on windows hosts. Not really a problem I see on the BookStack side to be honest (Nor a problem for the linuxserver team either). You can try looking for solutions in that thread (Alternative database container image or alternative handling of volume locations).
Author
Owner

@ssddanbrown commented on GitHub (Oct 14, 2023):

Since there's been no further discussion here I'll close this off.

@ssddanbrown commented on GitHub (Oct 14, 2023): Since there's been no further discussion here I'll close this off.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#4250