I have this error with the l10_update and this make a error message appear on the site, because of this i have to disable it:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Entrada 'drupal-pt-br' duplicada para a chave 'PRIMARY': INSERT INTO {l10n_update_file} (project, language, filename, version, status, last_checked) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5); Array ( [:db_insert_placeholder_0] => drupal [:db_insert_placeholder_1] => pt-br [:db_insert_placeholder_2] => drupal-7.0-rc4.pt-br.po [:db_insert_placeholder_3] => 7.0-rc4 [:db_insert_placeholder_4] => 1 [:db_insert_placeholder_5] => 1294069255 ) em drupal_write_record() (linha 6774 de /home/jaguaribe/www/includes/common.inc).

And i have more two messages related to it, if this helps:

Notice: Undefined variable: files em l10n_update_check_translations() (linha 146 de /home/jaguaribe/www/sites/all/modules/l10n_update/l10n_update.check.inc).

Notice: Undefined variable: current em l10n_update_check_translations() (linha 165 de /home/jaguaribe/www/sites/all/modules/l10n_update/l10n_update.check.inc).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dgastudio’s picture

same here

int’s picture

Priority: Normal » Critical

same here

Gábor Hojtsy’s picture

Title: PDOException: SQLSTATE[23000] » Duplicate entry integrity constraint violation for l10n_update_file primary key

Retitling and marking #1020348: Duplicate entry as duplicate, since that looks to be the same issue on Drupal 6. Our schemas are the same, so should be the same problem.

oxyc’s picture

same here

kiho’s picture

I have also had the same errors.
I deleted all entries in the table i10n_update_file, and then run an update of translations, the problems seems to be gone.

