General error: 1364 Field 'config_browser_engine' doesn't have a default value


#1

Hi,

I’ve just upgraded from 2.8.0 to 2.9.1.

We had a number of problems upgrading our test instances, and the only way we seemed to be able to reliably perform the upgrade was to manually install each of the intermediate versions, checking for any database upgrades after doing each version by visiting the Piwik admin console homepage.

However, we’ve just performed an upgrade on our live instance in this way and have another problem. We weren’t seeing any visits coming through. In the PHP log files there are loads of these:

[23-Dec-2014 12:11:41 UTC] Error in Piwik (tracker): Error query: SQLSTATE[HY000]: General error: 1364 Field ‘config_browser_engine’ doesn’t have a default value In query: INSERT INTO log_visit (idvisitor, config_id, location_ip, config_flash, config_gears, config_java, config_pdf, config_director, config_cookie, config_browser_version, idsite, config_os, config_quicktime, config_realplayer, visitor_days_since_last, location_provider, visitor_localtime, visit_total_events, config_silverlight, config_windowsmedia, config_resolution, config_browser_name, location_browser_lang, location_country, visit_last_action_time, visit_total_time, visit_first_action_time, visit_goal_buyer, visit_goal_converted, visitor_days_since_first, visitor_days_since_order, visit_total_searches, visit_total_actions, referer_keyword, referer_name, referer_type, visit_exit_idaction_url, visit_exit_idaction_name, visitor_returning, visitor_count_visits, visit_entry_idaction_name, visit_entry_idaction_url, referer_url) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) Parameters: array ( 0 => ‘·Ì°†(’, 1 => ‘°»»à&ôÚ’, 2 => ’ ‡Y’, 3 => 1, 4 => 0, 5 => 1, 6 => 1, 7 => 1, 8 => 1, 9 => ‘32.0’, 10 => 4, 11 => ‘WI7’, 12 => 0, 13 => 0, 14 => ‘0’, 15 => ‘derbyad.net’, 16 => ‘12:11:41’, 17 => 0, 18 => 1, 19 => 0, 20 => ‘1280x1024’, 21 => ‘CH’, 22 => ‘en-gb’, 23 => ‘gb’, 24 => ‘2014-12-23 12:11:41’, 25 => 0, 26 => ‘2014-12-23 12:11:41’, 27 => 0, 28 => 0, 29 => ‘0’, 30 => 0, 31 => 0, 32 => 1, 33 => ‘’, 34 => ‘’, 35 => 1, 36 => 459, 37 => 457, 38 => 0, 39 => 1, 40 => 457, 41 => 459, 42 => ‘’, )

As this is our live server, I’ve gone in and added a default value of an empty string into the config_browser_engine column within the log_visit table. This seems to have fixed the problem.

However:

Help!

Thanks,

Adam.


#2

Short update - I’ve figure out that the table to force an upgrade is now the ‘options’ table.

I’ve forced another upgrade, but still see the same error.

Still need help…

Thanks again,

Adam.


#3

One other thing that might be relevant - We are running Piwik under HTTPS, and the site we are tracking is also HTTPS.


(Matthieu Aubry) #4

Hi Adam,

[23-Dec-2014 12:11:41 UTC] Error in Piwik (tracker): Error query: SQLSTATE[HY000]: General error: 1364 Field ‘config_browser_engine’ doesn’t have a default value In query

  • Does this error indicate an underlying problem with some other part of Piwik?

Yes!

  • Was this the right thing to do?

definitely it’s worth creating an issue on: GitHub - matomo-org/matomo: Liberating Web Analytics. Star us on Github? +1. Matomo is the leading open alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites, apps & the IoT and visualise this data and extract insights. Privacy is built-in. We love Pull Requests!

  • Should this column have a default value, or, I was wondering whether perhaps only the earlier versions needed a default value, and that the code now should be able to work without a default - In which case has a database upgrade failed? These instructions to force another database upgrade [piwik.org] don’t seem to be correct any more, as there’s no piwik_option table.

we need to think of the proper way to fix this issue for all columns so we don’t have to open new bug reports when we hit this issue on a new column every time. Not sure the proper way but let’s discuss on your github issue