How to force the recheck for products not downloaded?

  • Posted on: 7 July 2020
  • By: cudroiu

Normally, the system is querying for new products on SciHub in an incremental manner meaning that the services are not querying all the time from the beginning of the season but actually the queries are performed starting from the date of the last downloaded product. This is implemented in this way as for large sites the querying is very slow (for sites that consist for more polygons or more tiles and also large seasons, resulting thus into a lot of pages to be extracted, the limit being usually 50 products per page).Due to this mechanism, if some products are processed by SciHub with delays of several days (maybe due to some maintenance activities), some of the products can be missed from downloading.

A force re-check for new products from the begining of the season can be reinitiated by executing the following commands:

psql -U admin sen4cap -c "insert into config (key, value) values ('downloader.S2.forcestart', 'true') on conflict do update set value = 'true'"
psql -U admin sen4cap -c "insert into config (key, value) values ('downloader.S1.forcestart', 'true') on conflict do update set value = 'true'"
psql -U admin sen4cap -c "insert into config (key, value) values ('downloader.L8.forcestart', 'true') on conflict do update set value = 'true'
psql -U admin sen4cap -c "delete from downloader_history where status_id in (3, 4)"
psql -U admin sen4cap -c "update config set value = 'true' where key like '%.forcestart'"
sudo systemctl restart sen2agri-services

Additional filters can be added for a certain site or satellite, during the delete from downloader_history table, for example if only S2 needs to be reset, the above command could be modified in the following way:

psql -U admin sen4cap -c "delete from downloader_history where status_id in (3, 4) and satellite_id = 1"

Also, if the reset is intended only for a specific site, the above command can be modified in the following manner:

psql -U admin sen4cap -c "delete from downloader_history where status_id in (3, 4) and satellite_id = 1 and site_id = <YOUR_SITE_ID>"

Where <YOUR_SITE_ID> is the id from the database of your site. The list of sites can be viewed using the following command:

psql -U admin sen4cap -c "select id, name, short_name from site"