romaninsh / dokku-alt-manager

dokku-alt Web Manager App (LOOKING FOR CO-MAINTAINER)
100 stars 19 forks source link

Setup Fails: Exception_DB: Database Query Failed #12

Closed niccolox closed 9 years ago

niccolox commented 9 years ago

is there an undocumented config step for setup?

I simply cant get the dam to connect to the db

Exception_DB: Database Query Failed

pdo_error: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'dam.user' doesn't exist
mode: select
params:
query: select count(*) from `user`
template: select [options] [field] [from] [table] [join] [where] [group] [having] [order] [limit]

I've manged to install Wordpress with a mariadb linked ok and set the environment variables

but no joy with dam and dokku-alt

ssh dokku@$HOST create dam ssh dokku@$HOST mariadb:create dam ssh dokku@$HOST mariadb:link dam dam

git remote add deploy dokku@$HOST:dam git push deploy master

ssh dokku@$HOST config:set dam DATABASE_URL='mysql2://dam:hjdhdhjdjdflll@mariadb:3306/dam'

I feel like an idiot, perhaps I've borked my set-up, am new to dokku-alt and dokku-alt-manager

niccolox commented 9 years ago

I just switched to dokku-alt beta and installed via dokku manager:install

and got similar error after deleting db and starting again

am going to rebuild the test machine next couple of days and try with dokku-alt beta to start

-----> Bootstraping dokku-alt-manager... Bootstrapping Dokku-alt-manager Connecting do database: OK Updating Database: ==[ BaseException: Undefined Exception ]===========

Additional information:

niccolox commented 9 years ago

closing this

rebuilt server, went straight to dokku-alt-beta and all good

4  sudo apt-get update && sudo apt-get install dokku-alt-beta
5  dokku manager:install
mlitwiniuk commented 9 years ago

I'm using dokku-alt-beta and have same problem - no matter, if I'm installing via dokku manager:install or via git push

niccolox commented 9 years ago

ok, I feel less silly

there was a db app linking error, which I didnt record

I recreated that vm so cant dig logs

I just did a clean install of trusty on a kvm vm on proxmox at ovh.ca and 'just worked' second time

flaviobarros commented 9 years ago

Same problem here:

Additional information:

What can i do?

mlitwiniuk commented 9 years ago

Yep, same for me. Abowe is shown after using dokku manager:install, error from first post when viewing dam.dokkuhost.com

romaninsh commented 9 years ago

Here is a little bit more information to help you debugging.

First - manager requires MariaDB database which you can access by executing:

dokku mariadb:console dam dam

this should produce:

MariaDB [dam]> show tables;
+---------------+
| Tables_in_dam |
+---------------+
| _db_update    |
| access        |
| app           |
| config        |
| db            |
| db_link       |
| domain        |
| host          |
| host_log      |
| user          |
+---------------+

You can also look into _db_update which contains list of applied migrations:

MariaDB [dam]> select * from _db_update
    -> ;
+----+-------------------+--------+
| id | name              | status |
+----+-------------------+--------+
|  1 | dokku-alt-000.sql | ok     |
+----+-------------------+--------+
1 row in set (0.01 sec)

The migrations themselves are located here: https://github.com/romaninsh/dokku-alt-manager/tree/master/doc/dbupdates

and to manually try and apply the migration you need to run

dokku run dam "php bootstrap.php"

You can also see list of migration files inside your container like this:

root@daisy:~# dokku run dam "ls -l doc/dbupdates"

Hopefully this will help and if you can post more information here. If you can also post the steps to reproduce this problem, it would help.

mlitwiniuk commented 9 years ago
MariaDB [dam]> select * from _db_update
    -> ;
+----+-------------------+--------+
| id | name              | status |
+----+-------------------+--------+
|  3 | dokku-alt-002.sql | fail   |
+----+-------------------+--------+

to me it looks like migrator is taking migration files in wrong order

mlitwiniuk commented 9 years ago

13 should fix this.

romaninsh commented 9 years ago

Thanks for addressing this.

jamespacileo commented 9 years ago

I've just installed manager from the dokku-alt-manager git repository... getting the same error.

I'm running dokku-alt beta. Anything I can do to help?

niccolox commented 9 years ago

fresh install, same error

philipheinser commented 9 years ago

Same here

dokku run dam "php bootstrap.php"
Bootstrapping Dokku-alt-manager
Connecting do database: OK
Updating Database: ==[ Exception_DB: Database Query Failed ]===========

Additional information:
 * pdo_error: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'dam._db_update' doesn't exist
 * mode: select
 * params:   * :a: dokku-alt-000.sql

 * query: select  `status` from `_db_update`  where `name` = :a    
 * template: select [options] [field] [from] [table] [join] [where] [group] [having] [order] [limit]
ingro commented 9 years ago

Same problem here...

eugeneware commented 9 years ago

Yes. Just did a clean install on 14.04 and got the same error.

karlcoelho commented 9 years ago

Same error here. Any fix?

rusintez commented 8 years ago

+1

steviee commented 8 years ago

I finished installation with this step:

After the bootstrapping failed I connected to the mariadb instance with

dokku mariadb:console dam dam

Then I created the _db_update table manually with this command:

create table _db_update (id bigint auto_increment primary key, name nvarchar(100), status nvarchar(100));

And exit;

After this I executed the bootstrapper again with this:

dokku run dam "php bootstrap.php"

That's it. Running!

Best regards, Steviee

leejefon commented 8 years ago

@steviee You saved my day!