solidnerd / docker-bookstack

BookStack in a container
MIT License
448 stars 194 forks source link

Incorrect launch #459

Closed StrongHaul closed 6 months ago

StrongHaul commented 6 months ago

OS: Windows 11

There are explanations why this problem occurs, maybe someone has already encountered this? image

This is the docker-compose.yml that I am using.

version: '2'
services:
  mysql:
    image: mysql
    environment:
      - MYSQL_ROOT_PASSWORD=secret
      - MYSQL_DATABASE=bookstack
      - MYSQL_USER=bookstack
      - MYSQL_PASSWORD=secret
    volumes:
      - ./mysql_data:/var/lib/mysql
    ports:
      - "3306:3306"

  bookstack:
    image: solidnerd/bookstack
    depends_on:
      - mysql
    environment:
      - DB_HOST=mysql:3306
      - DB_DATABASE=bookstack
      - DB_USERNAME=bookstack
      - DB_PASSWORD=secret
      - APP_URL=http://localhost:8080
    # APP_KEY is used for encryption where needed, so needs to be persisted to
    # preserve decryption abilities.
    # Can run `php artisan key:generate` to generate a key
      - APP_KEY=MyBookstackKey
    volumes:
      - ./bookstack_uploads:/var/www/bookstack/public/uploads
      - ./bookstack_storage_uploads:/var/www/bookstack/storage/uploads
    ports:
      - "8080:8080"
