Hi,
When I submit new settings for google analytics i get the following error message :

Warning: Table 'watchdog' was not locked with LOCK TABLES query: INSERT INTO watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (1, 'php', 'Duplicate entry 'googleanalytics_track_rédacteur fruits et légume' for key 1\nquery: INSERT INTO variable (name, value) VALUES ('googleanalytics_track_rédacteur fruits et légumes', 'i:0;') dans /var/www/vhosts/mindenice.fr/includes/database.mysql.inc à la ligne 120.', 2, '', 'http://www.mindenice.fr/admin/settings/googleanalytics', 'http://www.mindenice.fr/admin/settings/googleanalytics', '82.127.5.123', 1150271038) in /var/www/vhosts/mindenice.fr/includes/database.mysql.inc on line 120

And moreover if I refresh the setting page, I get the following error messages :

    * user warning: Duplicate entry 'googleanalytics_track_rédacteur fruits et légume' for key 1 query: INSERT INTO variable (name, value) VALUES ('googleanalytics_track_rédacteur fruits et légumes', 'i:0;') in /var/www/vhosts/mindenice.fr/includes/database.mysql.inc on line 120.
    * warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/mindenice.fr/includes/database.mysql.inc:120) in /var/www/vhosts/mindenice.fr/includes/common.inc on line 266.

Oh, ok those are only warnings, but... so what happened?

Thanks

Comments

budda’s picture

Status: Active » Closed (fixed)

Looks like you don't have Drupals database configured correctly - your need ADMIN PRIV.

SO this aint a bug in Google Analytics.

Julien PHAM’s picture

But I have admin privs... This is the only module I have problems with. How can I check what you're talking about?

Thanks

Julien PHAM’s picture

Priority: Critical » Normal
Status: Closed (fixed) » Active

Sorry to open this issue again but as I said I have admin privileges and all should be fine, so I wonder what happened, and more important, how to solve it, so if you can help me I'll be grateful...

Julien PHAM’s picture

Status: Active » Closed (fixed)
budda’s picture

Might be the weird characters in your role name 'rédacteur fruits et légumes'. Maybe mysql doesn't like them.
Change your role names to something without UTF-8 characters in it.

Drupal tries to create a variable name called googleanalytics_track_{$role->name} when saving the settings.

budda’s picture

Status: Closed (fixed) » Active
Julien PHAM’s picture

The variables are ok, even with accentuaded characters, as my database is in utf format. But this is the record in watchdog table which fails...

And I don't think this is an issue with accentuated characters as I have accentuaded messages in watchdog already.

I don't understand this "LOCK TABLES" stuff...

budda’s picture

boydkelly’s picture

I am getting this same problem (see below) only when saving settings for acidfree. This is after upgrading from 4.6.3 to 4.7.2. I do not have a permissions issue. The database user has all privileges. Is there any resolution to this problem? Much appreciated....

Thanks,

Boyd

Warning: Table 'watchdog' was not locked with LOCK TABLES query: INSERT INTO watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (1, 'php', 'Duplicate entry 'acidfree_last_re' for key 1\nquery: INSERT INTO variable (name, value) VALUES ('acidfree_last_resized', 's:2:\\"-1\\";') in /home/jerry/stage/includes/database.mysql.inc on line 120.', 2, '', 'http://stage.thomasmaintenance.com/admin/settings/acidfree', 'http://stage.thomasmaintenance.com/admin/settings/acidfree', '192.168.1.18', 1151120998) in /home/jerry/stage/includes/database.mysql.inc on line 120

markusH’s picture

Looks similar like this one: http://drupal.org/node/54775

The "variable" table only takes names that are up to 48 chars long. Some automatically constructed names simply get cut. In the end, this leads to these error messages. Your variable name seems to be pretty long, so maybe that's a hint.

I had to change the (internal) name of a custom content type (cck) from 18 to 9 characters to make it work with the usernodes module.

Maybe try to cut down the "rédacteur fruits et légumes" phase.

phoolish’s picture

chcnaging the character length of variable solves my problem.

budda’s picture

Status: Active » Closed (fixed)