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
SQL error: Field 'visit_total_events' doesn't have a default value #14799
Comments
The field should be nullable though see https://github.com/matomo-org/matomo/pull/10492/files#diff-1eae80e84fbec709e6e3c03b237656f9R21 In theory this should have just worked? We have basically pretty much all fields nullable. Does it maybe depend on the sql_mode? |
Thanks @tsteur, we've made the field nullable in our database as well. That seems to work just as well. Not sure what effect sql_mode has on these migrations, but here are our current values:
Would you say these values are okay? |
@imrejonk it should have already been nullable so it was likely not due to the SQL mode. It seems for some reason it was not nullable on your installation. Maybe there was an issue a while back with Matomo 3 update or some were manually executed. I'll close this issue again as it really looks like all should be working fine from our side. I recommend you maybe check other fields too if they are nullable. |
Thanks for the help @tsteur! I suppose it was just a migration issue on our side. I should've mentioned that we migrated our complete Matomo installation to a new system a couple months back. Database went from some old MySQL to MariaDB 10.3. Guess we're going to check all our fields against the database classes to be sure 🤷♂️ |
I've been hit with the same weird problem after migrating from a very old piwik installation to the latest matomo. In case someone else needs it, here is the command that fixed it for me:
I just hope there are no other unnullable columns waiting to trigger the same bug on a different parameter. So far it seems to work. |
I had to perform the same for location_browser_lang:
|
System information
We've experienced a database issue after updating to Matomo 3.11.0 from 3.10.0, causing Matomo to stop tracking visits and preventing plugin updates. The database upgrade seemed to be going well, as did our re-run of the database upgrade (as described in the Matomo Update FAQ). Still, visits were not being tracked anymore. Plugin updates failed with "Could not verify the security token on this form". We noticed this error in our NGINX error logs:
Both issues were resolved after executing this SQL statement against the database:
ALTER TABLE piwik_log_visit MODIFY COLUMN visit_total_events SMALLINT(5) UNSIGNED NOT NULL DEFAULT 0;
Could it be that this ALTER TABLE statement is missing in the Matomo 3.11.0 database migration script?
The text was updated successfully, but these errors were encountered: