Bonjour,
Nous avons une instance de GN 3.4.4 et nous essayons la geopublication de couches carto via l'interface de GN, mais j'ai une erreur 403 affichée et effectivement la couche n'est pas publiée dans l'entrepot correspondant dans Geoserver. L'administration du serveur carto défini coté GN est mon compte avec des droits d'admin (mais aussi testé avec le compte admin de GS)
J'ai essayé via l'API rest de GN
curl -X GET "https://www.osuris.fr/geonetwork/srv/api/0.1/mapservers" -H "accept: application/json" -H "authorization: Basic YWRtaW46ZiZmN0BHUw==" -H "X-XSRF-TOKEN: bd3548c6-d788-4376-afa1-f377fc653551"
==> 200 ok
curl -X GET "https://www.osuris.fr/geonetwork/srv/api/0.1/mapservers/3847390/records/46651476-1d9d-499d-aa7e-93b89a206f7e?resource=data_gravi_ploemeur.zip" -H "accept: text/plain" -H "authorization: Basic YWRtaW46ZiZmN0BHUw==" -H "X-XSRF-TOKEN: bd3548c6-d788-4376-afa1-f377fc653551"
==> 500
/Undocumented /
Error: Erreur Interne de Servlet
puis erreur 403 dans la réponse.
J'ai aussi essayé avec un compte éditeur comme indiqué dans la doc, mais meme punition.
Coté geonetwork, j'ai en erreur
2021-02-15 16:24:17,067 ERROR [org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver] - Failed to invoke @ExceptionHandler method: public org.fao.geonet.api.ApiError org.fao.geonet.api.GlobalExceptionController.NotFoundHandler(java.lang.Exception)
org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation
...2021-02-15 16:24:17,069 ERROR [org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExconResolver] - Failed to invoke @ExceptionHandler method: public org.fao.geonet.api.ApiError org.fao.geonpi.GlobalExceptionController.NotFoundHandler(java.lang.Exception)
...2021-02-15 16:24:17,070 ERROR [jeeves] - Error occurred within a transaction
org.fao.geonet.api.exception.GeoPublisherException: Layer 'data_gravi_ploemeur' not found in mapserver. to publish it? Status code is 403.
...Feb 15, 2021 4:24:17 PM org.apache.catalina.core.StandardWrapperValve invoke
...SEVERE: Servlet.service() for servlet [spring] in context with path [/geonetwork] threw exception [Requerocessing failed; nested exception is java.lang.RuntimeException: org.fao.geonet.api.exception.GeoPublisxception: Layer 'data_gravi_ploemeur' not found in mapserver. Try to publish it? Status code is 403.] wroot cause org.fao.geonet.api.exception.GeoPublisherException: Layer 'data_gravi_ploemeur' not found in mapserver. to publish it? Status code is 403.
et coté GS, il ne me semble pas qu'il y ait de pb.
15 Feb 15:24:17 DEBUG [security.IncludeQueryStringAntPathRequestMatcher] - Checking match of request : 'Path: /rest/layers/hplus:data_gravi_ploemeur.xml, QueryString: quietOnNotFound=true'; against '/web/**'
15 Feb 15:24:17 DEBUG [security.IncludeQueryStringAntPathRequestMatcher] - Checking match of request : 'Path: /rest/layers/hplus:data_gravi_ploemeur.xml, QueryString: quietOnNotFound=true'; against '/gwc/rest/web/**'
15 Feb 15:24:17 DEBUG [security.IncludeQueryStringAntPathRequestMatcher] - Checking match of request : 'Path: /rest/layers/hplus:data_gravi_ploemeur.xml, QueryString: quietOnNotFound=true'; against '/'
15 Feb 15:24:17 DEBUG [security.IncludeQueryStringAntPathRequestMatcher] - Checking match of request : 'Path: /rest/layers/hplus:data_gravi_ploemeur.xml, QueryString: quietOnNotFound=true'; against '/j_spring_security_check'
15 Feb 15:24:17 DEBUG [security.IncludeQueryStringAntPathRequestMatcher] - Checking match of request : 'Path: /rest/layers/hplus:data_gravi_ploemeur.xml, QueryString: quietOnNotFound=true'; against '/j_spring_security_check/'
15 Feb 15:24:17 DEBUG [security.IncludeQueryStringAntPathRequestMatcher] - Checking match of request : 'Path: /rest/layers/hplus:data_gravi_ploemeur.xml, QueryString: quietOnNotFound=true'; against '/j_spring_security_logout'
15 Feb 15:24:17 DEBUG [security.IncludeQueryStringAntPathRequestMatcher] - Checking match of request : 'Path: /rest/layers/hplus:data_gravi_ploemeur.xml, QueryString: quietOnNotFound=true'; against '/j_spring_security_logout/'
15 Feb 15:24:17 DEBUG [security.IncludeQueryStringAntPathRequestMatcher] - Checking match of request : 'Path: /rest/layers/hplus:data_gravi_ploemeur.xml, QueryString: quietOnNotFound=true'; against '/rest/**'
15 Feb 15:24:17 DEBUG [security.IncludeQueryStringAntPathRequestMatcher] - Matched Path: /rest/layers/hplus:data_gravi_ploemeur.xml, QueryString: quietOnNotFound=true with /rest/**
15 Feb 15:24:17 DEBUG [geoserver.security] - AuthenticationCache has no entry for NginxAuthHeader, annick.battais@anonymised.com
15 Feb 15:24:17 DEBUG [geoserver.security] - preAuthenticatedPrincipal = annick.battais@anonymised.com, trying to authenticate
15 Feb 15:24:17 DEBUG [geoserver.security] - AuthenticationCache adding new entry for NginxAuthHeader, annick.battais@anonymised.com
15 Feb 15:24:17 DEBUG [geoserver.security] - Cache entries #: 0
15 Feb 15:24:17 DEBUG [geoserver.security] - AuthenticationCache adding new entry for NginxAuthHeader, annick.battais@anonymised.com
15 Feb 15:24:17 DEBUG [geoserver.security] - Cache entries #: 0
15 Feb 15:24:17 DEBUG [geoserver.security] - AuthenticationCache added new entry for NginxAuthHeader, annick.battais@anonymised.com
15 Feb 15:24:17 DEBUG [geoserver.security] - Cache entries #: 1
15 Feb 15:24:17 DEBUG [geoserver.security] - AuthenticationCache added new entry for NginxAuthHeader, annick.battais@anonymised.com
15 Feb 15:24:17 DEBUG [geoserver.security] - Cache entries #: 1
15 Feb 15:24:17 DEBUG [security.RESTfulPathBasedFilterInvocationDefinitionMap] - Converted URL to lowercase, from: '/rest/layers/hplus:data_gravi_ploemeur.xml'; to: '/rest/layers/hplus:data_gravi_ploemeur.xml' and httpMethod= GET
15 Feb 15:24:17 DEBUG [security.RESTfulPathBasedFilterInvocationDefinitionMap] - ~~~~~~~~~~ antPath= /** methodList= [GET]
15 Feb 15:24:17 DEBUG [security.RESTfulPathBasedFilterInvocationDefinitionMap] - Candidate is: '/rest/layers/hplus:data_gravi_ploemeur.xml'; antPath is /**; matchedPath=true; matchedMethods=true
15 Feb 15:24:17 DEBUG [security.RESTfulPathBasedFilterInvocationDefinitionMap] - returning ADMIN
15 Feb 15:24:17 DEBUG [filter.GeoServerSecurityContextPersistenceFilter$1] - SecurityContextHolder now cleared, as request processing completed
15 Feb 15:26:28 DEBUG [geoserver.security] - AuthenticationCache Eviction task running
15 Feb 15:26:28 DEBUG [geoserver.security] - Cache entries #: 1
15 Feb 15:26:28 DEBUG [geoserver.security] - AuthenticationCache Eviction task completed
15 Feb 15:26:28 DEBUG [geoserver.security] - Cache entries #: 1
J'ai trouvé un thread avec la meme erreur : http://osgeo-org.1560.x6.nabble.com/API-HttpMediaTypeNotAcceptableException-td5386516.html mais ca ne correspond pas vraiment.
Avez-vous déjà eu ce type de pb ?ou avez-vous une idée ?
Merci pour votre aide.
Annick
--
Annick Battais