-
-
Notifications
You must be signed in to change notification settings - Fork 132
Closed
Labels
Description
Expected Behavior
Bookstack should start on a clean environment.
Current Behavior
Bookstack fails to run migrations, and thus fails to start the application.
bookstack | Migrating: 2018_08_04_115700_create_bookshelves_table
bookstack | Migrated: 2018_08_04_115700_create_bookshelves_table (1,288.78ms)
bookstack | Migrating: 2019_07_07_112515_add_template_support
bookstack |
bookstack | Illuminate\Database\QueryException
bookstack |
bookstack | SQLSTATE[HY000] [2002] Connection refused (SQL: alter table `pages` add index `pages_template_index`(`template`))
bookstack |
bookstack | at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:712
bookstack | 708▕ // If an exception occurs when attempting to run a query, we'll format the error
bookstack | 709▕ // message to include the bindings with SQL, which will make this exception a
bookstack | 710▕ // lot more helpful to the developer instead of just the database's errors.
bookstack | 711▕ catch (Exception $e) {
bookstack | ➜ 712▕ throw new QueryException(
bookstack | 713▕ $query, $this->prepareBindings($bindings), $e
bookstack | 714▕ );
bookstack | 715▕ }
bookstack | 716▕ }
bookstack |
bookstack | +18 vendor frames
bookstack | 19 /var/www/html/database/migrations/2019_07_07_112515_add_template_support.php:20
bookstack | Illuminate\Support\Facades\Facade::__callStatic()
bookstack |
bookstack | +22 vendor frames
bookstack | 42 /var/www/html/artisan:37
bookstack | Illuminate\Foundation\Console\Kernel::handle()
bookstack | [cont-init.d] 50-config: exited 0.
bookstack | [cont-init.d] 90-custom-folders: executing...
bookstack | [cont-init.d] 90-custom-folders: exited 0.
bookstack | [cont-init.d] 99-custom-files: executing...
bookstack | [custom-init] no custom files found exiting...
bookstack | [cont-init.d] 99-custom-files: exited 0.
bookstack | [cont-init.d] done.
bookstack | [services.d] starting services
bookstack | [services.d] done.
Steps to Reproduce
- create docker-compose.yaml file:
---
version: "2"
services:
bookstack:
image: lscr.io/linuxserver/bookstack
container_name: bookstack
environment:
- PUID=1000
- PGID=1000
- APP_URL=
- DB_HOST=bookstack_db
- DB_USER=bookstack
- DB_PASS=<yourdbpass>
- DB_DATABASE=bookstackapp
volumes:
- /path/to/data:/config
ports:
- 6875:80
restart: unless-stopped
depends_on:
- bookstack_db
bookstack_db:
image: lscr.io/linuxserver/mariadb
container_name: bookstack_db
environment:
- PUID=1000
- PGID=1000
- MYSQL_ROOT_PASSWORD=<yourdbpass>
- TZ=Europe/London
- MYSQL_DATABASE=bookstackapp
- MYSQL_USER=bookstack
- MYSQL_PASSWORD=<yourdbpass>
volumes:
- /path/to/data:/config
restart: unless-stopped
- docker-compose up
Environment
OS: Windows 11
CPU architecture: x86_64
How docker service was installed: Docker Desktop
Command used to create docker container (run/create/compose/screenshot)
compose as seen above.
Docker logs
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing...
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 02-tamper-check: executing...
[cont-init.d] 02-tamper-check: exited 0.
[cont-init.d] 10-adduser: executing...
usermod: no changes
-------------------------------------
_ ()
| | ___ _ __
| | / __| | | / \
| | \__ \ | | | () |
|_| |___/ |_| \__/
Brought to you by linuxserver.io
-------------------------------------
To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------
User uid: 1000
User gid: 1000
-------------------------------------
[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 20-config: executing...
[cont-init.d] 20-config: exited 0.
[cont-init.d] 30-keygen: executing...
generating self-signed keys in /config/keys, you can replace these with your own keys if required
Generating a RSA private key
.........................+++++
......+++++
writing new private key to '/config/keys/cert.key'
-----
[cont-init.d] 30-keygen: exited 0.
[cont-init.d] 50-config: executing...
Generating BookStack app key for first run
App Key set to base64:4wwkR78IDF3a6ADF+piwCT1NGrzpxjRwpuU7SQXsedI= you can modify the file to update /config/BOOKSTACK_APP_KEY.txt
Running config - db_user set
**** Docker env var APP_URL is not set, setting it to http://37.190.246.141:6875 ****
**** APP_URL in /config/www/.env is being updated from https://example.com to http://37.190.246.141:6875 ****
**** If this is an existing install, you should run the following line from your host terminal to update the database URL entries: ****
************************************************************************
docker exec -it bookstack php /var/www/html/artisan bookstack:update-url https://example.com http://37.190.246.141:6875
************************************************************************
/var/run/s6/etc/cont-init.d/50-config: line 98: warning: command substitution: ignored null byte in input
/var/run/s6/etc/cont-init.d/50-config: line 98: warning: command substitution: ignored null byte in input
Migration table created successfully.
Migrating: 2014_10_12_000000_create_users_table
Migrated: 2014_10_12_000000_create_users_table (281.85ms)
Migrating: 2014_10_12_100000_create_password_resets_table
Migrated: 2014_10_12_100000_create_password_resets_table (126.82ms)
Migrating: 2015_07_12_114933_create_books_table
Migrated: 2015_07_12_114933_create_books_table (39.22ms)
Migrating: 2015_07_12_190027_create_pages_table
Migrated: 2015_07_12_190027_create_pages_table (35.55ms)
Migrating: 2015_07_13_172121_create_images_table
Migrated: 2015_07_13_172121_create_images_table (31.96ms)
Migrating: 2015_07_27_172342_create_chapters_table
Migrated: 2015_07_27_172342_create_chapters_table (29.59ms)
Migrating: 2015_08_08_200447_add_users_to_entities
Migrated: 2015_08_08_200447_add_users_to_entities (110.03ms)
Migrating: 2015_08_09_093534_create_page_revisions_table
Migrated: 2015_08_09_093534_create_page_revisions_table (28.35ms)
Migrating: 2015_08_16_142133_create_activities_table
Migrated: 2015_08_16_142133_create_activities_table (26.12ms)
Migrating: 2015_08_29_105422_add_roles_and_permissions
Migrated: 2015_08_29_105422_add_roles_and_permissions (1,094.71ms)
Migrating: 2015_08_30_125859_create_settings_table
Migrated: 2015_08_30_125859_create_settings_table (130.09ms)
Migrating: 2015_08_31_175240_add_search_indexes
Migrated: 2015_08_31_175240_add_search_indexes (0.13ms)
Migrating: 2015_09_04_165821_create_social_accounts_table
Migrated: 2015_09_04_165821_create_social_accounts_table (109.35ms)
Migrating: 2015_09_05_164707_add_email_confirmation_table
Migrated: 2015_09_05_164707_add_email_confirmation_table (195.80ms)
Migrating: 2015_11_21_145609_create_views_table
Migrated: 2015_11_21_145609_create_views_table (40.72ms)
Migrating: 2015_11_26_221857_add_entity_indexes
Migrated: 2015_11_26_221857_add_entity_indexes (834.95ms)
Migrating: 2015_12_05_145049_fulltext_weighting
Migrated: 2015_12_05_145049_fulltext_weighting (0.11ms)
Migrating: 2015_12_07_195238_add_image_upload_types
Migrated: 2015_12_07_195238_add_image_upload_types (148.84ms)
Migrating: 2015_12_09_195748_add_user_avatars
Migrated: 2015_12_09_195748_add_user_avatars (31.21ms)
Migrating: 2016_01_11_210908_add_external_auth_to_users
Migrated: 2016_01_11_210908_add_external_auth_to_users (66.68ms)
Migrating: 2016_02_25_184030_add_slug_to_revisions
Migrated: 2016_02_25_184030_add_slug_to_revisions (86.12ms)
Migrating: 2016_02_27_120329_update_permissions_and_roles
Migrated: 2016_02_27_120329_update_permissions_and_roles (179.57ms)
Migrating: 2016_02_28_084200_add_entity_access_controls
Migrated: 2016_02_28_084200_add_entity_access_controls (367.52ms)
Migrating: 2016_03_09_203143_add_page_revision_types
Migrated: 2016_03_09_203143_add_page_revision_types (74.73ms)
Migrating: 2016_03_13_082138_add_page_drafts
Migrated: 2016_03_13_082138_add_page_drafts (79.42ms)
Migrating: 2016_03_25_123157_add_markdown_support
Migrated: 2016_03_25_123157_add_markdown_support (61.43ms)
Migrating: 2016_04_09_100730_add_view_permissions_to_roles
Migrated: 2016_04_09_100730_add_view_permissions_to_roles (79.53ms)
Migrating: 2016_04_20_192649_create_joint_permissions_table
Migrated: 2016_04_20_192649_create_joint_permissions_table (500.34ms)
Migrating: 2016_05_06_185215_create_tags_table
Migrated: 2016_05_06_185215_create_tags_table (214.33ms)
Migrating: 2016_07_07_181521_add_summary_to_page_revisions
Migrated: 2016_07_07_181521_add_summary_to_page_revisions (31.25ms)
Migrating: 2016_09_29_101449_remove_hidden_roles
Migrated: 2016_09_29_101449_remove_hidden_roles (140.57ms)
Migrating: 2016_10_09_142037_create_attachments_table
Migrated: 2016_10_09_142037_create_attachments_table (137.61ms)
Migrating: 2017_01_21_163556_create_cache_table
Migrated: 2017_01_21_163556_create_cache_table (111.10ms)
Migrating: 2017_01_21_163602_create_sessions_table
Migrated: 2017_01_21_163602_create_sessions_table (113.43ms)
Migrating: 2017_03_19_091553_create_search_index_table
Migrated: 2017_03_19_091553_create_search_index_table (424.12ms)
Migrating: 2017_04_20_185112_add_revision_counts
Migrated: 2017_04_20_185112_add_revision_counts (117.98ms)
Migrating: 2017_07_02_152834_update_db_encoding_to_ut8mb4
Migrated: 2017_07_02_152834_update_db_encoding_to_ut8mb4 (0.12ms)
Migrating: 2017_08_01_130541_create_comments_table
Migrated: 2017_08_01_130541_create_comments_table (158.85ms)
Migrating: 2017_08_29_102650_add_cover_image_display
Migrated: 2017_08_29_102650_add_cover_image_display (25.22ms)
Migrating: 2018_07_15_173514_add_role_external_auth_id
Migrated: 2018_07_15_173514_add_role_external_auth_id (71.57ms)
Migrating: 2018_08_04_115700_create_bookshelves_table
Migrated: 2018_08_04_115700_create_bookshelves_table (1,288.78ms)
Migrating: 2019_07_07_112515_add_template_support
Illuminate\Database\QueryException
SQLSTATE[HY000] [2002] Connection refused (SQL: alter table `pages` add index `pages_template_index`(`template`))
at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:712
708▕ // If an exception occurs when attempting to run a query, we'll format the error
709▕ // message to include the bindings with SQL, which will make this exception a
710▕ // lot more helpful to the developer instead of just the database's errors.
711▕ catch (Exception $e) {
➜ 712▕ throw new QueryException(
713▕ $query, $this->prepareBindings($bindings), $e
714▕ );
715▕ }
716▕ }
+18 vendor frames
19 /var/www/html/database/migrations/2019_07_07_112515_add_template_support.php:20
Illuminate\Support\Facades\Facade::__callStatic()
+22 vendor frames
42 /var/www/html/artisan:37
Illuminate\Foundation\Console\Kernel::handle()
[cont-init.d] 50-config: exited 0.
[cont-init.d] 90-custom-folders: executing...
[cont-init.d] 90-custom-folders: exited 0.
[cont-init.d] 99-custom-files: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-files: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Signal handled: Terminated.`