Skip to content

[BUG] Tablespace is Missing for a table / An Unknown Error Occurred #287

@klm127

Description

@klm127

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I ran the following docker-compose.yml.

services:
  bookstack:
    container_name: bookstack
    image: lscr.io/linuxserver/bookstack:latest
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - APP_URL=http://localhost:6875
      - APP_KEY=base64:da8c/yJzUIf0A1IjbWxTK5N4VBwY9pqWwmmH0k4mleY=

      - DB_HOST=maria_db
      - DB_PORT=3306
      - DB_DATABASE=bookstack
      - DB_USERNAME=bookstack
      - DB_PASSWORD=bookstack2219x
    volumes:
      - ./bookstack_app_data:/config
    ports:
      - 6875:80
    restart: unless-stopped

  mariadb:
    image: lscr.io/linuxserver/mariadb:latest
    container_name: maria_db
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - MYSQL_ROOT_PASSWORD=bookstack2219x
      - MYSQL_DATABASE=bookstack
      - MYSQL_USER=bookstack
      - MYSQL_PASSWORD=bookstack2219x
    volumes:
      - ./bookstack_db_data:/config
    restart: unless-stopped

The first time I was able to log in as admin@admin.com, and didn't get

Image

until I attempted to create a page. Now, after deleting the volumes and containers and rerunning it a few times, I can't seem to get past the login page. Maybe some kind of race condition? Adding depends_on: mariadb didn't fix.

log/bookstack/laravel.log has several errors like this:

