Integrity constraint violation error in Magento 2.1.2 - magento2

I am trying to edit configurable product and getting error. I am using Magento version 2.1.2
Steps to reproduce:
Go to admin -> Stores -> Configuration -> Sales -> Google API section
Change the configuration Enable Content Experiments to "Yes"
Save a configurable product and its child product consecutively.
Expected result:
Product should be save successfully with any number of times.
Actual result:
failed to save product
getting bellow error:
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry
'0-402-product' for key
'GOOGLEOPTIMIZER_CODE_STORE_ID_ENTITY_ID_ENTITY_TYPE', query was:
UPDATE googleoptimizer_code SET entity_id = ? WHERE (code_id='136')
Anyone can help me to fix this issue?

I found the solution. To fix this issue I edit configurations options and its worked for me. please refer this link http://prntscr.com/e7px78

Related

Magento 2 problem with reindexing at adminside

I am trying to re-indexing from admin side for stock and inventory as update on save. But it return error
We couldn't change indexer(s)' mode because of an error.
And in debug log is showing error like
1360 Trigger does not exist, query was: DROP TRIGGER IF EXISTS `trg_cataloginventory_stock_item_after_insert`
I am using magento version 2.3 series.
Thank you in advance.
I tried with indexing command then It will works fine but issue is at adminside re-indexing only.

Unable to search for Orders/Customers in oracle commerce (ATG) - CSC 11.1

I am trying to perform order and profile search operations on CSC, but they return no results.
I the components /atg/commerce/textsearch/OrderOutputConfig/ and /atg/userprofiling/textsearch/ProfileOutputConfig/ and I found them indexing perfectly in the tables SRCH_ORDER_TOKENS and SRCH_PROFILE_TOKENS respectively.
After enabling loggingDebug in both components I found that the search query has additional condition seems that it's related to multisite pfrmZeroRealmsAccessible, however I found that all tokens stored in DB for orders and customers have this value pfrmdft. Below is the query extracted from logs:
[++SQLQuery++]
SELECT t1.id
FROM srch_order_tokens t1
WHERE CONTAINS(t1.tokens,?,0) > 0
-- Parameters --
p[1] = {pd: tokens} pflnAhmad% AND pfrmZeroRealmsAccessible% (java.lang.String)
[--SQLQuery--]
Note: My application has only one single site (not multisite) however I found some configuration files created by CIM related to multisite which I can't remove.
Please help me answering the following question:
Is this issue really related to multisite configuration and how can I fix this problem in orders and customers search?
In Oracle commerce 11.1 how can I disable working with multisite?
Thanks
If you have not configured multi site then you need change the property "siteAccessControlOn" to false in the below component
/atg/commerce/custsvc/environment/CSREnvironmentTools/
for more details you can get back to the below oracle docs link
http://docs.oracle.com/cd/E52191_01/Service.11-1/ATGCommerceServiceCenterInstall/html/s1203controllingsiteaccess01.html

Magento getting error on product flat data reindixing

Getting this error
while reindexing using ssh command
exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1005 Can't create table './admin_magento16/catalog_product_flat_4.frm' (errno: 150)' in /home/magesite/public_html/store/lib/Zend/Db/Statement/Pdo.php:228
in my magento database there is no catalog_product_flat_4 table is present
what should I need to do for this?
Did you clean Magento cache before reindexing?
I can recommend you to check your database with original Magento Database Repair Tool
able to solve this problem with our team
1st I checked database
checked the core_store table there are 4 store created
also the catalog_product_flat_2 , 3 , 4 tables are missed
I checked my admin panel there is only 1 store
so create the sites from admin panel add added the catalog_product_flat_2 , 3 , 4
then re-index is works fine
cheers :)

Magento: Item (Mage_Sales_Model_Order) with the same id "1" already exist

After I migrate my Magento shop from one hosting provider to another one. Before I start to migrate a delete all my test orders and put counter of order number to 0.
I have big problem. When I want to go in back office into sales->order I get an error "There has been an error processing your request
Exception printing is disabled by default for security reasons.
Error log record number: 213759415"
If I go into var/report and open file "213759415" I see 36 lines the first one are:
a:5:{i:0;s:64:"Item (Mage_Sales_Model_Order) with the same id "1" already exist";i:1;s:5345:"#0 /usr/home/xxx/domains/xxx.com/public_html/lib/Varien/Data/Collection/Db.php(576): Varien_Data_Collection->addItem(Object(Mage_Sales_Model_Order))
I have Magento 1.7.0.2
Any ideas?
Many thanks!
I found in db, tabel called "onestepcheckout" where I forgot to delete test orders.
Make sure you properly deleted all test orders.
You can use the following module to do this:
http://www.magentocommerce.com/magento-connect/asperience-deleteorders.html

JPA model update [1.1.1]

I'm sure this is something very simple, but for the life of me can't
find the correct keywords on google.
Basically I've updated a couple models since my last deployment. Dev is set up with the jpa.ddl default setting of create-drop. Now I read that prod isn't supposed to run with jpa.ddl=update, so does that mean I have to manually script a schema change? I couldn't find any documentation saying the correct way. I am also using playapps, so the database is set up there. I set up ssl, so I should have sql access via command line. However, I was having difficulty figuring out the syntax for modifying the db. I'm so used to a gui environment such as phpMySQL or microsoft's sql server. The errors specifically I'm getting are the following two (when running the application after uploading to prod).
Unsuccessful: alter table PhotoSlide add index FK57E3FABF5C905145 (aPhoto_id), add constraint FK57E3FABF5C905145 foreign key (aPhoto_id) references StorePhoto (id)
Cannot add or update a child row: a foreign key constraint fails (play/#sql-2e29_32, CONSTRAINT FK57E3FABF5C905145 FOREIGN KEY (aPhoto_id) REFERENCES StorePhoto (id))
you can achieve that by using the migration module.More details you can find #
http://www.playframework.org/modules/migrate
The flow will be like the below:
You push new code to prod --> you run migrations --> restart the server
More documentation at :
https://github.com/dcardon/play-migrate/blob/master/documentation/manual/home.textile
With the latest version play supports migrations :
http://www.playframework.org/documentation/1.2.4/evolutions