B
Blueprint•16mo ago
Ko v2

(help needed) SQL errors when migrating database

So basically when installing blueprint, it was needed to use migrate database, after blueprint installed I got this error, and now my panel is stuck at maintenance mode and I cant set it back
No description
22 Replies
Emma
Emma•16mo ago
No description
Ko v2
Ko v2OP•16mo ago
sorry i forgot to add, when running the command this error appears
INFO Running migrations.

2016_01_23_195641_add_allocations_table ................................................................................................. 6ms FAIL

In Connection.php line 760:

SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'allocations' already exists (Connection: mysql, SQL: create table allocations (id int unsigned not null auto_increment primary key, node mediumint unsigned not null, ip varchar(191) not null, port mediumint unsigned not null, assigned_to
mediumint unsigned null, created_at timestamp null, updated_at timestamp null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')


In Connection.php line 545:

SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'allocations' already exists
INFO Running migrations.

2016_01_23_195641_add_allocations_table ................................................................................................. 6ms FAIL

In Connection.php line 760:

SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'allocations' already exists (Connection: mysql, SQL: create table allocations (id int unsigned not null auto_increment primary key, node mediumint unsigned not null, ip varchar(191) not null, port mediumint unsigned not null, assigned_to
mediumint unsigned null, created_at timestamp null, updated_at timestamp null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')


In Connection.php line 545:

SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'allocations' already exists
Emma
Emma•16mo ago
uhhh haven't seen that before just want to know - is there anything important on your panel?
Ko v2
Ko v2OP•16mo ago
yes me neither, so what i have tried doing is setting all tables in the panel db to different names than the tables the migration is trying to create, than switching it back however it did not work
Emma
Emma•16mo ago
if not we can just drop the db and redo a couple things - if yes we might need to do some more stuff to try to recover the db
Ko v2
Ko v2OP•16mo ago
it is a production panel with important data
Emma
Emma•16mo ago
alright the difficult route it is have you tried rolling back the most recent migration?
Ko v2
Ko v2OP•16mo ago
how would I do that?
Emma
Emma•16mo ago
php artisan migrate:rollback
Emma
Emma•16mo ago
No description
Ko v2
Ko v2OP•16mo ago
give me a moment
Emma
Emma•16mo ago
alright
Ko v2
Ko v2OP•16mo ago
No description
Emma
Emma•16mo ago
oh help uhhh i'm not exactly sure what to do here - might need to wait a bit for anyone else to check out this thread
Ko v2
Ko v2OP•16mo ago
So well for now what i did to return it back to normal state was do php artisan migrate:fresh --seed which dropped all tables and set migration status, than ran php artisan up, and imported database backup, so the panel can be access/used now however i cannot use any artisan commands after this as i get the same error in the first screenshot
Emma
Emma•16mo ago
I'm glad your panel is at least functional - probably best to wait for someone else to reply here though
Ko v2
Ko v2OP•16mo ago
Ok so, i might try and install pterodactyl on a different machine and import database, if that works that means I can reinstall the os on the main machine and reinstall pterodactyl šŸ¤ž
Emma
Emma•16mo ago
sounds good - hope it goes well
Loki
Loki•16mo ago
Are there are errors above this? Anything hinting at the reason the initial migration failed?
Ko v2
Ko v2OP•16mo ago
Notsure it only appearend after the blueprint installer was building the panel does anyone know how to get rid of this error when building? I have already updated the panel to remove blueprint
Ko v2
Ko v2OP•16mo ago
Ko v2
Ko v2OP•15mo ago
bump (Problem solved)

Did you find this page helpful?