Skip to content
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

location_geoip_continent doesn't have a default value #15136

Closed
cbou opened this issue Nov 8, 2019 · 2 comments
Closed

location_geoip_continent doesn't have a default value #15136

cbou opened this issue Nov 8, 2019 · 2 comments
Labels
answered For when a question was asked and we referred to forum or answered it.

Comments

@cbou
Copy link

cbou commented Nov 8, 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
Copy link
Member

sgiehl commented Nov 8, 2019

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

@cbou
Copy link
Author

cbou commented Nov 11, 2019

Could be, the server is pretty old.

@cbou cbou closed this as completed Nov 11, 2019
@tsteur tsteur added the answered For when a question was asked and we referred to forum or answered it. label Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Projects
None yet
Development

No branches or pull requests

3 participants