dthonon / Client_API_VN

Export from VisioNature (Biolovision) web site to local postgresql database
GNU General Public License v3.0
3 stars 1 forks source link

transfer_vn : échec suite à "POST status code: 401" #165

Closed dthonon closed 2 years ago

dthonon commented 3 years ago

In GitLab by @mgageo on Jul 7, 2021, 10:11

Lors du transfert du taxo_group 11 (orthoptères ?), l'api répond avec un 401. La période demandée me semble erronée :
2021-07-07 09:29:11,040 - INFO - transfer_vn.download_vn - fb => Iter: 55, 0 obs, taxo_group: 11, territorial_unit: 56, date: 05/09/1902, interval: 1596
2021-07-07 09:29:11,207 - INFO - transfer_vn.download_vn - fb => Iter: 56, 0 obs, taxo_group: 11, territorial_unit: 22, date: 23/03/1898, interval: 1626
2021-07-07 09:29:11,376 - INFO - transfer_vn.download_vn - fb => Iter: 56, 0 obs, taxo_group: 11, territorial_unit: 29, date: 23/03/1898, interval: 1626
2021-07-07 09:29:11,589 - INFO - transfer_vn.download_vn - fb => Iter: 56, 0 obs, taxo_group: 11, territorial_unit: 35, date: 23/03/1898, interval: 1626
2021-07-07 09:29:11,786 - INFO - transfer_vn.download_vn - fb => Iter: 56, 0 obs, taxo_group: 11, territorial_unit: 56, date: 23/03/1898, interval: 1626
2021-07-07 09:29:11,958 - ERROR - transfer_vn.biolovision_api - POST status code: 401, text: OAuth Taxo Verification Failed, for URL https://www.faune-bretagne.org/api/observations/search/
2021-07-07 09:29:11,959 - ERROR - transfer_vn.biolovision_api - <Response [401]>
2021-07-07 09:29:11,959 - CRITICAL - transfer_vn.biolovision_api - Unreceverable error 401, raising exception
2021-07-07 09:29:11,959 - INFO - transfer_vn.store_postgresql - Closing connection to database fb_db

La consultation multi-critères indique : Toute la période enregistrée dans le système (mercredi 12 août 1987 - mardi 6 juillet 2021)

dthonon commented 3 years ago

In GitLab by @mgageo on Jul 7, 2021, 18:27

Sur une nouvelle VM je viens de relancer le transfert que pour ce groupe taxonomique. Il s'est terminé sans message d'erreur.

2021-07-07 18:23:00,046 - INFO - transfer_vn.download_vn - fb => Iter: 55, 0 obs, taxo_group: 11, territorial_unit: 56, date: 08/09/1902, interval: 1596
2021-07-07 18:23:00,251 - INFO - transfer_vn.download_vn - fb => Iter: 56, 0 obs, taxo_group: 11, territorial_unit: 22, date: 26/03/1898, interval: 1626
2021-07-07 18:23:00,433 - INFO - transfer_vn.download_vn - fb => Iter: 56, 0 obs, taxo_group: 11, territorial_unit: 29, date: 26/03/1898, interval: 1626
2021-07-07 18:23:00,623 - INFO - transfer_vn.download_vn - fb => Iter: 56, 0 obs, taxo_group: 11, territorial_unit: 35, date: 26/03/1898, interval: 1626
2021-07-07 18:23:00,812 - INFO - transfer_vn.download_vn - fb => Iter: 56, 0 obs, taxo_group: 11, territorial_unit: 56, date: 26/03/1898, interval: 1626
2021-07-07 18:23:00,812 - INFO - transfer_vn - fb => Ending download using controler observations
2021-07-07 18:23:00,812 - INFO - transfer_vn.store_postgresql - Closing connection to database fb_db
2021-07-07 18:23:01,153 - INFO - transfer_vn - Shutting down scheduler
2021-07-07 18:23:01,170 - INFO - transfer_vn - Shutting down scheduler in atexit, if still running
(VN_env) xfer38@debian10:~$

dthonon commented 3 years ago

Je pense que c'est plutôt un refus d'accès au groupe taxonomique 12, car le groupe 11 est terminé (territorial_unit: 56, date: 23/03/1898). Je n'ai pas accès à ma base de test pour le moment, mais je suppose qu'il s'agit des éphèmeres, qui sont en accès restreint sur faune-france. Est-ce que tu pourrais essayer sans les groupes

dthonon commented 3 years ago

In GitLab by @mgageo on Jul 7, 2021, 22:59

Oui, c'est effectivement le groupe 12 qui pose problème. Nous ne l'avons pas sur faune-bretagne.

Il y a d'autres groupes que nous n'avons pas mais qui figurent dans le fichier yaml et qui ne posent pas de problème.

dthonon commented 3 years ago

An HTTP 401 (Unauthorized) should not be fatal and downloading should resume at the next taxo_group.

dthonon commented 2 years ago

En fait, le problème vient du taxo_group 12 (Hyménoptères), qui est en accès limité sur FB, alors que les autres sont réellement non disponibles. Il faut soit le retirer de la liste, soit demander l'accès.

Je ne vais pas modifier le code, car il doit pouvoir fonctionner avec les taxo_groups en accès limité. Je vais le documenter dans l'API.

dthonon commented 2 years ago

mentioned in commit bd8702b758e99503e71c06facd6eb5fa7e902a42

dthonon commented 2 years ago

Not an issue to be fixed. See YAML template for correct handling of limited access taxo_groups.