For arlanix/product-feed 1.0

Cron and command line

For the developer who looks after the store. The store owner runs feeds from the admin; this page is what is underneath.

The cron jobs

Every feed is built and delivered by the Magento cron. The jobs run every minute and return at once when there is nothing to do.

Job Group Schedule Does
arlanix_feed_build_pending arlanix_feed every minute Rebuilds the catalogue rows of products that changed, for the store views a feed uses.
arlanix_feed_generate arlanix_feed every minute Writes the rows of every feed that is due by its schedule or queued by Generate now.
arlanix_feed_deliver_artifacts arlanix_feed every minute Publishes or uploads what was written.
arlanix_feed_synchronize_api arlanix_feed every minute For Merchant API feeds: compares the catalogue with what was sent.
arlanix_feed_push arlanix_feed every minute For Merchant API feeds: sends the queued products to Google.
arlanix_feed_mark_stuck_runs default every 5 minutes Marks a run that has said running for over an hour as failed.
arlanix_feed_clean_runs default 03:25 daily Removes old Run History.

The arlanix_feed group runs in a separate process (use_separate_process), so a long build does not hold up the rest of the store's cron.

Check that the cron runs

bin/magento cron:run
bin/magento cron:install   # only if cron:run says no crontab is installed

To see whether the Arlanix jobs actually ran:

SELECT job_code, status, MAX(finished_at) AS last_finished, COUNT(*) AS n
FROM cron_schedule
WHERE job_code LIKE 'arlanix_%'
GROUP BY job_code, status
ORDER BY job_code, status;

A success row with a recent last_finished for each job means all is well. The admin needs no SSH for the same answer: the Cron state item of the support bundle reports when the Arlanix jobs last ran and how the last 24 hours went.

When feeds never run

The grid says never delivered long after Generate now:

Run a feed from the command line

The same run as Generate now, without waiting for the cron:

bin/magento arlanix:feed:generate -f google-shopping     # one feed, by identifier
bin/magento arlanix:feed:generate -a                     # every active feed
bin/magento arlanix:feed:generate -f google-shopping --build-only     # build the rows, deliver nothing
bin/magento arlanix:feed:generate -f google-shopping --deliver-only   # deliver what is already built

It prints what it does and ends with the path of the file:

Store view 1
  Built 2040 product(s), 0 removed.
google-shopping
  Generated artifact 16 (181 rows).
  /var/www/html/pub/media/arlanix/feeds/google-shopping.csv

This is also the way to run a feed before the cron is set up, and the way to put a feed into a deployment script. Runs from the command line appear in Run History as triggered by cli, with the version and limits of the command-line PHP they ran under.

Where the files are

A file feed is published under pub/media/arlanix/feeds/:

https://your-store/media/arlanix/feeds/google-shopping.csv

The extension follows the format: .csv, .tsv, .xml, .json or .ndjson. The web server decides the Content-Type from it, so make sure it knows .json and .ndjson. The platforms fetch this address, so it must be reachable from the internet without a login: a staging site behind HTTP authentication or an IP allow-list cannot be fetched.

The file is replaced on every run; a run that fails leaves the previous file in place.

The log

The modules log to var/log/arlanix.log. The level is set in app/etc/env.php; the support bundle reports it, with the size and last write of the file.