Magento 2 problem with reindexing at adminside - magento2

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.

Related

trying to delete data from table

in mysql workbench im trying to execute
delete from basic_info where rollno>3;
this query but im getting this message
Error Code: 1175. You are using safe update mode and you tried to
update a table without a WHERE that uses a KEY column To disable safe
mode, toggle the option in Preferences -> SQL Editor and reconnect.
You can try using below commands.
SET SQL_SAFE_UPDATES=0;
delete from basic_info where rollno>3;
SET SQL_SAFE_UPDATES=1;
Create an INDEX with rollno column, good for a long term not only this query
You didn't say which MySQL Workbench you are using, but make sure you always use the latest one to get all latest bugfixes.
Since you obvioulsy have a where clause in your query it looks like it is not recognized (which would be a bug). Hence my advice to use the latest version.
In any case you can disable the safety check in the preferences of MySQL Workbench.

Integrity constraint violation error in Magento 2.1.2

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

datagrip Cannot apply changes This table is read only. Cell editor changes cannot be applied

So simply the problem occurs when I want to edit selected rows and then apply it. I'm sure it worked some time ago. Tried redownload postgres driver in preferences(yeah, I use postgres) Anyone faced same issue? Anyone succeed?
PS. Running on 142.4861.1.
I found read only checkbox in connection preferences, it was not set, toggling didn't help, upgrading, reseting also didn't help.
In my case in version 2020.1 of DataGrip (SQL was run from the opened file, on unique table, so that select just worked as expected, but when I was trying to edit - error appeared: unresolved table reference): specifying schemes in request helped. So that SELECT * FROM users; was changed to SELECT * FROM schemadb.users; and that helped. Probably there is a bug. I've tried all the methods mentioned above.
Try synchronize database connection. It helped me in mysql connection.
What actually helped was toggling Auto-commit checkbox in console, after that everything runs flawlessly.
The only thing that actually worked for me, after trying everything above multiple times, was deleting each DB connection and remaking a new one from scratch.
This can be due to default settings, make it sure your your transaction Mode settings are as below
I had the same issue with datagrop 2020.2. I have followed all the method but for me, just delete the connection and create new connection (never trying to duplicate) just manual. It is works!
Set and clear Read-only in Data Source Properties helps me.
What worked for me was removing a field alias - going from this:
SELECT
l.MSKU Item_SKU,
l.Supplier,
l.ASIN,
l.title,
l.Buy_Price
FROM listings l
WHERE l.Buy_Price IS NULL
ORDER BY l.Supplier, l.listingID desc;
to this:
SELECT
l.MSKU,
l.Supplier,
l.ASIN,
l.title,
l.Buy_Price
FROM listings l
WHERE l.Buy_Price IS NULL
ORDER BY l.Supplier, l.listingID desc;
is all it took for me to be able to edit the results of the query
If your query is using field alias (renaming column instead of using actual column name) , then Datagrip set data results as read only.
Solution:
Rewrite query using field names as in the table and rerun query. Then you will be able to edit the rows.
Example
Rewrite this:
select id,interest_recalcualated_on, interest_recalculation_enabled alias from m_loan;
..to this:
select id,interest_recalcualated_on, interest_recalculation_enabled from m_loan;
Nothing worked. I had to update DataGrip from 2017.2 to 2018.3
I had to open the project by navigating to: /home/user/.DataGrip2017.2/config/projects/my_project/
All my scripts for this project as I did not want to import the config from the old version of Datagrip. So I'll probably need to downgrade, get the scripts and upgrade again.
I struck the same issue, not Postgres but MySql, PhpStorm 2019.1 when I had two schema available on the same db connection and my query: select * from users where full_name like '%handy%'; resulted in a result table that couldn't be edited even though the console reported it was querying the stage schema. A more specific query: select * from stage.users where full_name like '%handy%'; using the exact table name led to a results table that could be inline edited.
The only way I was able to get around this issue was to remove the database connection details for the given connection and recreate them from scratch. While this was happening to me on this specific connection, editing was working fine on other connections, which suggests the problem might be related to specific parameters around the connection in question.
For me, when I changed back my Select query to * (wild char to select all the columns), from specific columns, the edit and save started to working again. This is strange! May be worth reporting a bug to intellij. I'm using DataGrip 2020.1 on macOs Catalina 10.15.3
I thought I had the same problem but just realized I needed to submit changes (with a button or command + enter) for them to be applied.
This answer is 4 years late though. Maybe the bug was already fixed haha, but this may help someone else.
The problem for me was the obvious (well obvious after identifying it) - using a MySQL keyword as a field name (yes I know its not a good idea but thats how it is sometimes). So this caused the error
select id,name,value from mytable;
The correct way to write this of course is using backticks so:
select id,name,`value` from mytable;
and this solved it for me.
seems like DataGrip doesn't allow to change data in the ui table if you select specific columns with joins.
so if you select table1.column1, table2.column2 from <table1> inner join <table2> and try to change the value in column1, you will receive This table is read only warning
only if you do select * from <table>, you can edit the cell values
try this
In the IDE settings (Ctrl+Alt+S), go to Database | General.
Select the Open results in new tab checkbox and click OK.
Re-run your query, and you'll be able to edit and commit the changes in the new tabs.

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