Yesterday I upgraded awssdk to 7.x-5.0. Now I'm seeing error messages pop up in various areas of my site. They occur in the admin section, and have to do with translations.

Any idea where this comes from?

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'amazons3' 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] => amazons3 [:db_insert_placeholder_1] => module [:db_insert_placeholder_2] => 7.x [:db_insert_placeholder_3] => 7.x-1.x-dev [:db_insert_placeholder_4] => [:db_insert_placeholder_5] => http://ftp.drupal.org/files/translations/7.x/amazons3/amazons3-7.x-1.x-d... [:db_insert_placeholder_6] => 1 ) in drupal_write_record() (regel 6888 van /Users/joachim/Sites/veto.local/includes/common.inc).

Notice that the upgrade to 7.x-5.0 was a bit flaky for me. I had to remove the awssdk folder in sites/all/libraries completely and unzip a fresh 1.5 before it would work. With an overwritten copy of 1.4, I got a WSOD and after drush cc an error message. Since I couldn't get the database update to run in the browser, I had to use drush for that. Don't know if this could be related. Might be that all this left drupal in a messed up state.

CommentFileSizeAuthor
#11 pdoexception-1373758-11.patch1010 bytesguillaumev
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jbeckers’s picture

Fix is to edit the database entry mentioned. It has "AmazonS3" which should be lowercase "amazons3".

Not sure why awssdk triggered this issue. Might have to be moved to amazons3 or l10n_update

boombatower’s picture

Project: AWS SDK for PHP » Localization update
Version: 7.x-5.0 » 7.x-1.x-dev
Category: bug » support

Yea, I have no idea how awssdk would have triggered such a database issue. As for not detecting the 1.5 library you need to clear cache (as per libraries module).

Lets see what they say over in l10n_update.

Sutharsan’s picture

Category: support » bug

At first glance it may be an l10n_update bug. Localization Updates keeps track of the update status of projects, that's what the l10n_update_project table is used for. For some reason it tries to add a second 'amazons3' record to the table.

Sutharsan’s picture

I'm not sure how we can prevent this in the future. The immediate problem is caused by a mismatch between the cached state of 'modules to be updated' and the actual state. You should be able to get out of the situation by submitting the modules page.

jbeckers’s picture

does it do so because it doesn't accept AmazonS3 to be the same as amazons3?

Sutharsan’s picture

I'm not sure. Try it and you know the answer.

Sutharsan’s picture

Category: bug » support
Status: Active » Postponed (maintainer needs more info)

@jbeckers, do you need more help? Otherwise, feel free to close the issue.

jbeckers’s picture

@sutharsan: no I'm fine.

jbeckers’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
guillaumev’s picture

Status: Closed (cannot reproduce) » Active

I'd like to reopen this issue.

Before upgrading l10n_update, my installation profile was working fine. After upgrading it and trying the installation of a new site, the installation fails with exactly this PDO Exception. Basically what's happening is the following:

  1. l10n_update is installed
  2. Another module, let's call it module_1, is installed
  3. Another module, let's call it module_2 is installed
  4. While module_2 is installed, the entire install fails with the PDOException stating Duplicate entry 'module_1' for key 'PRIMARY'

I believe this is an issue in hook_modules_enabled of l10n_update. I will investigate further...

guillaumev’s picture

Status: Active » Needs review
FileSize
1010 bytes

Here is a patch which makes sure that the list of projects is really current when refreshing a project...

Sutharsan’s picture

Category: support » bug
Status: Needs review » Fixed

Thanks! Patch committed.

Status: Fixed » Closed (fixed)

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

Garrett Albright’s picture

I was running into a similar problem when trying to do a site install - though oddly it would only happen when using Drush, and not when doing it through the GUI. Wonder what that was about.

WD php: PDOException: SQLSTATE[23000]: Integrity constraint violation: 19 column name is not unique: INSERT INTO         [error]
{l10n_update_project} (name, project_type, core, version, l10n_server, l10n_path, status) VALUES (?, ?, ?, ?, ?, ?, ?);
Array
(
    [0] => hboss_cs
    [1] => module
    [2] => 7.x
    [3] => 7.x-1.2
    [4] => 
    [5] => http://ftp.drupal.org/files/translations/7.x/hboss_cs/hboss_cs-7.x-1.2.%language.po
    [6] => 1
)
 in drupal_write_record() (line 6975 of /Users/garrett/Sites/hbosscs.test/www/includes/common.inc).
Cannot modify header information - headers already sent by (output started at /Users/garrett/Drupal                      [warning]

Checking out the most recent code from the repo instead of using the release code caused the problem to go away. Thanks, guillaumev.

Sutharsan’s picture

@Garrett Albright, Do you use the latest dev release? #11 should fix this and was committed just after beta3. How do you install, using an install profile or drush si + drush en?

Garrett Albright’s picture

Sutharsan, no, I didn't try the dev release - just went the Git route out of force of habit. If you'd like, I could give it a try though the dev release, though.

I'm installing using an install profile which depends on a Features module which in turn depends on this module.