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

Upgrade error #230

Closed
alex360off opened this Issue Jun 26, 2015 · 9 comments

Comments

Projects
None yet
2 participants
@alex360off

alex360off commented Jun 26, 2015

Hi,
i followed the upgrade instructions, but i've received this error:
Upgrading Core Schema -> GREEN MARK
Upgrading fmDNS Schema -> RED MARK
Database upgrade failed. Please try again.

How can i have more info about the error?

schermata 2015-06-26 alle 10 35 20

@alex360off

This comment has been minimized.

alex360off commented Jun 26, 2015

More info. I'm trying to upgrade from 1.0.3 to 2.0.2

@WillyXJ

This comment has been minimized.

Owner

WillyXJ commented Jun 26, 2015

You can hover your mouse over the X which will provide the database error. Most likely you will have a different database error after a retry than the original. If we can't resolve the current error, you might need to restore your database and try again to see what the first failure was. I'm still surprised to see an upgrade error at all.

@alex360off

This comment has been minimized.

alex360off commented Jun 26, 2015

Thanks for the support.
That's the error: Can't DROP 'PRIMARY'; check that column/key exists | Query: [ALTER TABLE fm_dns_records_skipped DROP PRIMARY KEY]

But that table haven't any primary key.

I've restored the db from backup, but the error is the same.
Do you know the cause of that error?

@alex360off

This comment has been minimized.

alex360off commented Jun 26, 2015

I've performed a new installation (2.0.2) and i've seen that:

CREATE TABLE fm_dns_records_skipped (
skip_id int(11) NOT NULL AUTO_INCREMENT,
account_id int(11) NOT NULL,
domain_id int(11) NOT NULL,
record_id int(11) NOT NULL,
record_status enum('active','deleted') NOT NULL DEFAULT 'active',
PRIMARY KEY (skip_id),
KEY record_id (record_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

But in my db i see:

CREATE TABLE fm_dns_records_skipped (
account_id int(11) NOT NULL,
domain_id int(11) NOT NULL,
record_id int(11) NOT NULL,
record_status enum('active','deleted') NOT NULL DEFAULT 'active'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

skip_id in missing and is not primary key.

I don't know if this info can help to solve the problem.

@WillyXJ

This comment has been minimized.

Owner

WillyXJ commented Jun 26, 2015

Thanks for this information. I'm not yet sure why skip_id would not get created. What version of MySQL are you using?

@alex360off

This comment has been minimized.

alex360off commented Jun 26, 2015

mysql Ver 14.14 Distrib 5.5.35, for debian-linux-gnu (x86_64) using readline 6.2

I can create that and push "Try again"? Do you think that is a good idea?

@WillyXJ

This comment has been minimized.

Owner

WillyXJ commented Jun 26, 2015

I see there is a problem in the upgrade script in that there are two attempts to drop PRIMARY KEY on that table. Please comment out line 1186 in fm-modules/fmDNS/upgrade.php (inside function upgradefmDNS_130) which looks like this:

    $table[] = "ALTER TABLE  `fm_{$__FM_CONFIG['fmDNS']['prefix']}records_skipped` DROP PRIMARY KEY";

Then you should be able to try again.

@alex360off

This comment has been minimized.

alex360off commented Jun 26, 2015

Yeah. Thats right!
I've followed your suggestion and the upgrade process ended with success.

Thanks man!

@WillyXJ

This comment has been minimized.

Owner

WillyXJ commented Jun 26, 2015

Good to hear - adding this fix for 2.0.3 and beyond.

@WillyXJ WillyXJ closed this Jun 26, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment