CSV Stock Import Duplicate Entry Error

Questions around the TYPO3 integration and plugins
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
kai_lf
Posts: 9
Joined: 26 Mar 2021, 21:47

CSV Stock Import Duplicate Entry Error

Post by kai_lf » 29 Apr 2024, 09:15

Hi there! I have a strange symptom on importing stocks via CSV on TYPO3. I have double checked the csv on duplicate entries in the file - and double checked the database. So, there is only one row with ProdID "13442" in the file and one entry with ProdID "13442" in the database.
But I always get the following Error:
Stock import error: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '13442-default-1.' for key 'mshop_stock.unq_mssto_pid_ty_sid':
INSERT INTO "mshop_stock" (
"prodid", "type", "stocklevel", "backdate",
"timeframe", "mtime", "editor", "siteid", "ctime"
) VALUES (
?, ?, ?, ?, ?, ?, ?, ?, ?
)
["13442","default",10,null,"7","2024-04-26 15:03:56","scheduler","1.","2024-04-26 15:03:56"]


But -> if I import only this one line with the related product - everything works fine.
And - even weirder -> if I split the file in chunks with about 100 lines each, although everything works fine.

So where does this "duplicate Entry" Error come from? Any help is very appreciated - but for the moment I can work with the splited files.

CSV contains about 10k lines of data
TYPO3 Version: 11.5.33
aimeos Version: 22.10.9

User avatar
aimeos
Administrator
Posts: 8378
Joined: 01 Jan 1970, 00:00

Re: CSV Stock Import Duplicate Entry Error

Post by aimeos » 30 Apr 2024, 07:21

Do you have the same product code twice in the file?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

kai_lf
Posts: 9
Joined: 26 Mar 2021, 21:47

Re: CSV Stock Import Duplicate Entry Error

Post by kai_lf » 10 May 2024, 06:07

Sorry for the late reply...
To answer your question: no! All the product codes are unique.
As a solution I split the file in many files with a maximum of 1500 lines of stock. Same data.
If I merge all of the files again to one big file and import it - the error shows up again.

User avatar
aimeos
Administrator
Posts: 8378
Joined: 01 Jan 1970, 00:00

Re: CSV Stock Import Duplicate Entry Error

Post by aimeos » 10 May 2024, 07:16

Would be interesting to find out why and what line is causing that.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply