-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Running Magento cron does not reindex indexer #2855
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Possibly related to #2672 |
Hi, Do you still experience the issue? If yes, could you
Thanks, |
I am finding the same problem. If you add a new product it does not show. If you run cron by SSH it's supposed to reindex data when it is set to update on schedule and make the product show. It's only when you reindex by SSH the product will show. |
Still not working on 2.0.2. The cron job runs without error but the Catalog Rule Product never rebuilds. Manually running indexer:reindex solves the problem. |
Please note that You must run cron twice: the first time to discover tasks to run and the second time to run the tasks themselves. I could not reproduce the issue with catalog rules on the freshest Magento version available on GitHub today. Could you check jobs statuses in |
Running cron by SSH twice works and reindexes data. |
This is a bug. To fix it, we must understand when it happens. |
As far as I can see there are no errors. All entries for indexer in cron_schedule table have status "success" |
There are some errors though I'm mostly at a loss to troubleshoot them.
|
@pynej thank you for posting the error. Thanks, |
@bondimedical3 I've noticed you mentioned cPanel. Is it a shared hosting? If yes, does it allow triggers in mysql database? Scheduled indexer mode is based on triggers usage that fill changelog with changed entity ids. |
@pynej |
@rganin I am running my sites on a VPS |
@bondimedical3 , still can't reproduce the issue you've described. To verify it's an indexer fault and not some rights-related issue could you please check that "indexer"-related cron jobs in cron_schedule table are generated and have been executed (see the execution time), query something like |
@rganin , all indexer jobs in the cron_schedule table have status "success". Maybe it's easier if I give you admin access and you can have a look at it? |
@bondimedical3 @rganin Could it be part of my problem with launch correctly a cron to see the log? |
@ntzz It seems to be a different problem. You can submit a new issue here on github for your problem if it doesn't exist yet. |
@bondimedical3 We couldn't reproduce your issue. Looks like it's on your side. Please try post your question on stack exchange or Magento community forums. Best, |
@antboiko i had already create an issue on stackoverflow a few comments before, could you check if you could find anything wrong there? |
@antboiko You need to investigate this issue further. Stack Exchange is already flooded with the same question from many people. You haven't even bothered to ask for my Admin details. |
Ok, doing a composer update has fixed that issue. I am still being a similar/related issue where when i add a new product and wait ann the con jobs run and all by index's claim they are valid, but the new product wont show up unless i manually run the reindex. I will try to get a more detailed explication next week. |
Ok, I have identified a second issue with my cron configuration that was causing the jobs to fail but not produce any appropriate error messages. I'm suing the following cron script:
As you can see the I was able to correct my issue by updating my path in the crontab file.
I get that my system my be a bit oddball and this is not a common problem, but it was breaking, and took a long time to track down. The major issue being when |
@bondimedical3, seems your issue is not related to cron but to search indexer. Internal ticket MAGETWO-52583, will be delivered soon. |
Hi @OgreMHDW, some issue with indexer was fixed and delivered, commit - 76cee92, thank you for reporting, please feel free to write here, or to open new issue if doesn't help. @bondimedical3 @ntzz @pynej if you still have issue, please create another one issues. |
Where is the internal ticket? |
@bondimedical3, MAGETWO-52583 is Magento's internal bugtracker ticket. |
I have updated to Magento 2.0.6 which I assume would include all these fixes but the issue is still present? |
@bondimedical3 2.0.6 is a patch version that includes only some individual fixes. |
I am getting a new message every day that "Catalog Rule Product" requires reindexing. Can you at least put a button in the Admin which allows people to manually do this? |
@bondimedical3 if you setup a cron job to run in background, you don't need to do it manually http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-cron.html#config-cli-cron-bkg You can do this to run cron from browser http://devdocs.magento.com/guides/v2.0/config-guide/secy/secy-cron.html |
Hi team, I'm getting the same issues, Im on a hosted server running Cpanel and CentOS 6.6, PHP7 I have tried the below. In the Error log it shows 2016-05-24 13:23:02 Ran jobs by schedule, However, no indexing occurs. /usr/local/bin/php /home/downupne/public_html/bin/magento cron:run | awk '{ print strftime("%Y-%m-%d %H:%M:%S"), $0; fflush(); }' 2>&1 >> ~/magento_cron.log /usr/local/bin/php /home/downupne/public_html/update/cron.php | awk '{ print strftime("%Y-%m-%d %H:%M:%S"), $0; fflush(); }' 2>&1 >> ~/magento_cron.log /usr/local/bin/php /home/downupne/public_html/bin/magento setup:cron:run | awk '{ print strftime("%Y-%m-%d %H:%M:%S"), $0; fflush(); }' 2>&1 >> ~/magento_cron.log My hosting provider has tried to run via SSH to get the below error message, Well, I've executed your crons manually, it doesn't seem if you've correct coding. This is the error :- You would need to check the syntax of your files. I'm utterly lost, I need to be up and running soon for the launch of a new product. Any help would be greatly appreciated. |
how would i find the cron is running or not |
I'm experiencing the same problem of bondimedical3. Via SSH or Cron job, i have the same result: New products does not appear in the catalog. /opt/plesk/php/7.0/bin/php /var/www/vhosts/myhost/bin/magento cron:run | grep -v "Ran jobs by schedule" >> /var/www/vhosts/myhost/log/magento.cron.log No messages in the log file. in the table cron_shedule, after running twice, I can see that the job "indexer_reindex_all_invalid" reports the status "success". But my new product doesn't appear in the catalog. The new product is online only after reindex with: It appears that indexers are not invalidated after adding a new product. In fact, changing manually in the database the value "valid" to "invalid" for the "indexer_id" = "catalog_category_product" in the table "indexer_state" and running the cron job, my new product appears online! Is there a fix for this? Thanks, |
Make sure you have the 3 cron jobs setup correctly |
@bondimedical3 did you solve this problem? |
Yes. They fixed the issue with 2.1 |
@bondimedical3 i'm running 2.1 and i've checked also 2.1.2 without success. Does anybody know how to fix this problem? |
@bondimedical3 Thanks, Setup and update jobs, same way. I think that it is working because it is also responsible for password exchange email, send and receive emails for orders, invoice, shipment, send newsletters and all of those tasks are correctly running. |
If the cron jobs are not setup correctly then everything will work like order emails, newsletters etc but products will not appear in the frontend. You will need to look at issue in more depth or have your Magento Developer look at the problem. |
I think I have the same problem as @PierAlex that I can add new products but they don't appear in the frontend. Magento CE 2.1. It seems that it's not invalidating the index correctly, since "indexer:status" shows all indexes as "ready", which means that the cron job will skip them. When I force a reindexing of every index with "indexer:reindex" the new product appears on the frontend. Edit: seems there are many people having this problem in #5836 |
In the Magento Admin do you guys have Index Management mode set to "Update By Schedule" ? |
Yes. I have tried both update by schedule and update on save. Neither works correctly. The new products do not show until the indexers are reindexed manually through CLI. |
Yes, update by schedule, cron running every minute. |
hi there, possible solution for not fine-tuned cron jobs (expecially for shared hostings) can be found here: #5836 |
[borg] MAGETWO-91528: Customizable options truncated when displaying ordered product in admin
I am very confused about a new experience in Magento 2. I have set up the Magento cron job to run every 1 minute using the command "magento cron:run". After the command is run by cron it does return "Ran jobs by schedule." After adding several products the indexer is not running to add those products to the site.
Per the page http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-cron.html it states "The first command (magento cron:run) reindexes indexers" but that is not happening.
I am able to run the command, from http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-index.html, magento indexer:reindex to have the products indexed and added to the store.
Is this a bug or is should I be setting up an additional cron job just to index the site?
The text was updated successfully, but these errors were encountered: