Update 1.5.0 and getting Error 500!

developer

Member
Hi @twisted1919

Step 1) I updated form 1.4.3 to 1.5.0.

Step 2) I sent a campaign.

Step 3) campaigned was successfully send. – https://www.screencast.com/t/bf9u4uIeq

Step 4) I want click on “unsubscribe” url for getting this error. Please check on screen shot - https://www.screencast.com/t/z5W0c2Esvww

In applications error logs here.
===============================================
2017/12/21 05:10:24 [error] [system.db.CDbCommand] [64.233.173.158] CDbCommand::execute() failed: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`www_wizz`.`mw_campaign_track_open`, CONSTRAINT `fk_campaign_track_open_ip_location1` FOREIGN KEY (`location_id`) REFERENCES `mw_ip_location_1` (`location_id`) ON DELETE SET NULL ON UPDATE). The SQL statement executed was: UPDATE `mw_campaign_track_open` SET `location_id`=:yp0 WHERE `mw_campaign_track_open`.`id`='929960'.
2017/12/21 05:10:28 [error] [system.db.CDbCommand] [182.70.105.51] CDbCommand::execute() failed: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`www_wizz`.`mw_campaign_track_url`, CONSTRAINT `fk_campaign_track_url_ip_location1` FOREIGN KEY (`location_id`) REFERENCES `mw_ip_location_1` (`location_id`) ON DELETE SET NULL ON UPDATE N). The SQL statement executed was: UPDATE `mw_campaign_track_url` SET `location_id`=:yp0 WHERE `mw_campaign_track_url`.`id`='85519'.
2017/12/21 05:10:29 [error] [system.db.CDbCommand] [182.70.105.51] CDbCommand::execute() failed: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`www_wizz`.`mw_campaign_track_url`, CONSTRAINT `fk_campaign_track_url_ip_location1` FOREIGN KEY (`location_id`) REFERENCES `mw_ip_location_1` (`location_id`) ON DELETE SET NULL ON UPDATE N). The SQL statement executed was: UPDATE `mw_campaign_track_url` SET `location_id`=:yp0 WHERE `mw_campaign_track_url`.`id`='85520'.
2017/12/21 05:10:31 [error] [system.db.CDbCommand] [182.70.105.51] CDbCommand::execute() failed: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`www_wizz`.`mw_campaign_track_url`, CONSTRAINT `fk_campaign_track_url_ip_location1` FOREIGN KEY (`location_id`) REFERENCES `mw_ip_location_1` (`location_id`) ON DELETE SET NULL ON UPDATE N). The SQL statement executed was: UPDATE `mw_campaign_track_url` SET `location_id`=:yp0 WHERE `mw_campaign_track_url`.`id`='85521'.
2017/12/21 05:10:34 [error] [system.db.CDbCommand] [182.70.105.51] CDbCommand::execute() failed: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`www_wizz`.`mw_campaign_track_url`, CONSTRAINT `fk_campaign_track_url_ip_location1` FOREIGN KEY (`location_id`) REFERENCES `mw_ip_location_1` (`location_id`) ON DELETE SET NULL ON UPDATE N). The SQL statement executed was: UPDATE `mw_campaign_track_url` SET `location_id`=:yp0 WHERE `mw_campaign_track_url`.`id`='85522'.
2017/12/21 05:10:49 [error] [system.db.CDbCommand] [182.70.105.51] CDbCommand::execute() failed: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`www_wizz`.`mw_campaign_track_url`, CONSTRAINT `fk_campaign_track_url_ip_location1` FOREIGN KEY (`location_id`) REFERENCES `mw_ip_location_1` (`location_id`) ON DELETE SET NULL ON UPDATE N). The SQL statement executed was: UPDATE `mw_campaign_track_url` SET `location_id`=:yp0 WHERE `mw_campaign_track_url`.`id`='85523'.
2017/12/21 05:10:50 [error] [system.db.CDbCommand] [182.70.105.51] CDbCommand::execute() failed: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`www_wizz`.`mw_campaign_track_unsubscribe`, CONSTRAINT `fk_campaign_track_unsubscribe_ip_location1` FOREIGN KEY (`location_id`) REFERENCES `mw_ip_location_1` (`location_id`) ON DELETE SET ). The SQL statement executed was: UPDATE `mw_campaign_track_unsubscribe` SET `location_id`=:yp0 WHERE `mw_campaign_track_unsubscribe`.`id`='8244'.
2017/12/21 05:10:50 [error] [exception.CDbException] [182.70.105.51] CDbException: CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`www_wizz`.`mw_campaign_track_unsubscribe`, CONSTRAINT `fk_campaign_track_unsubscribe_ip_location1` FOREIGN KEY (`location_id`) REFERENCES `mw_ip_location_1` (`location_id`) ON DELETE SET ) in /home/www/public_html/apps/common/framework/db/CDbCommand.php:358
Stack trace:
#0 /home/www/public_html/apps/common/framework/db/ar/CActiveRecord.php(1756): CDbCommand->execute()
#1 /home/www/public_html/apps/common/extensions/ip-location-freegeoip/IpLocationFreegeoipExt.php(153): CActiveRecord->updateByPk(8244, Array)
#2 /home/www/public_html/apps/common/components/managers/HooksManager.php(122): IpLocationFreegeoipExt->_registerServiceForSavingLocation(Object(ListsController), Object(CampaignTrackUnsubscribe))
#3 /home/www/public_html/apps/frontend/controllers/ListsController.php(845): HooksManager->doAction('frontend_lists_...', Object(ListsController), Object(CampaignTrackUnsubscribe))
#4 [internal function]: ListsController->actionUnsubscribe_confirm('wq911ggw6afc9', 'wd636keat783b', 'my2664alx353c')
#5 /home/www/public_html/apps/common/framework/web/actions/CAction.php(109): ReflectionMethod->invokeArgs(Object(ListsController), Array)
#6 /home/www/public_html/apps/common/framework/web/actions/CInlineAction.php(47): CAction->runWithParamsInternal(Object(ListsController), Object(ReflectionMethod), Array)
#7 /home/www/public_html/apps/common/framework/web/CController.php(308): CInlineAction->runWithParams(Array)
#8 /home/www/public_html/apps/common/framework/web/CController.php(286): CController->runAction(Object(CInlineAction))
#9 /home/www/public_html/apps/common/framework/web/CController.php(265): CController->runActionWithFilters(Object(CInlineAction), Array)
#10 /home/www/public_html/apps/common/framework/web/CWebApplication.php(282): CController->run('unsubscribe_con...')
#11 /home/www/public_html/apps/common/framework/web/CWebApplication.php(141): CWebApplication->runController('lists/unsubscri...')
#12 /home/www/public_html/apps/common/framework/base/CApplication.php(185): CWebApplication->processRequest()
#13 /home/www/public_html/apps/init.php(238): CApplication->run()
#14 /home/www/public_html/index.php(18): require_once('/home/www/p...')
#15 {main}
REQUEST_URI=/index.php/lists/wq911ggw6afc9/confirm-unsubscribe/wd636keat783b/my2664alx353c
 
You see how it says:
Code:
(`www_wizz`.`mw_campaign_track_open`, CONSTRAINT `fk_campaign_track_open_ip_location1` FOREIGN KEY (`location_id`) REFERENCES `mw_ip_location_1` (`location_id`) ON DELETE SET NULL ON UPDATE). The SQL statement executed was: UPDATE `mw_campaign_track_open` SET `location_id`=:yp0 WHERE `mw_campaign_track_open`.`id`='929960'.
It looks for a table named mw_ip_location_1 but mailwizz doesn't have such table, it has mw_ip_location instead.
Do yo have mw_ip_location_1 and mw_ip_location ?
 
Well, something has to affect that since i see it references a table that mailwizz never created.
Using PhpMyAdmin, click on "mw_campaign_track_unsubscribe" table, then when it lists the records in that table, click the "Structure" button in the page, which will show you the table structure. Then click the "Relational view" button, and you should see something like:
Screenshot 2017-12-21 13.51.04.png
We're interested in the second row, related to location_id column. We need to see where it points. In my case, it points correctly to ip_location table.
How does it look in your case ?
 
Back
Top