Forums / Upgrading to 1.5.x / WARNING: An Error occurred, please refresh the page and try again.

WARNING: An Error occurred, please refresh the page and try again.

Locked

Views: 2,270

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
15 Mar 2016, 2:37 AM
#1
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

WARNING: An Error occurred, please refresh the page and try again.

I was upgrading a 1.5.1 install to 1.5.4
Imported the DB
Did the DB upgrade fine

Store page displays this text at the bottom

WARNING: An Error occurred, please refresh the page and try again.

Trying to access the admin area I get this

WARNING: An Error occurred, please refresh the page and try again.
The resulting debug file contents are
[14-Mar-2016 21:18:35 America/Chicago] PHP Fatal error: 1062:Duplicate entry '0' for key 'PRIMARY' :: insert into admin_activity_log (access_date, admin_id, page_accessed, page_parameters, ip_address, gzpost, flagged, attention, severity, logmessage) values (now(), '0', 'login.php ', 'camefrom=index.php', 'my_ip_address', '‹Ž\0', '0', '', 'info', 'Accessed page [login.php]') ==> (as called by) /home/kobrawd/public_html/demo154/mt_admin/includes/functions/database.php on line 53 <== in /home/kobrawd/public_html/demo154/includes/classes/db/mysql/query_factory.php on line 155

Php V = 5.5.31
mysql = 5.5.48

Zen-Venom Get Bitten

15 Mar 2016, 2:50 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: WARNING: An Error occurred, please refresh the page and try again.

In a normal configuration, the admin_activity_log table has its primary key set to be the log_id field, which is an auto-incrementing integer field.
It seems yours is not properly set to be auto-incrementing, for whatever reason.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

15 Mar 2016, 3:07 AM
#3
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: WARNING: An Error occurred, please refresh the page and try again.

DrByte,
Thank You
I ran this and can now access

ALTER TABLE admin_activity_log CHANGE COLUMN   log_id  log_id int(15) NOT NULL auto_increment;

Zen-Venom Get Bitten

15 Mar 2016, 3:24 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: WARNING: An Error occurred, please refresh the page and try again.

My bad. I should have said big-integer field.

The upgrade SQL (since v150) is:

ALTER TABLE admin_activity_log CHANGE COLUMN log_id log_id bigint(15) NOT NULL auto_increment;

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.