invoiceninja / dockerfiles

Docker files for Invoice Ninja
https://hub.docker.com/r/invoiceninja/invoiceninja
GNU General Public License v2.0
411 stars 267 forks source link

SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'languages' #426

Closed vawaver closed 2 years ago

vawaver commented 2 years ago

Docker vers. 5.3.45 I cannot reach web interface when I start the docker docker_app_1 log

2022-01-12T18:02:36Z [INFO] [Entrypoint]: Initialising Invoice Ninja...
Configuration cache cleared!
Configuration cached successfully!
Configuration cache cleared!
Configuration cached successfully!
Route cache cleared!
Routes cached successfully!
Files cached successfully!
Migrating: 2014_10_13_000000_create_users_table

In Connection.php line 703:

  SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'languages'   
  already exists (SQL: create table `languages` (`id` int unsigned not null a  
  uto_increment primary key, `name` varchar(191) not null, `locale` varchar(1  
  91) not null) default character set utf8mb4 collate 'utf8mb4_unicode_ci' en  
  gine = InnoDB)                                                               

In Connection.php line 492:

  SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'languages'   
  already exists                                                               

2022-01-12T18:03:39Z [INFO] [Entrypoint]: Initialising Invoice Ninja...
Configuration cache cleared!
Configuration cached successfully!
Configuration cache cleared!
Configuration cached successfully!
Route cache cleared!
Routes cached successfully!
Files cached successfully!
Migrating: 2014_10_13_000000_create_users_table

In Connection.php line 703:

  SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'languages'   
  already exists (SQL: create table `languages` (`id` int unsigned not null a  
  uto_increment primary key, `name` varchar(191) not null, `locale` varchar(1  
  91) not null) default character set utf8mb4 collate 'utf8mb4_unicode_ci' en  
  gine = InnoDB)                                                               

In Connection.php line 492:

  SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'languages'   
  already exists                                         

What should I do?

turbo124 commented 2 years ago

Is this a new installation or an existing one? It appears the migrations table is out of state and the system is trying to apply the migrations again.

Strit commented 2 years ago

I also have this issue when trying to set up the containers.

But it seems to only happen, if the database already exists and the IN_USER and IN_PASSWORD variables are set in the env file.

If I remove any of them, I get a different error:


In Connection.php line 712:

  SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_s  
  chema.tables where table_schema = ninja and table_name = accounts and table  
  _type = 'BASE TABLE')                                                        

In Connector.php line 70:

  SQLSTATE[HY000] [2002] Connection refused  

2022-02-07T13:01:42Z [ERROR] [Entrypoint]: Error connecting to DB
2022-02-07T13:01:44Z [INFO] [Entrypoint]: Initialising Invoice Ninja...
Configuration cache cleared!
Configuration cached successfully!
Configuration cache cleared!
Configuration cached successfully!
Route cache cleared!
Routes cached successfully!
Files cached successfully!

Should I create a new issue with this?