[2026-03-26 18:35:06] production.ERROR: SQLSTATE[HY000]: General error: 1030 Got error 194 "Tablespace is missing for a table" from storage engine InnoDB (Connection: mysql, Host: mariadb, Port: 3306, Database: bookstack, SQL: truncate table `joint_permissions`) {"exception":"[object] (Illuminate\\Database\\QueryException(code: HY000): SQLSTATE[HY000]: General error: 1030 Got error 194 \"Tablespace is missing for a table\" from storage engine InnoDB (Connection: mysql, Host: mariadb, Port: 3306, Database: bookstack, SQL: truncate table `joint_permissions`) at /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php:838)
[stacktrace]
#0 /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(794): Illuminate\\Database\\Connection->runQueryCallback()
#1 /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(573): Illuminate\\Database\\Connection->run()
#2 /app/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(4443): Illuminate\\Database\\Connection->statement()
#3 /app/www/database/migrations/2023_01_24_104625_refactor_joint_permissions_storage.php(18): Illuminate\\Database\\Query\\Builder->truncate()
#4 /app/www/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(517): Illuminate\\Database\\Migrations\\Migration@anonymous->up()
#5 /app/www/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(442): Illuminate\\Database\\Migrations\\Migrator->runMethod()
#6 /app/www/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(451): Illuminate\\Database\\Migrations\\Migrator->{closure:Illuminate\\Database\\Migrations\\Migrator::runMigration():438}()
#7 /app/www/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(253): Illuminate\\Database\\Migrations\\Migrator->runMigration()
#8 /app/www/vendor/laravel/framework/src/Illuminate/Console/View/Components/Task.php(41): Illuminate\\Database\\Migrations\\Migrator->{closure:Illuminate\\Database\\Migrations\\Migrator::runUp():253}()
#9 /app/www/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(814): Illuminate\\Console\\View\\Components\\Task->render()
#10 /app/www/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(253): Illuminate\\Database\\Migrations\\Migrator->write()
#11 /app/www/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(211): Illuminate\\Database\\Migrations\\Migrator->runUp()
#12 /app/www/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(138): Illuminate\\Database\\Migrations\\Migrator->runPending()
#13 /app/www/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(116): Illuminate\\Database\\Migrations\\Migrator->run()
#14 /app/www/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(671): Illuminate\\Database\\Console\\Migrations\\MigrateCommand->{closure:Illuminate\\Database\\Console\\Migrations\\MigrateCommand::runMigrations():109}()
#15 /app/www/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(109): Illuminate\\Database\\Migrations\\Migrator->usingConnection()
#16 /app/www/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(88): Illuminate\\Database\\Console\\Migrations\\MigrateCommand->runMigrations()
#17 /app/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\\Database\\Console\\Migrations\\MigrateCommand->handle()
#18 /app/www/vendor/laravel/framework/src/Illuminate/Container/Util.php(43): Illuminate\\Container\\BoundMethod::{closure:Illuminate\\Container\\BoundMethod::call():35}()
#19 /app/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(96): Illuminate\\Container\\Util::unwrapIfClosure()
#20 /app/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\\Container\\BoundMethod::callBoundMethod()
#21 /app/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(799): Illuminate\\Container\\BoundMethod::call()
#22 /app/www/vendor/laravel/framework/src/Illuminate/Console/Command.php(211): Illuminate\\Container\\Container->call()
#23 /app/www/vendor/symfony/console/Command/Command.php(341): Illuminate\\Console\\Command->execute()
#24 /app/www/vendor/laravel/framework/src/Illuminate/Console/Command.php(180): Symfony\\Component\\Console\\Command\\Command->run()
#25 /app/www/vendor/symfony/console/Application.php(1117): Illuminate\\Console\\Command->run()
#26 /app/www/vendor/symfony/console/Application.php(356): Symfony\\Component\\Console\\Application->doRunCommand()
#27 /app/www/vendor/symfony/console/Application.php(195): Symfony\\Component\\Console\\Application->doRun()
#28 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(198): Symfony\\Component\\Console\\Application->run()
#29 /app/www/artisan(35): Illuminate\\Foundation\\Console\\Kernel->handle()
#30 {main}

Expected Behavior

It should work out of the box.

Steps To Reproduce

  1. Set up the compose file:
services:
  bookstack:
    container_name: bookstack
    image: lscr.io/linuxserver/bookstack:latest
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - APP_URL=http://localhost:6875
      - APP_KEY=base64:da8c/yJzUIf0A1IjbWxTK5N4VBwY9pqWwmmH0k4mleY=

      - DB_HOST=mariadb
      - DB_PORT=3306
      - DB_DATABASE=bookstack
      - DB_USERNAME=bookstack
      - DB_PASSWORD=bookstack2219x
    volumes:
      - ./bookstack_app_data:/config
    ports:
      - 6875:80
    restart: unless-stopped
    depends_on:
      - mariadb

  mariadb:
    image: lscr.io/linuxserver/mariadb:latest
    container_name: mariadb
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - MYSQL_ROOT_PASSWORD=bookstack2219x
      - MYSQL_DATABASE=bookstack
      - MYSQL_USER=bookstack
      - MYSQL_PASSWORD=bookstack2219x
    volumes:
      - ./bookstack_db_data:/config
    restart: unless-stopped
  1. Execute docker-compose up
  2. Navigate to localhost:6875
  3. Attempt to log in as admin@admin.com with password password.
  4. If you can log in, attempt to create a book and a page in the book.

Environment

- OS:
- How docker service was installed:

CPU architecture

x86-64

Docker creation

services:
  bookstack:
    container_name: bookstack
    image: lscr.io/linuxserver/bookstack:latest
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - APP_URL=http://localhost:6875
      - APP_KEY=base64:da8c/yJzUIf0A1IjbWxTK5N4VBwY9pqWwmmH0k4mleY=

      - DB_HOST=mariadb
      - DB_PORT=3306
      - DB_DATABASE=bookstack
      - DB_USERNAME=bookstack
      - DB_PASSWORD=bookstack2219x
    volumes:
      - ./bookstack_app_data:/config
    ports:
      - 6875:80
    restart: unless-stopped
    depends_on:
      - mariadb

  mariadb:
    image: lscr.io/linuxserver/mariadb:latest
    container_name: mariadb
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - MYSQL_ROOT_PASSWORD=bookstack2219x
      - MYSQL_DATABASE=bookstack
      - MYSQL_USER=bookstack
      - MYSQL_PASSWORD=bookstack2219x
    volumes:
      - ./bookstack_db_data:/config
    restart: unless-stopped

Container logs

[migrations] started
[migrations] 01-nginx-site-confs-default: executing...
[migrations] 01-nginx-site-confs-default: succeeded
[migrations] 02-default-location: executing...
[migrations] 02-default-location: succeeded
[migrations] done
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1000
User GID:    1000
───────────────────────────────────────
Linuxserver.io version: v26.03.2-ls254
Build-date: 2026-03-23T13:55:35+00:00
───────────────────────────────────────
    
Setting resolver to  127.0.0.11
Setting worker_processes to 2
generating self-signed keys in /config/keys, you can replace these with your own keys if required
Waiting for DB to be available

   INFO  Preparing database.  

  Creating migration table ...................................... 26.24ms DONE

   INFO  Running migrations.  

  2014_10_12_000000_create_users_table ......................... 195.85ms DONE
  2014_10_12_100000_create_password_resets_table ................ 66.50ms DONE
  2015_07_12_114933_create_books_table .......................... 17.58ms DONE
  2015_07_12_190027_create_pages_table .......................... 15.13ms DONE
  2015_07_13_172121_create_images_table ......................... 15.61ms DONE
  2015_07_27_172342_create_chapters_table ....................... 18.18ms DONE
  2015_08_08_200447_add_users_to_entities ...................... 187.48ms DONE
  2015_08_09_093534_create_page_revisions_table ................. 14.95ms DONE
  2015_08_16_142133_create_activities_table ..................... 17.07ms DONE
  2015_08_29_105422_add_roles_and_permissions .................. 347.18ms DONE
  2015_08_30_125859_create_settings_table ....................... 14.69ms DONE
  2015_08_31_175240_add_search_indexes ........................... 0.07ms DONE
  2015_09_04_165821_create_social_accounts_table ................ 68.75ms DONE
  2015_09_05_164707_add_email_confirmation_table ................ 91.64ms DONE
  2015_11_21_145609_create_views_table .......................... 14.84ms DONE
  2015_11_26_221857_add_entity_indexes ......................... 540.46ms DONE
  2015_12_05_145049_fulltext_weighting ........................... 0.07ms DONE
  2015_12_07_195238_add_image_upload_types ...................... 86.83ms DONE
  2015_12_09_195748_add_user_avatars ............................ 20.45ms DONE
  2016_01_11_210908_add_external_auth_to_users .................. 52.85ms DONE
  2016_02_25_184030_add_slug_to_revisions ...................... 100.37ms DONE
  2016_02_27_120329_update_permissions_and_roles ............... 141.03ms DONE
  2016_02_28_084200_add_entity_access_controls ................. 284.10ms DONE
  2016_03_09_203143_add_page_revision_types ..................... 50.42ms DONE
  2016_03_13_082138_add_page_drafts ............................. 48.28ms DONE
  2016_03_25_123157_add_markdown_support ........................ 44.53ms DONE
  2016_04_09_100730_add_view_permissions_to_roles ............... 42.84ms DONE
  2016_04_20_192649_create_joint_permissions_table ............. 303.01ms DONE
  2016_05_06_185215_create_tags_table .......................... 116.02ms DONE
  2016_07_07_181521_add_summary_to_page_revisions ............... 20.66ms DONE
  2016_09_29_101449_remove_hidden_roles ......................... 78.25ms DONE
  2016_10_09_142037_create_attachments_table .................... 67.76ms DONE
  2017_01_21_163556_create_cache_table .......................... 52.02ms DONE
  2017_01_21_163602_create_sessions_table ....................... 48.63ms DONE
  2017_03_19_091553_create_search_index_table .................. 129.27ms DONE
  2017_04_20_185112_add_revision_counts ......................... 75.95ms DONE
  2017_07_02_152834_update_db_encoding_to_ut8mb4 ................. 0.11ms DONE
  2017_08_01_130541_create_comments_table ....................... 88.97ms DONE
  2017_08_29_102650_add_cover_image_display ..................... 23.07ms DONE
  2018_07_15_173514_add_role_external_auth_id ................... 49.02ms DONE
  2018_08_04_115700_create_bookshelves_table ................... 397.13ms DONE
  2019_07_07_112515_add_template_support ........................ 50.98ms DONE
  2019_08_17_140214_add_user_invites_table ...................... 68.25ms DONE
  2019_12_29_120917_add_api_auth ................................ 95.04ms DONE
  2020_08_04_111754_drop_joint_permissions_id ................... 93.33ms DONE
  2020_08_04_131052_remove_role_name_field ...................... 21.66ms DONE
  2020_09_19_094251_add_activity_indexes ........................ 54.09ms DONE
  2020_09_27_210059_add_entity_soft_deletes ..................... 89.04ms DONE
  2020_09_27_210528_create_deletions_table ...................... 92.84ms DONE
  2020_11_07_232321_simplify_activities_table .................. 154.77ms DONE
  2020_12_30_173528_add_owned_by_field_to_entities ............. 228.04ms DONE
  2021_01_30_225441_add_settings_type_column .................... 24.04ms DONE
  2021_03_08_215138_add_user_slug ............................... 52.20ms DONE
  2021_05_15_173110_create_favourites_table ..................... 65.72ms DONE
  2021_06_30_173111_create_mfa_values_table ..................... 64.51ms DONE
  2021_07_03_085038_add_mfa_enforced_to_roles_table ............. 21.75ms DONE
  2021_08_28_161743_add_export_role_permission ................... 5.55ms DONE
  2021_09_26_044614_add_activities_ip_column .................... 21.35ms DONE
  2021_11_26_070438_add_index_for_user_ip ....................... 26.06ms DONE
  2021_12_07_111343_create_webhooks_table ...................... 129.66ms DONE
  2021_12_13_152024_create_jobs_table ........................... 39.48ms DONE
  2021_12_13_152120_create_failed_jobs_table .................... 46.18ms DONE
  2022_01_03_154041_add_webhooks_timeout_error_columns .......... 86.61ms DONE
  2022_04_17_101741_add_editor_change_field_and_permission ...... 26.31ms DONE
  2022_04_25_140741_update_polymorphic_types .................... 29.81ms DONE
  2022_07_16_170051_drop_joint_permission_type ................. 117.56ms DONE
  2022_08_17_092941_create_references_table .................... 118.43ms DONE
  2022_09_02_082910_fix_shelf_cover_image_types .................. 0.57ms DONE
  2022_10_07_091406_flatten_entity_permissions_table ........... 103.42ms DONE
  2022_10_08_104202_drop_entity_restricted_field ................ 92.33ms DONE
  2023_01_24_104625_refactor_joint_permissions_storage ........... 4.43ms FAIL

   Illuminate\Database\QueryException 

  SQLSTATE[HY000]: General error: 1030 Got error 194 "Tablespace is missing for a table" from storage engine InnoDB (Connection: mysql, Host: mariadb, Port: 3306, Database: bookstack, SQL: truncate table `joint_permissions`)

  at /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php:838
    834▕             $exceptionType = $this->isUniqueConstraintError($e)
    835▕                 ? UniqueConstraintViolationException::class
    836▕                 : QueryException::class;
    837▕ 
  ➜ 838▕             throw new $exceptionType(
    839▕                 $this->getNameWithReadWriteType(),
    840▕                 $query,
    841▕                 $this->prepareBindings($bindings),
    842▕                 $e,

      �[2m+6 vendor frames �[22m

  7   /app/www/database/migrations/2023_01_24_104625_refactor_joint_permissions_storage.php:18
      Illuminate\Database\Query\Builder::truncate()
      �[2m+25 vendor frames �[22m

  33  /app/www/artisan:35
      Illuminate\Foundation\Console\Kernel::handle()

[custom-init] No custom files found, skipping...
[ls.io-init] done.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Issues

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions