NathanVaughn / webtrees-docker

Up-to-date Docker image for webtrees with all the bells and whistles.
https://hub.docker.com/r/nathanvaughn/webtrees
MIT License
59 stars 15 forks source link

DB Error in Initialization Wizard #82

Closed tmuehlherr closed 2 years ago

tmuehlherr commented 2 years ago

Running this in docker desktop on Windows 10. After starting the web UI I enter the two pages of configuration items. Then I get this error:

SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'wt_gedcom' already exists (SQL: create table `wt_gedcom` (`gedcom_id` int not null auto_increment primary key, `gedcom_name` varchar(255) not null, `sort_order` int not null default '0') default character set utf8 collate 'utf8_unicode_ci' engine = InnoDB)

#0 /var/www/webtrees/vendor/illuminate/database/Connection.php(624): Illuminate\Database\Connection->runQueryCallback('create table `w...', Array, Object(Closure))
#1 /var/www/webtrees/vendor/illuminate/database/Connection.php(459): Illuminate\Database\Connection->run('create table `w...', Array, Object(Closure))
#2 /var/www/webtrees/vendor/illuminate/database/Schema/Blueprint.php(97): Illuminate\Database\Connection->statement('create table `w...')
#3 /var/www/webtrees/vendor/illuminate/database/Schema/Builder.php(278): Illuminate\Database\Schema\Blueprint->build(Object(Illuminate\Database\MySqlConnection), Object(Illuminate\Database\Schema\Grammars\MySqlGrammar))
#4 /var/www/webtrees/vendor/illuminate/database/Schema/Builder.php(167): Illuminate\Database\Schema\Builder->build(Object(Illuminate\Database\Schema\Blueprint))
#5 /var/www/webtrees/app/Schema/Migration0.php(44): Illuminate\Database\Schema\Builder->create('gedcom', Object(Closure))
#6 /var/www/webtrees/app/Services/MigrationService.php(71): Fisharebest\Webtrees\Schema\Migration0->upgrade()
#7 /var/www/webtrees/app/Http/RequestHandlers/SetupWizard.php(405): Fisharebest\Webtrees\Services\MigrationService->updateSchema('\\Fisharebest\\We...', 'WT_SCHEMA_VERSI...', 45)
#8 /var/www/webtrees/app/Http/RequestHandlers/SetupWizard.php(366): Fisharebest\Webtrees\Http\RequestHandlers\SetupWizard->createConfigFile(Array)
#9 /var/www/webtrees/app/Http/RequestHandlers/SetupWizard.php(200): Fisharebest\Webtrees\Http\RequestHandlers\SetupWizard->step6Install(Array)
#10 /var/www/webtrees/app/Http/Middleware/ReadConfigIni.php(69): Fisharebest\Webtrees\Http\RequestHandlers\SetupWizard->handle(Object(Nyholm\Psr7\ServerRequest))
#11 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\ReadConfigIni->process(Object(Nyholm\Psr7\ServerRequest), Object(Fisharebest\Webtrees\Http\RequestHandlers\SetupWizard))
#12 /var/www/webtrees/app/Http/Middleware/SecurityHeaders.php(48): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#13 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\SecurityHeaders->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#14 /var/www/webtrees/app/Http/Middleware/EmitResponse.php(57): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#15 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\EmitResponse->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#16 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(118): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#17 /var/www/webtrees/app/Webtrees.php(241): Middleland\Dispatcher->dispatch(Object(Nyholm\Psr7\ServerRequest))
#18 /var/www/webtrees/app/Webtrees.php(228): Fisharebest\Webtrees\Webtrees::dispatch(Object(Nyholm\Psr7\ServerRequest), Array)
#19 /var/www/webtrees/index.php(44): Fisharebest\Webtrees\Webtrees->httpRequest()
#20 {main}

I dropped the tables in the database and re-ran the same. Same error again.

WebTrees Image 2021-12-05T17:10:48Z 2.0.19 MariaDB: Linuxserver.io version:- 10.5.13-r0-ls46 Build-date:- 2022-01-29T06:47:05+01:00

Any help is appreciated.

Thomas

NathanVaughn commented 2 years ago

Do you have the Docker commands or docker-compose.yml file you are using? I ran this docker-compose.yml file on my Windows 11 PC with Docker Desktop, and got through the setup UI without issue.

version: "3"

services:
  app:
    depends_on:
      - db
    environment:
      PRETTY_URLS: "1"
      # HTTPS: "1"
      # HTTPS_REDIRECT: "1"
      LANG: "en-US"
      BASE_URL: "http://localhost"
      # DB_TYPE: "mysql"
      # DB_HOST: "db"
      # DB_PORT: "3306"
      # DB_USER: "webtrees"
      # DB_PASS: "badpassword"
      # DB_NAME: "webtrees"
      # DB_PREFIX: "wt_"
      # WT_USER: "username"
      # WT_NAME: "Full Name"
      # WT_PASS: "mybadpassword"
      # WT_EMAIL: "me@example.com"
    image: ghcr.io/nathanvaughn/webtrees:latest
    #build: .
    ports:
      - 80:80
      - 443:443
    restart: unless-stopped
    volumes:
      - app_data:/var/www/webtrees/data/
      - app_media:/var/www/webtrees/media/

  db:
    command: "--default-authentication-plugin=mysql_native_password"
    environment:
      MYSQL_DATABASE: "webtrees"
      MYSQL_USER: "webtrees"
      MYSQL_ROOT_PASSWORD: "badpassword"
      MYSQL_PASSWORD: "badpassword"
    image: mariadb:latest
    restart: unless-stopped
    volumes:
      - db_data:/var/lib/mysql

volumes:
  db_data:
    driver: local
  app_data:
    driver: local
  app_media:
    driver: local

At the time I tried this, this is Webtrees 2.0.19 and MariaDB 10.6.5

NathanVaughn commented 2 years ago

This should be resolved (hopefully) now with the latest push of the :2.0.21 tag and new entrypoint script. Feel free to reopen if it continues to be a problem.