Some code might help, but I think you are trying to insert a row in the table cataloginventory_stock_status
and the stock_id
field is not filled in or is a value that is not present in the table cataloginventory_stock
on the column stock_id
.
By default Magento only has 1 row in the cataloginventory_stock
table with id 1
(I don't even know what it means).
Set that field to 1 and maybe it will work.