Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup Fails: Exception_DB: Database Query Failed #12

Closed
niccolox opened this issue Dec 2, 2014 · 19 comments
Closed

Setup Fails: Exception_DB: Database Query Failed #12

niccolox opened this issue Dec 2, 2014 · 19 comments

Comments

@niccolox
Copy link

niccolox commented Dec 2, 2014

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
Copy link
Author

niccolox commented Dec 2, 2014

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:

  • Original error: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'dam.app' doesn't exist
  • file: dokku-alt-002.sql
    -----> Everything is done!

@niccolox
Copy link
Author

niccolox commented Dec 2, 2014

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

@niccolox niccolox closed this as completed Dec 2, 2014
@mlitwiniuk
Copy link
Contributor

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
Copy link
Author

niccolox commented Dec 2, 2014

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

@niccolox niccolox reopened this Dec 2, 2014
@flaviobarros
Copy link

Same problem here:

Additional information:

  • Original error: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'dam.app' doesn't exist
  • file: dokku-alt-002.sql

What can i do?

@mlitwiniuk
Copy link
Contributor

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

@romaninsh
Copy link
Owner

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
Copy link
Contributor

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
Copy link
Contributor

#13 should fix this.

@romaninsh
Copy link
Owner

Thanks for addressing this.

@jamespacileo
Copy link

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
Copy link
Author

fresh install, same error

@philipheinser
Copy link

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
Copy link

ingro commented Jul 28, 2015

Same problem here...

@eugeneware
Copy link

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

@karlcoelho
Copy link

Same error here. Any fix?

@rusintez
Copy link

+1

@steviee
Copy link

steviee commented Nov 13, 2015

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
Copy link

leejefon commented Dec 8, 2015

@steviee You saved my day!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests