@cbou opened this Issue on November 8th 2019

I currently have trouble with the following error General error: 1364 Field 'location_geoip_continent' doesn't have a default value.

I tried to install Piwik on a fresh new server. Matomo on the old server was already udapted to the last version. I downloaded Matomo from the matomo.org on the new server and push a backup of the database to my new server.

Everything was fine except that the new serve refuse to track new events.

After looking closely I notice that location_geoip_continent is not a column that is used anymore. The new ones are named location_* and not location_geoip_*.

I fixed the issue by running this:

UPDATE `piwik_log_visit` SET location_country = `location_geoip_country`;
UPDATE `piwik_log_visit` SET location_city = `location_geoip_city`;
UPDATE `piwik_log_visit` SET location_latitude = `location_geoip_latitude` WHERE location_geoip_latitude IS NOT NULL;
UPDATE `piwik_log_visit` SET location_longitude = `location_geoip_longitude` WHERE location_geoip_longitude IS NOT NULL;

ALTER TABLE `piwik_log_visit` CHANGE `location_geoip_continent` `location_geoip_continent` VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `location_geoip_country` `location_geoip_country` VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `location_geoip_city` `location_geoip_city` VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;

Maybe it's possible to remove the columns as well...

I hope this issue can help someone...

@sgiehl commented on November 8th 2019 Member

Actually I'm not sure where those columns come from. Did you use any third party plugins before?

@cbou commented on November 11th 2019

Could be, the server is pretty old.

This Issue was closed on November 11th 2019
Powered by GitHub Issue Mirror