Duplicate entry commerce license

Created on 9 June 2016, about 9 years ago
Updated 19 August 2025, 4 days ago

Hi there,

Hope it's possible to find out what the problem is with the following.
When I'm trying to add a licensed product to my cart I get the following error:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'commerce_license-168-0-0-und' for key 'PRIMARY': INSERT INTO {field_data_num_renewals} (entity_type, entity_id, revision_id, bundle, delta, language, num_renewals_value) 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_license [:db_insert_placeholder_1] => 168 [:db_insert_placeholder_2] => 177 [:db_insert_placeholder_3] => role [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und [:db_insert_placeholder_6] => 0 ) in field_sql_storage_field_storage_write() (regel 514 van server/modules/field/modules/field_sql_storage/field_sql_storage.module).

When I go back to the previous page and try again (several times) it works as expected. So I get the error let's say 4 out of 5 attempts. What I found out is the following. The last license added has license_id 166, when trying to add a license it takes 5 clicks to get it to work. It then adds a license with license_id 171.

Another strange thing is that some of my licenses disappear. I can't find them om my license overview page anymore and not in my database.
In the commerce_license table in the DB the last license_id is 166
In the commerce_license_revision table I do have some higher id's see attachment.

Thanks!
Joost

πŸ› Bug report
Status

Closed: outdated

Version

1.3

Component

Code

Created by

πŸ‡³πŸ‡±Netherlands zebda

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024