Log Bookstack ```log 2024-01-07 13:04:34 Starting Migration... 2024-01-07 13:04:34 2024-01-07 13:04:34 INFO Preparing database. 2024-01-07 13:04:34 2024-01-07 13:04:34 Creating migration table ......................................... 30ms DONE 2024-01-07 13:04:34 2024-01-07 13:04:34 INFO Running migrations. 2024-01-07 13:04:34 2024-01-07 13:04:35 2014_10_12_000000_create_users_table ............................ 103ms DONE 2024-01-07 13:04:35 2014_10_12_100000_create_password_resets_table ................... 56ms DONE 2024-01-07 13:04:35 2015_07_12_114933_create_books_table ............................. 29ms DONE 2024-01-07 13:04:35 2015_07_12_190027_create_pages_table ............................. 33ms DONE 2024-01-07 13:04:35 2015_07_13_172121_create_images_table ............................ 30ms DONE 2024-01-07 13:04:35 2015_07_27_172342_create_chapters_table .......................... 32ms DONE 2024-01-07 13:04:35 2015_08_08_200447_add_users_to_entities .......................... 61ms DONE 2024-01-07 13:04:35 2015_08_09_093534_create_page_revisions_table .................... 56ms DONE 2024-01-07 13:04:35 2015_08_16_142133_create_activities_table ........................ 41ms DONE 2024-01-07 13:04:36 2015_08_29_105422_add_roles_and_permissions ..................... 732ms DONE 2024-01-07 13:04:36 2015_08_30_125859_create_settings_table ......................... 105ms DONE 2024-01-07 13:04:36 2015_08_31_175240_add_search_indexes .............................. 0ms DONE 2024-01-07 13:04:36 2015_09_04_165821_create_social_accounts_table ................... 68ms DONE 2024-01-07 13:04:36 2015_09_05_164707_add_email_confirmation_table ................... 75ms DONE 2024-01-07 13:04:36 2015_11_21_145609_create_views_table ............................. 35ms DONE 2024-01-07 13:04:36 2015_11_26_221857_add_entity_indexes ............................ 329ms DONE 2024-01-07 13:04:36 2015_12_05_145049_fulltext_weighting .............................. 0ms DONE 2024-01-07 13:04:36 2015_12_07_195238_add_image_upload_types ......................... 36ms DONE 2024-01-07 13:04:36 2015_12_09_195748_add_user_avatars ............................... 15ms DONE 2024-01-07 13:04:36 2016_01_11_210908_add_external_auth_to_users ..................... 39ms DONE 2024-01-07 13:04:36 2016_02_25_184030_add_slug_to_revisions .......................... 47ms DONE 2024-01-07 13:04:37 2016_02_27_120329_update_permissions_and_roles .................. 250ms DONE 2024-01-07 13:03:48 wait-for-db: waiting for mysql:3306 2024-01-07 13:04:33 wait-for-db: waiting for mysql:3306 2024-01-07 13:04:34 wait-for-db: done 2024-01-07 13:04:42 AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.28.0.3. Set the 'ServerName' directive globally to suppress this message 2024-01-07 13:04:42 AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.28.0.3. Set the 'ServerName' directive globally to suppress this message 2024-01-07 13:04:42 [Sun Jan 07 08:04:42.960171 2024] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.57 (Debian) PHP/8.2.12 configured -- resuming normal operations 2024-01-07 13:04:42 [Sun Jan 07 08:04:42.960221 2024] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND' 2024-01-07 13:06:11 [Sun Jan 07 08:06:11.179645 2024] [reqtimeout:info] [pid 42] [client 172.28.0.1:57936] AH01382: Request header read timeout 2024-01-07 13:09:53 [Sun Jan 07 08:09:53.348108 2024] [mpm_prefork:notice] [pid 1] AH00170: caught SIGWINCH, shutting down gracefully 2024-01-07 13:04:37 2016_02_28_084200_add_entity_access_controls .................... 193ms DONE 2024-01-07 13:04:37 2016_03_09_203143_add_page_revision_types ........................ 34ms DONE 2024-01-07 13:04:37 2016_03_13_082138_add_page_drafts ................................ 37ms DONE 2024-01-07 13:04:37 2016_03_25_123157_add_markdown_support ........................... 31ms DONE 2024-01-07 13:04:37 2016_04_09_100730_add_view_permissions_to_roles .................. 70ms DONE 2024-01-07 13:04:37 2016_04_20_192649_create_joint_permissions_table ................ 265ms DONE 2024-01-07 13:04:38 2016_05_06_185215_create_tags_table ............................. 112ms DONE 2024-01-07 13:04:38 2016_07_07_181521_add_summary_to_page_revisions .................. 17ms DONE 2024-01-07 13:04:38 2016_09_29_101449_remove_hidden_roles ........................... 136ms DONE 2024-01-07 13:04:38 2016_10_09_142037_create_attachments_table ....................... 79ms DONE 2024-01-07 13:04:38 2017_01_21_163556_create_cache_table ............................. 78ms DONE 2024-01-07 13:04:38 2017_01_21_163602_create_sessions_table .......................... 78ms DONE 2024-01-07 13:04:38 2017_03_19_091553_create_search_index_table ..................... 128ms DONE 2024-01-07 13:04:38 2017_04_20_185112_add_revision_counts ............................ 51ms DONE 2024-01-07 13:04:38 2017_07_02_152834_update_db_encoding_to_ut8mb4 .................... 0ms DONE 2024-01-07 13:04:38 2017_08_01_130541_create_comments_table .......................... 97ms DONE 2024-01-07 13:04:38 2017_08_29_102650_add_cover_image_display ........................ 16ms DONE 2024-01-07 13:04:38 2018_07_15_173514_add_role_external_auth_id ...................... 44ms DONE 2024-01-07 13:04:39 2018_08_04_115700_create_bookshelves_table ...................... 610ms DONE 2024-01-07 13:04:39 2019_07_07_112515_add_template_support ........................... 43ms DONE 2024-01-07 13:04:39 2019_08_17_140214_add_user_invites_table ......................... 60ms DONE 2024-01-07 13:04:39 2019_12_29_120917_add_api_auth ................................... 80ms DONE 2024-01-07 13:04:39 2020_08_04_111754_drop_joint_permissions_id ..................... 175ms DONE 2024-01-07 13:04:39 2020_08_04_131052_remove_role_name_field ......................... 88ms DONE 2024-01-07 13:04:39 2020_09_19_094251_add_activity_indexes ........................... 37ms DONE 2024-01-07 13:04:39 2020_09_27_210059_add_entity_soft_deletes ........................ 75ms DONE 2024-01-07 13:04:40 2020_09_27_210528_create_deletions_table ......................... 81ms DONE 2024-01-07 13:04:40 2020_11_07_232321_simplify_activities_table ..................... 238ms DONE 2024-01-07 13:04:40 2020_12_30_173528_add_owned_by_field_to_entities ................ 204ms DONE 2024-01-07 13:04:40 2021_01_30_225441_add_settings_type_column ....................... 13ms DONE 2024-01-07 13:04:40 2021_03_08_215138_add_user_slug .................................. 90ms DONE 2024-01-07 13:04:40 2021_05_15_173110_create_favourites_table ........................ 66ms DONE 2024-01-07 13:04:40 2021_06_30_173111_create_mfa_values_table ........................ 69ms DONE 2024-01-07 13:04:40 2021_07_03_085038_add_mfa_enforced_to_roles_table ................ 29ms DONE 2024-01-07 13:04:40 2021_08_28_161743_add_export_role_permission ..................... 10ms DONE 2024-01-07 13:04:40 2021_09_26_044614_add_activities_ip_column ....................... 19ms DONE 2024-01-07 13:04:40 2021_11_26_070438_add_index_for_user_ip .......................... 21ms DONE 2024-01-07 13:04:41 2021_12_07_111343_create_webhooks_table ......................... 135ms DONE 2024-01-07 13:04:41 2021_12_13_152024_create_jobs_table .............................. 47ms DONE 2024-01-07 13:04:41 2021_12_13_152120_create_failed_jobs_table ....................... 45ms DONE 2024-01-07 13:04:41 2022_01_03_154041_add_webhooks_timeout_error_columns ............. 16ms DONE 2024-01-07 13:04:41 2022_04_17_101741_add_editor_change_field_and_permission ......... 28ms DONE 2024-01-07 13:04:41 2022_04_25_140741_update_polymorphic_types ....................... 18ms DONE 2024-01-07 13:04:41 2022_07_16_170051_drop_joint_permission_type .................... 269ms DONE 2024-01-07 13:04:41 2022_08_17_092941_create_references_table ........................ 91ms DONE 2024-01-07 13:04:41 2022_09_02_082910_fix_shelf_cover_image_types ..................... 1ms DONE 2024-01-07 13:04:41 2022_10_07_091406_flatten_entity_permissions_table .............. 101ms DONE 2024-01-07 13:04:42 2022_10_08_104202_drop_entity_restricted_field .................. 373ms DONE 2024-01-07 13:04:42 2023_01_24_104625_refactor_joint_permissions_storage ............ 300ms DONE 2024-01-07 13:04:42 2023_01_28_141230_copy_color_settings_for_dark_mode ............... 1ms DONE 2024-01-07 13:04:42 2023_02_20_093655_increase_attachments_path_length ............... 83ms DONE 2024-01-07 13:04:42 2023_02_23_200227_add_updated_at_index_to_pages .................. 19ms DONE 2024-01-07 13:04:42 2023_06_10_071823_remove_guest_user_secondary_roles ............... 2ms DONE 2024-01-07 13:04:42 2023_06_25_181952_remove_bookshelf_create_entity_permissions ...... 0ms DONE 2024-01-07 13:04:42 2023_07_25_124945_add_receive_notifications_role_permissions ...... 6ms DONE 2024-01-07 13:04:42 2023_07_31_104430_create_watches_table ........................... 74ms DONE 2024-01-07 13:04:42 2023_08_21_174248_increase_cache_size ............................ 65ms DONE 2024-01-07 13:04:42 2024-01-07 13:04:42 Clearing caches... 2024-01-07 13:04:42 2024-01-07 13:04:42 INFO Application cache cleared successfully. 2024-01-07 13:04:42 2024-01-07 13:04:42 2024-01-07 13:04:42 INFO Compiled views cleared successfully. 2024-01-07 13:04:42 2024-01-07 13:05:02 bookstack:80 172.28.0.1 - - [07/Jan/2024:08:05:01 +0000] "GET / HTTP/1.1" 500 14943 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" 2024-01-07 13:05:02 bookstack:80 172.28.0.1 - - [07/Jan/2024:08:05:02 +0000] "GET /manifest.json HTTP/1.1" 500 14971 "http://localhost:8080/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" 2024-01-07 13:05:18 bookstack:80 172.28.0.1 - - [07/Jan/2024:08:05:18 +0000] "GET / HTTP/1.1" 500 14943 "http://localhost:8080/login" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" 2024-01-07 13:05:18 bookstack:80 172.28.0.1 - - [07/Jan/2024:08:05:18 +0000] "GET /manifest.json HTTP/1.1" 500 14971 "http://localhost:8080/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" 2024-01-07 13:05:19 bookstack:80 172.28.0.1 - - [07/Jan/2024:08:05:18 +0000] "GET / HTTP/1.1" 500 14943 "http://localhost:8080/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" 2024-01-07 13:05:19 bookstack:80 172.28.0.1 - - [07/Jan/2024:08:05:19 +0000] "GET /manifest.json HTTP/1.1" 500 14971 "http://localhost:8080/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" 2024-01-07 13:06:11 bookstack:80 172.28.0.1 - - [07/Jan/2024:08:06:11 +0000] "-" 408 0 "-" "-" ```

