VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: Thomaz on May 20, 2014, 21:28:52 PM

Title: vmError VmTableData::store failed - Duplicate entry '255' for key 'PRIMARY'
Post by: Thomaz on May 20, 2014, 21:28:52 PM
Hi

Suddenly I get this error when users try to pay with visa card. But the ePay plugin window also pop up. Does anymore know what i missing or going wrong?

vmError: VmTableData::store failed - Duplicate entry '255' for key 'PRIMARY' SQL=INSERT INTO `jos_virtuemart_payment_plg_epay` (`id`,`virtuemart_order_id`,`order_number`,`virtuemart_paymentmethod_id`,`payment_name`,`payment_order_total`,`payment_currency`,
`cost_per_transaction`,`cost_percent_total`,`tax_id`,`epay_response`,`created_on`,`created_by`,`modified_on`,`modified_by`) VALUES ('0','336','6d060266','2','Dankort - Visa/Dankort','0','0','0','0','0','0','2014-05-20 19:03:49','860','2014-05-20 19:03:49','860')

(http://fitnessnutrition.dk/error.jpg)

VM: 2.6.0a
Joomla: 2.5.18
http://fitnessnutrition.dk

Kind regards
Thomas
Title: Re: vmError VmTableData::store failed - Duplicate entry '255' for key 'PRIMARY'
Post by: GJC Web Design on May 20, 2014, 21:53:36 PM
very odd .. it is trying to store the order to the epay payment table but for some reason it is not incrementing the index (id) or at least trying to store a duplicate value..
the sql query looks correct though  - the first value '0' should just increment.

Have you asked the epay people?
Title: Re: vmError VmTableData::store failed - Duplicate entry '255' for key 'PRIMARY'
Post by: Thomaz on May 21, 2014, 10:24:51 AM
Hi

Thanks for reply. No I would try here first. But I will contact them and ask.
Title: Re: vmError VmTableData::store failed - Duplicate entry '255' for key 'PRIMARY'
Post by: jelly on June 02, 2015, 11:27:10 AM
Hi, has this problem been solved?

I have the same problem (Other Payment Provider, other country)

When Googling on "ERROR vmError: VmTableData::store failed - Duplicate entry '255' for key 'PRIMARY' SQL=INSERT INTO" more of these problems appear, but unfortunately no solution...
Title: Re: vmError VmTableData::store failed - Duplicate entry '255' for key 'PRIMARY'
Post by: Milbo on June 04, 2015, 09:35:12 AM
assumingly,... they used an tinyint for that.
Title: Re: vmError VmTableData::store failed - Duplicate entry '255' for key 'PRIMARY'
Post by: Studio 42 on June 04, 2015, 21:21:56 PM
Hi,
As explained by Max, this must be a bad database setting on the type for the primary key

search the table jos_virtuemart_payment_plg_epay cilck on strucutre and change the ID key to int
or execute this query on mysql:
ALTER TABLE `jos_virtuemart_payment_plg_epay` MODIFY `id` INT(1) UNSIGNED;
change the prefix jos, if you use another.
Quote from: Thomaz on May 20, 2014, 21:28:52 PM
Hi

Suddenly I get this error when users try to pay with visa card. But the ePay plugin window also pop up. Does anymore know what i missing or going wrong?

vmError: VmTableData::store failed - Duplicate entry '255' for key 'PRIMARY' SQL=INSERT INTO `jos_virtuemart_payment_plg_epay` (`id`,`virtuemart_order_id`,`order_number`,`virtuemart_paymentmethod_id`,`payment_name`,`payment_order_total`,`payment_currency`,
`cost_per_transaction`,`cost_percent_total`,`tax_id`,`epay_response`,`created_on`,`created_by`,`modified_on`,`modified_by`) VALUES ('0','336','6d060266','2','Dankort - Visa/Dankort','0','0','0','0','0','0','2014-05-20 19:03:49','860','2014-05-20 19:03:49','860')

(http://fitnessnutrition.dk/error.jpg)

VM: 2.6.0a
Joomla: 2.5.18
http://fitnessnutrition.dk

Kind regards
Thomas
Title: Re: vmError VmTableData::store failed - Duplicate entry '255' for key 'PRIMARY'
Post by: Henrik Holm Nielsen on June 09, 2015, 03:25:44 AM
As mentioned by Max & Studio 42 - changing the id to INT solves the problem:)
Thanx for the input!