Edit:
The problems came back again for me too after a couple of cron runs :-(

Hans Lodder’s picture

I also nulled the table both Drupal installations. It did help about 2 cron runs, and then returned with another module name.

Then I executed a re-install on both Drupal installs. Result the same: It did help about 2 cron runs, and then returned with another module name.

rharmsen’s picture

I can confirm this problem, took me a while to figure out it was the updater.

Would be nice if this could be fixed soon

Gábor Hojtsy’s picture

The notices are covered in #1029828: Undefined variable notices.

I think the issue you have here could easily be that you have profiles/defualt/translations/*.po files and then try to download files via l10n_update as well. I don't think it should break in this case (or any other case for that matter), but looking at the filename in the report I think that might be the case?!

Zoltán Balogh’s picture

Following

Zoltán Balogh’s picture

Status: Active » Needs review
FileSize
2.82 KB

I created a patch, please review it. It is also solving the issue #1029828: Undefined variable notices

sleeping_at-work-’s picture

It would be nice to have the same patch for 6.x-1.x-dev version.

Gábor Hojtsy’s picture

Can you explain why the existing code is broken and how does the fix improve it? Also, looks like you've included some indentation fixes where code is not actually changed, right?

Zoltán Balogh’s picture

There are 3 changes in the code.

  1. Yes, the first change is just some indentation, no code change.
  2. The $files variable is not exists in this function, I think this is a simple typo.
  3. The setting of the $current variable occurs too late. If the contition is false before the assignment, then the $current variable is not set, but used below, outside of this condition too. And if the $current is not set -> PHP warning in the watchdog -> the „elseif ($current)” condition is false -> skip the case UPDATE -> case else with INSERT -> ooops.
erdembey’s picture

Are we gonna have updated release with the fix ?
Or should be test the patch again ?

erdembey’s picture

Patch which is provided by Zoltán Balogh #10 solved my issues.
Also there was an another side effect of this problem; update process is blocked by this problem, after applying the patch update process is working as it is before.

Zoltán Balogh’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for the review, my patch works fine on my websites too.

sleeping_at-work-’s picture

what about Drupal 6? As I see in #3 this issue is aimed to cover the bug in D6 too

Zoltán Balogh’s picture

FileSize
1.26 KB

The patch for D6 is attached

sleeping_at-work-’s picture

it fixes the bug, thanks :)

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Committed in http://drupal.org/cvs?commit=493598 and http://drupal.org/cvs?commit=493600. Also making a release available later today which should include this fix. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

svendecabooter’s picture

Status: Closed (fixed) » Active

I encountered an identical error today while enabling the commerce_feeds module:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'commerce_feeds' for key 'PRIMARY': INSERT INTO {l10n_update_project} (name, project_type, core, version, l10n_server, l10n_path, status) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6); Array ( [:db_insert_placeholder_0] => commerce_feeds [:db_insert_placeholder_1] => module [:db_insert_placeholder_2] => 7.x [:db_insert_placeholder_3] => 7.x-1.1 [:db_insert_placeholder_4] => [:db_insert_placeholder_5] => http://ftp.drupal.org/files/translations/7.x/commerce_feeds/commerce_feeds-7.x-1.1.%language.po [:db_insert_placeholder_6] => 1 ) in drupal_write_record() (line 6851 of /Volumes/workspace/projecten/Lukas/www/drupal/includes/common.inc).

I am running l10n_update 7.x-1.0-beta2 and almost all other modules are up to date as well...
Let me know if you need more info.

Sutharsan’s picture

Status: Active » Postponed (maintainer needs more info)

I've seen errors like these in various modules, usually caused by the combination of a few of these factors: large site, slow server, heavy drupal process. The place where the error occurs is not necessarily the root of the problem. Do you have any indication that localization update is the source of this error? In this issue #569004: Add support for seek based batch import of .po files we are working on better handling large po files which may cause errors like these. But only during or immediately after importing po files.

svendecabooter’s picture

Not really a lot of clues in that regard... It was on my local machine, and the site only has a dozen or so contrib modules installed. But perhaps my laptop was just acting weird during the process... So i can't know for sure if l10n_update is the the source of this error.
I ran the update batch manually now, and everything was OK, so I suppose it was a one-time error :)

Sutharsan’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

No activity, closing the issue. Fee free to re-open if the problem persists.

glesage’s picture

I now have the same problem running a clean Drupal 7.9 install with only a few modules and content.
The problem appeared after doing some manipulations with the fullcalendar module. I created a fullcalendar view and then I deleted the fullcanlendar module file before deleting the view and checking the module off.. dum of me, but now I can't delete the view...

Zsuffa Dávid’s picture

Version: 7.x-1.x-dev » 7.x-1.0-beta3
Priority: Critical » Normal
Status: Closed (won't fix) » Active

Clean install with 'drush make' and 'drush site-install'. If i remove l10n_update modul form the makefile everything is fine.

WD php: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'token' for key [error]
'PRIMARY': INSERT INTO {l10n_update_project} (name, project_type, core, version, l10n_server, l10n_path, status)
VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3,
:db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6); Array
(
[:db_insert_placeholder_0] => token
[:db_insert_placeholder_1] => module
[:db_insert_placeholder_2] => 7.x
[:db_insert_placeholder_3] => 7.x-1.1
[:db_insert_placeholder_4] =>
[:db_insert_placeholder_5] => http://ftp.drupal.org/files/translations/7.x/token/token-7.x-1.1.%langua...
[:db_insert_placeholder_6] => 1
)
in drupal_write_record() (line 7036 of /srv/http/zentest/includes/common.inc). [128.06 sec, 30.44 MB]

WD php: Warning: Cannot modify header information - headers already sent by (output started at [warning]
/usr/share/pear/drush/includes/output.inc:37) in drupal_send_headers() (line 1239 of
/srv/http/zentest/includes/bootstrap.inc). [128.17 sec, 30.46 MB]
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'token' for key 'PRIMARY': INSERT INTO {l10n_update_project} (name, project_type, core, version, l10n_server, l10n_path, status) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6); Array
(
[:db_insert_placeholder_0] => token
[:db_insert_placeholder_1] => module
[:db_insert_placeholder_2] => 7.x
[:db_insert_placeholder_3] => 7.x-1.1
[:db_insert_placeholder_4] =>
[:db_insert_placeholder_5] => http://ftp.drupal.org/files/translations/7.x/token/token-7.x-1.1.%langua...
[:db_insert_placeholder_6] => 1
)
in drupal_write_record() (line 7036 of /srv/http/zentest/includes/common.inc).

Drush command terminated abnormally due to an unrecoverable error. [128.17 sec, 30.44 MB] [error]

ParisLiakos’s picture

same here. i get this error with drush.
If i perform the installation manually everything works

valderama’s picture

Same here:

Clean install with 'drush make' and 'drush site-install'. If i remove l10n_update modul form the makefile everything is fine

ParisLiakos’s picture

Status: Active » Closed (duplicate)

this is fixed in dev version!
i think this is the issue with the patch #1373758: PDOException since upgrading to 7.x-5.0

Sutharsan’s picture

@valderama,
If this is not fixed with dev, please can send me the makefile (and if applicable the profile) and I will have a look.

lmeurs’s picture

Had the same problem with Devel's reinstall module function on a clean install of a simple multilangual site. When reinstalling any module the error occured with v7.x-1.0-beta3 of Localization update, v7.x-1.0-beta3+4-dev fixed the error for me. Thanks a lot!

Maxime Gilbert’s picture

I have the same problem:

Clean install with 'drush make' and 'drush site-install'.

But it seems that the problem doesn't already exist in dev version.

Francewhoa’s picture