Not downloading any data

Hello,

I have installed latest version of Sen2Agri yesterday [Release 20-09-2018]. When I define “Site” and choose L4A product (Crop Mask), system started, but nothing can be downloaded. I have checked credentials on both Sentinel and Landsat web sites. You can see logs attached. Could you please help me find out what is wrong?

Logs: https://pastebin.com/RY2wjAAP

Thank you in advance,
Mihael

Hi,
I tried to solve the problem during the weekend and made the fix that was suggested in the thread “Sentinel-2 - not downloading ver. 1.8.3”.

delete from public.datasource where id = 2;
update datasource set enabled = false where satellite_id = 3;

Now my ‘datasource’ table looks like this:
id | satellite_id | name | scope | username | passwrd | fetch_mode | max_retries | retry_interval_minutes | download_path | specific_params | max_connections | local_root | enabled
----±-------------±--------------------±------±---------------±-------------±-----------±------------±-----------------------±--------------------------------±--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------±----------------±-----------±--------
5 | 1 | Amazon Web Services | 2 | | | 1 | 72 | 60 | /mnt/archive/dwn_def/s2/default | {“parameters”:{“dsParameter”:[{“name”:"cloudcover…| 1 | | f
4 | 1 | Scientific Data Hub | 3 | xxxxxxx | xxxxxxx | 1 | 72 | 60 | /mnt/archive/dwn_def/s2/default | {“parameters”:{“dsParameter”:[{“name”:"cloudcover…| 1 | | t
1 | 2 | USGS | 1 | xxxxxxx | xxxxxxx | 1 | 72 | 60 | /mnt/archive/dwn_def/l8/default | {“parameters”:{“dsParameter”:[{“name”:"cloud_from…| 1 | | t
6 | 2 | Amazon Web Services | 2 | | | 1 | 72 | 60 | /mnt/archive/dwn_def/l8/default | {“parameters”:{“dsParameter”:[{“name”:"cloudcover…| 1 | | t
3 | 3 | Scientific Data Hub | 3 | xxxxxxx | xxxxxxx | 1 | 72 | 60 | /mnt/archive | {“parameters”:{“dsParameter”:[{“name”:"platformNa…| 1 | | f
(5 rows)

I read somewhere that sen2agri does not support MULTYPOLIGON geometry type for site definition, but in geography_columns view I find that geometry in ‘site’ table is declared as MultiPolygon.

f_table_catalog | f_table_schema | f_table_name | f_geography_column | coord_dimension | srid | type
-----------------±---------------±-------------------±-------------------±----------------±-----±-------------
sen2agri | public | site | geog | 2 | 4326 | MultiPolygon
sen2agri | public | downloader_history | footprint | | 0 | Geometry
sen2agri | public | product | geog | | 0 | Geometry
sen2agri | public | shape_tiles_l8 | geog | 2 | 4326 | MultiPolygon
sen2agri | public | shape_tiles_s2 | geog | | 0 | Geometry
(5 rows)

I also found in 03.site.sql file that ‘geog’ column in ‘site’ table is defined as multipolygon:

CREATE TABLE site
(
id smallserial,
name character varying NOT NULL,
short_name character varying,
geog geography(multipolygon) NOT NULL,
enabled boolean NOT NULL,
CONSTRAINT site_pkey PRIMARY KEY (id)
);

I’m sure geometry in my site shapefile is defined as POYGON geometry type, but when I upload the polygon shapefile, the geometry is inserted as multipoligon.

sen2agri\site>ogrinfo -al site_3.shp
INFO: Open of site_3.shp' using driverESRI Shapefile’ successful.

Layer name: site_3
Metadata:
DBF_DATE_LAST_UPDATE=2018-09-28
Geometry: Polygon
Feature Count: 1
Extent: (17.041099, 45.163104) - (18.573213, 45.785135)

After all, I have reduced the number of decimals in the site coordinates with SQL:

SELECT ST_AsText(ST_SnapToGrid(‘MULTIPOLYGON(((17.0410986388555 45.7851345027698,18.5732133702968 45.7225140096592,18.5732133702968 45.7225140096592,18.5481651730525 45.1631042712038,17.0619721365591 45.2298994638552,17.0410986388555 45.7851345027698)))’, 0.00001));
UPDATE site SET geog = st_geometryfromtext(‘MULTIPOLYGON(((17.0411 45.78513,18.57321 45.72251,18.54817 45.1631,17.06197 45.2299,17.0411 45.78513)))’, 4326) WHERE id = 5
downloader_history.txt (12.8 KB)
sen2agri_log.txt (155.6 KB)

… but the result is the same.
The log file and is attached.

Dear Mihael,

I saw that you have set no Landsat Download option. For the USGS entry (id = 1) in the datasource table, shouldn’t it be scope = 3 (query and download)? Have you tried setting the AWS entries (id = 5 and 6) to query only (scope = 2)? Not sure if this helps.
In your logs provided via “pastebin” it also states an error with “invalid credentials”. Have you checked them?

Regards
Oliver

Dear Buckoli,
Thank you for your response. I changed scope for the USGS entry and set scope = 3.
Now sen2agri download works, but there was also the issue with the invalid credentials (Yes, I said I checked credentials twice). With my colleague’s account on Scientific Data Hub something went wrong. I changed credentials with my username and password (which I know it works) but only in services.properties file, expecting that restart will make the update in the database.
It might be good feature to have this update mechanism embedded in the restart of the service.