Problems with Unable to save records via domain but works with localhost in GeoNetwork

Hi everyone,

I’m experiencing an issue with my GeoNetwork instance in production. Everything works fine when I access GeoNetwork via localhost or the machine’s IP address (http://192.168.21.108:8080/geonetwork), but when I use my domain (https://domain.com), I cannot save or edit metadata records. The error returned is always a 500 Internal Server Error.

Setup details:

  • GeoNetwork version: [Specify version, e.g., 4.x.x or 3.x.x]
  • Server setup:
    • Running GeoNetwork in a Docker container with Jetty.
    • Reverse proxy with Apache configured as follows:

<VirtualHost *:443>
ServerName domain.com

ProxyPreserveHost On
ProxyPass /geonetwork http://127.0.0.1:8080/geonetwork
ProxyPassReverse /geonetwork http://127.0.0.1:8080/geonetwork

<Location /geonetwork>
    Require all granted
    Header set Access-Control-Allow-Origin "*"
    Header set Access-Control-Allow-Methods "GET, POST, OPTIONS, PUT, DELETE"
    Header set Access-Control-Allow-Headers "Content-Type, Authorization, X-Requested-With, X-CSRF-Token"
</Location>
```

Web.xml security mode:

<init-param>
  <param-name>securityMode</param-name>
  <param-value>DB_LINK_CHECK</param-value>
</init-param>

Steps attempted:

  1. Tested with both HTTP and HTTPS on the domain.
  2. Verified Apache proxy settings and added the necessary headers.
  3. Configured publicUrl in config.properties.
  4. Temporarily disabled CSRF by setting securityMode to NONE in web.xml (same issue persists).
  5. Checked logs on both GeoNetwork and Apache. The error returned is a 500 but with no clear details.
  6. From localhost or IP (http://192.168.21.108:8080), I can create and edit records without any issue.
  7. Ran a curl test:
  • Works fine: curl -X POST http://192.168.21.108:8080/geonetwork/srv/api/records/133/editor?commit=true
  • Fails: curl -X POST https://domain.com/geonetwork/srv/api/records/133/editor?commit=true

Error Details:

*In the browser’s developer tools:

500 Internal Server Error
URL: https://domain.com/geonetwork/srv/api/records/133/editor?commit=true
  • GeoNetwork logs: [Include any relevant error messages from logs]

Questions:

  1. Could this be a misconfiguration in GeoNetwork, Apache, or the network setup?
  2. Has anyone encountered similar issues when using a reverse proxy with GeoNetwork?
  3. Are there specific configurations or headers that need to be set for GeoNetwork to properly handle requests via a domain?

Any guidance or suggestions would be greatly appreciated. Thank you in advance for your help!

Hi

Please check that you have configured the appropriate settings in System Configuration - GeoNetwork opensource to configure the server name / port and protocol using the domain settings.

Have you checked the GeoNetwork log file to see if there are any exceptions logged that might be useful in identifying the problem?

Regards,
Jose García

Buenos días Jose,

Donde debería encontrarse el archivo de Logs? he montando un docker con el geonetwork en uno de los contenedores y haciendo un docker logs no se ve nada relevante.

Todal a web funciona bien, el login funciona bien, solo deja de funcionar al a hora de guardar u nuevo conjunto de datos, servicio, etc.

Tengo en la configuración de sistema el dominio especificado por el cual accedo a la propia web ya:

Así como la configuración de apache2 hecha con un proxy inverso:

Añadí algunas especificaciones en el config.properties tambien:

server.protocol=https

server.host=precatalogo.xxxxxxxx.es

server.port=443

proxy.forwarded.hosts=*

proxy.forwarded.ports=443

Ejemplos de errores queme salen al darle a guardar y salir al crear un servicio, que no me pasa si lo hago con localhost:8080 o con la ip del servidor que esta en mi dominio:

The log file must be in the log folder of the application server. But the path depends on the application server (Tomcat, Jetty, etc.) and OS used.

You can check in the Activity section of http://SERVER/geonetwork/srv/eng/admin.console#/dashboard/status, there is an Export ZIP button that downloads the log file.