The migration seems to be running successfully. image

Mysql log ```log 2024-01-07 13:03:48 2024-01-07T08:03:48.772266Z 0 [System] [MY-015017] [Server] MySQL Server Initialization - start. 2024-01-07 13:03:48 2024-01-07T08:03:48.773873Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead. 2024-01-07 13:03:48 2024-01-07T08:03:48.774411Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.2.0) initializing of server in progress as process 81 2024-01-07 13:03:48 2024-01-07T08:03:48.785510Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive 2024-01-07 13:03:48 2024-01-07T08:03:48.794188Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2024-01-07 13:03:50 2024-01-07T08:03:50.304114Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended. 2024-01-07 13:03:52 2024-01-07T08:03:52.798676Z 6 [Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option. 2024-01-07 13:03:56 2024-01-07T08:03:56.357320Z 0 [System] [MY-015018] [Server] MySQL Server Initialization - end. 2024-01-07 13:03:56 2024-01-07T08:03:56.466841Z 0 [System] [MY-015015] [Server] MySQL Server - start. 2024-01-07 13:03:56 2024-01-07T08:03:56.683899Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead. 2024-01-07 13:03:56 2024-01-07T08:03:56.688750Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.2.0) starting as process 125 2024-01-07 13:03:56 2024-01-07T08:03:56.693737Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive 2024-01-07 13:03:56 2024-01-07T08:03:56.710863Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2024-01-07 13:03:57 2024-01-07T08:03:57.668708Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended. 2024-01-07 13:03:58 2024-01-07T08:03:58.487985Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed. 2024-01-07 13:03:58 2024-01-07T08:03:58.488710Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel. 2024-01-07 13:03:58 2024-01-07T08:03:58.510019Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory. 2024-01-07 13:03:58 2024-01-07T08:03:58.542562Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: /var/run/mysqld/mysqlx.sock 2024-01-07 13:03:58 2024-01-07T08:03:58.542726Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.2.0' socket: '/var/run/mysqld/mysqld.sock' port: 0 MySQL Community Server - GPL. 2024-01-07 13:03:58 2024-01-07T08:03:58.545136Z 0 [System] [MY-015016] [Server] MySQL Server - end. 2024-01-07 13:03:59 Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it. 2024-01-07 13:03:59 Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it. 2024-01-07 13:03:59 Warning: Unable to load '/usr/share/zoneinfo/leapseconds' as time zone. Skipping it. 2024-01-07 13:04:01 Warning: Unable to load '/usr/share/zoneinfo/tzdata.zi' as time zone. Skipping it. 2024-01-07 13:04:01 Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it. 2024-01-07 13:04:01 Warning: Unable to load '/usr/share/zoneinfo/zone1970.tab' as time zone. Skipping it. 2024-01-07 13:04:01 2024-01-07T08:04:01.859477Z 13 [System] [MY-013172] [Server] Received SHUTDOWN from user root. Shutting down mysqld (Version: 8.2.0). 2024-01-07 13:04:02 2024-01-07T08:04:02.896187Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.2.0) MySQL Community Server - GPL. 2024-01-07 13:04:02 2024-01-07T08:04:02.898993Z 0 [System] [MY-015016] [Server] MySQL Server - end. 2024-01-07 13:03:48 2024-01-07 08:03:48+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.2.0-1.el8 started. 2024-01-07 13:03:48 2024-01-07 08:03:48+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql' 2024-01-07 13:03:48 2024-01-07 08:03:48+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.2.0-1.el8 started. 2024-01-07 13:03:48 2024-01-07 08:03:48+00:00 [Note] [Entrypoint]: Initializing database files 2024-01-07 13:03:56 2024-01-07 08:03:56+00:00 [Note] [Entrypoint]: Database files initialized 2024-01-07 13:03:56 2024-01-07 08:03:56+00:00 [Note] [Entrypoint]: Starting temporary server 2024-01-07 13:03:58 2024-01-07 08:03:58+00:00 [Note] [Entrypoint]: Temporary server started. 2024-01-07 13:03:58 '/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock' 2024-01-07 13:04:01 2024-01-07 08:04:01+00:00 [Note] [Entrypoint]: Creating database bookstack 2024-01-07 13:04:01 2024-01-07 08:04:01+00:00 [Note] [Entrypoint]: Creating user bookstack 2024-01-07 13:04:01 2024-01-07 08:04:01+00:00 [Note] [Entrypoint]: Giving user bookstack access to schema bookstack 2024-01-07 13:04:01 2024-01-07 13:04:01 2024-01-07 08:04:01+00:00 [Note] [Entrypoint]: Stopping temporary server 2024-01-07 13:04:03 2024-01-07 08:04:03+00:00 [Note] [Entrypoint]: Temporary server stopped 2024-01-07 13:04:03 2024-01-07 13:04:03 2024-01-07 08:04:03+00:00 [Note] [Entrypoint]: MySQL init process done. Ready for start up. 2024-01-07 13:04:03 2024-01-07 13:04:04 2024-01-07T08:04:03.870637Z 0 [System] [MY-015015] [Server] MySQL Server - start. 2024-01-07 13:04:04 2024-01-07T08:04:04.060516Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead. 2024-01-07 13:04:04 2024-01-07T08:04:04.065707Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.2.0) starting as process 1 2024-01-07 13:04:04 2024-01-07T08:04:04.070073Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive 2024-01-07 13:04:04 2024-01-07T08:04:04.083672Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2024-01-07 13:04:05 2024-01-07T08:04:05.071261Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended. 2024-01-07 13:04:05 2024-01-07T08:04:05.763328Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed. 2024-01-07 13:04:05 2024-01-07T08:04:05.764575Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel. 2024-01-07 13:04:05 2024-01-07T08:04:05.790401Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory. 2024-01-07 13:04:05 2024-01-07T08:04:05.905431Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock 2024-01-07 13:04:05 2024-01-07T08:04:05.905677Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.2.0' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server - GPL. 2024-01-07 13:09:54 2024-01-07T08:09:54.741703Z 0 [System] [MY-013172] [Server] Received SHUTDOWN from user . Shutting down mysqld (Version: 8.2.0). 2024-01-07 13:09:55 2024-01-07T08:09:55.967298Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.2.0) MySQL Community Server - GPL. 2024-01-07 13:09:55 2024-01-07T08:09:55.969202Z 0 [System] [MY-015016] [Server] MySQL Server - end. ```
StrongHaul commented 6 months ago

I looked at old discussions and found a solution. APP_KEY must be equal to 32 characters, which is basically written in the instructions) I fixed APP_KEY and everything worked!

environment:
...
      - APP_KEY=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
...