Jump to content

WHMCS import issue for duplicate primary key in importInvoices


Himax

Recommended Posts

Hello,

I'm trying to import my WHMCS data into Blesta (trial) but the process is stopping early during import of the invoices. There's a duplicate primary key in one of the blesta tables. Everything after fails. I was unable to find the duplicate key in my whmcs dump (grepped, searched ... nothing!).

Below is a debug log from the frontend. What do you suggest me to do?

importStaff
-----------------
importStaff took: 2.2723 seconds
-----------------

importClients
-----------------
importClients took: 18.2174 seconds
-----------------

importContacts
-----------------
importContacts took: 0.3054 seconds
-----------------

importTaxes
-----------------
importTaxes took: 0.035 seconds
-----------------

importCurrencies
-----------------
importCurrencies took: 0.0249 seconds
-----------------

importInvoices
-----------------
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1-519' for key 'PRIMARY'
importTransactions
-----------------
There is already an active transaction
importPackages
-----------------
There is already an active transaction
importPackageOptions
-----------------
importPackageOptions took: 0.1337 seconds
-----------------

importServices
-----------------
There is already an active transaction
importSupportDepartments
-----------------
There is already an active transaction
importSupportTickets
-----------------
There is already an active transaction
importAffiliates
-----------------
There is already an active transaction
importMisc
-----------------
There is already an active transaction
decrypted 17 values using WHMCS' custom algorithm
decrypt took: 0.0003 seconds
total time took: 71.6811 seconds
Array
(
    [error] => Array
        (
            [0] => The import completed but the following errors ocurred:
            [1] => importInvoices: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1-519' for key 'PRIMARY' on line 196
            [2] => importTransactions: There is already an active transaction on line 231
            [3] => importPackages: There is already an active transaction on line 231
            [4] => importServices: There is already an active transaction on line 231
            [5] => importSupportDepartments: There is already an active transaction on line 231
            [6] => importSupportTickets: There is already an active transaction on line 231
            [7] => importAffiliates: There is already an active transaction on line 231
            [8] => importMisc: There is already an active transaction on line 231
        )

)

 

Link to comment
Share on other sites

  • 2 weeks later...

it looks like the issue happens on a customer with "billable items" that were invoiced on multiple invoices, please see the attached image That is, WHMCS allows you to create a generic billable item and to specify that it has to be billed multiple times. So WHMCS will bill the item on multiple invoices at the predefined schedule. Then you can see on which invoices it was billed. So you have a back-reference or link from the invoices to the billable item. My guess is that the import module is trying to create this recurring billable item multiple times.

Perhaps it's enough to "ignore" the error or to check if the recurring item is already present and act accordingly.

Let me know, as this is blocking for me. I'd like to proceed with a paid license.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...