[GeoNetwork-devel] Strange GN behavior when passing url in metadata

Hi!

I run a Geodata catalog that I want to have as open as possible.
All data should be searchable and downloadable w/o login (Guest). So I put all records in All and Guest.
This has been no problem in GN3 but GN4 changed something.
Here are two urls passed from GN4(0.4-SNAPSHOT) from the same metadata record. The first one does not work, the second one does. The action is "Add layer to map’.

GET http://maps3.sgu.se/geoserver/ows?request=GetCapabilities&SERVICE=WMS

The first one does not work. Error 500 is returned. As you see, a proxy statement is injected, and the link is url encoded (unnecessary)

What may be the reason for this? I have no proxy, and proxy is off in the settings.
If it is by design I would like to be able to switch it off.

Regards, Mats.E

···

GisKraft, Geodatakonsult

Mats Elfström, Marsvinsholms stationsväg 80, 271 93 Ystad, Sweden
tel: +46 70 595 39 35 / www.giskraft.se

Hi Mats, I also noticed the sendError exception on Tomcat last week which needs to be fixed.

On Jetty, the error is more explicit
See https://github.com/geonetwork/core-geonetwork/pull/4712
So you have 2 options:

  • In the admin, trigger the link analysis which will populates the link table that the proxy is using to allow or not access.
  • turn off proxy check

HTH
Francois

Le ven. 30 avr. 2021 à 14:47, Mats Elfström <mats.elfstrom@anonymised.com> a écrit :

Hi!

I run a Geodata catalog that I want to have as open as possible.
All data should be searchable and downloadable w/o login (Guest). So I put all records in All and Guest.
This has been no problem in GN3 but GN4 changed something.
Here are two urls passed from GN4(0.4-SNAPSHOT) from the same metadata record. The first one does not work, the second one does. The action is "Add layer to map’.

GET http://maps3.sgu.se/geoserver/ows?request=GetCapabilities&SERVICE=WMS

The first one does not work. Error 500 is returned. As you see, a proxy statement is injected, and the link is url encoded (unnecessary)

What may be the reason for this? I have no proxy, and proxy is off in the settings.
If it is by design I would like to be able to switch it off.

Regards, Mats.E

GisKraft, Geodatakonsult

Mats Elfström, Marsvinsholms stationsväg 80, 271 93 Ystad, Sweden
tel: +46 70 595 39 35 / www.giskraft.se


GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

Hi Francois!
Thank you for that hint and the github thread.
I would like to say that the error message and error code should be revised. An error 500 (Internal Server Error) was not helpful. Not until I began tapping the internet connection I found the proxy problem.
I have explored the options you gave.
1/ Analyse links: This had the desired effect, but has to be triggered manually after each harvest. it is also a time consuming process. My current database contains some 10000 links.

2/ Change the parameter in web.xml to
securityMode
NONE</param-val

DO NOT DO THIS!

It froze the entire instance which went into some arrest and ejected hundreds of catalina springwork errors. I had to restart Tomcat with some difficulty and consider myself lucky to be able to get it running again.

CONCLUSION: As I am scheduling all harvesters for a weekly run, I will have to remember to manually start a link analysis after each harvest batch.

Regards, Mats.E

···

GisKraft, Geodatakonsult

Mats Elfström, Marsvinsholms stationsväg 80, 271 93 Ystad, Sweden
tel: +46 70 595 39 35 / www.giskraft.se

Hi

Le mar. 4 mai 2021 à 15:17, Mats Elfström <mats.elfstrom@anonymised.com.1330…> a écrit :

Hi Francois!
Thank you for that hint and the github thread.
I would like to say that the error message and error code should be revised. An error 500 (Internal Server Error) was not helpful.

Errors are quite explicit on Jetty (see screenshot in the PR) but on Tomcat there is an issue when sending the errors back to the client …

Not until I began tapping the internet connection I found the proxy problem.
I have explored the options you gave.
1/ Analyse links: This had the desired effect, but has to be triggered manually after each harvest. it is also a time consuming process. My current database contains some 10000 links.

2/ Change the parameter in web.xml to
securityMode
NONE</param-val

DO NOT DO THIS!

It froze the entire instance which went into some arrest and ejected hundreds of catalina springwork errors. I had to restart Tomcat with some difficulty and consider myself lucky to be able to get it running again.

What type of errors ?

CONCLUSION: As I am scheduling all harvesters for a weekly run, I will have to remember to manually start a link analysis after each harvest batch.

This can probably be improved to have a background task taking care of this.

Francois

Regards, Mats.E

Den fre 30 apr. 2021 kl 15:24 skrev Francois Prunayre <fx.prunayre@anonymised.com>:

Hi Mats, I also noticed the sendError exception on Tomcat last week which needs to be fixed.

On Jetty, the error is more explicit
See https://github.com/geonetwork/core-geonetwork/pull/4712
So you have 2 options:

  • In the admin, trigger the link analysis which will populates the link table that the proxy is using to allow or not access.
  • turn off proxy check

HTH
Francois

Le ven. 30 avr. 2021 à 14:47, Mats Elfström <mats.elfstrom@anonymised.com> a écrit :

Hi!

I run a Geodata catalog that I want to have as open as possible.
All data should be searchable and downloadable w/o login (Guest). So I put all records in All and Guest.
This has been no problem in GN3 but GN4 changed something.
Here are two urls passed from GN4(0.4-SNAPSHOT) from the same metadata record. The first one does not work, the second one does. The action is "Add layer to map’.

GET http://maps3.sgu.se/geoserver/ows?request=GetCapabilities&SERVICE=WMS

The first one does not work. Error 500 is returned. As you see, a proxy statement is injected, and the link is url encoded (unnecessary)

What may be the reason for this? I have no proxy, and proxy is off in the settings.
If it is by design I would like to be able to switch it off.

Regards, Mats.E

GisKraft, Geodatakonsult

Mats Elfström, Marsvinsholms stationsväg 80, 271 93 Ystad, Sweden
tel: +46 70 595 39 35 / www.giskraft.se


GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

GisKraft, Geodatakonsult

Mats Elfström, Marsvinsholms stationsväg 80, 271 93 Ystad, Sweden
tel: +46 70 595 39 35 / www.giskraft.se

Hi Francois!
What type of errors ?

Basically, what seems to have happened is that the shift from DB_LINK_CHECK to NONE triggered an unexpected database migration attempt.
As I have almost 10000 metadata records, this brought the machine to a standstill. And soon it ran out of memory. I have 8GB RAM on that machine.
Here are the first few log lines after the web.xml edit.
/Regards, Mats.E

2021-05-04 14:30:33,383 INFO [geonetwork.databasemigration] - - Migration …
2021-05-04 14:30:33,523 INFO [geonetwork.databasemigration] - Webapp version:4.0.4-SNAPSHOT subversion:SNAPSHOT
2021-05-04 14:30:33,523 INFO [geonetwork.databasemigration] - Database version:4.0.4 subversion:SNAPSHOT
2021-05-04 14:30:33,523 INFO [geonetwork.databasemigration] - Application version equals the Database version, no migration task to apply.
2021-05-04 14:30:51,431 ERROR [jeeves] - JeevesContextLoaderListener: Error creating bean with name ‘org.fao.geonet.camelPeriodicProducer.MessageProducerFactory#0’: Invocation of init method failed; nested exception is org.quartz.SchedulerException: Unable to register scheduler with MBeanServer. [See nested exception: javax.management.InstanceAlreadyExistsException: quartz:type=QuartzScheduler,name=DefaultQuartzScheduler-harvest-wfs,instance=NON_CLUSTERED]
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.fao.geonet.camelPeriodicProducer.MessageProducerFactory#0’: Invocation of init method failed; nested exception is org.quartz.SchedulerException: Unable to register scheduler with MBeanServer. [See nested exception: javax.management.InstanceAlreadyExistsException: quartz:type=QuartzScheduler,name=DefaultQuartzScheduler-harvest-wfs,instance=NON_CLUSTERED]

···

GisKraft, Geodatakonsult

Mats Elfström, Marsvinsholms stationsväg 80, 271 93 Ystad, Sweden
tel: +46 70 595 39 35 / www.giskraft.se

Hi Mats, this error “Unable to register scheduler with MBeanServer” does not sound related to the proxy config. I also observed it yesterday on a setup with 6 GeoNetwork in the same Jetty. Some of them are failing to start on
https://github.com/geonetwork/core-geonetwork/blob/main/workers/camelPeriodicProducer/src/main/java/org/fao/geonet/camelPeriodicProducer/MessageProducerFactory.java#L47
Trying to figure out why.

Francois

Le mar. 4 mai 2021 à 16:57, Mats Elfström <mats.elfstrom@anonymised.com> a écrit :

Hi Francois!
What type of errors ?

Basically, what seems to have happened is that the shift from DB_LINK_CHECK to NONE triggered an unexpected database migration attempt.
As I have almost 10000 metadata records, this brought the machine to a standstill. And soon it ran out of memory. I have 8GB RAM on that machine.
Here are the first few log lines after the web.xml edit.
/Regards, Mats.E

2021-05-04 14:30:33,383 INFO [geonetwork.databasemigration] - - Migration …
2021-05-04 14:30:33,523 INFO [geonetwork.databasemigration] - Webapp version:4.0.4-SNAPSHOT subversion:SNAPSHOT
2021-05-04 14:30:33,523 INFO [geonetwork.databasemigration] - Database version:4.0.4 subversion:SNAPSHOT
2021-05-04 14:30:33,523 INFO [geonetwork.databasemigration] - Application version equals the Database version, no migration task to apply.
2021-05-04 14:30:51,431 ERROR [jeeves] - JeevesContextLoaderListener: Error creating bean with name ‘org.fao.geonet.camelPeriodicProducer.MessageProducerFactory#0’: Invocation of init method failed; nested exception is org.quartz.SchedulerException: Unable to register scheduler with MBeanServer. [See nested exception: javax.management.InstanceAlreadyExistsException: quartz:type=QuartzScheduler,name=DefaultQuartzScheduler-harvest-wfs,instance=NON_CLUSTERED]
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.fao.geonet.camelPeriodicProducer.MessageProducerFactory#0’: Invocation of init method failed; nested exception is org.quartz.SchedulerException: Unable to register scheduler with MBeanServer. [See nested exception: javax.management.InstanceAlreadyExistsException: quartz:type=QuartzScheduler,name=DefaultQuartzScheduler-harvest-wfs,instance=NON_CLUSTERED]

Den tis 4 maj 2021 kl 16:17 skrev Francois Prunayre <fx.prunayre@anonymised.com>:

Hi

Le mar. 4 mai 2021 à 15:17, Mats Elfström <mats.elfstrom@anonymised.com> a écrit :

Hi Francois!
Thank you for that hint and the github thread.
I would like to say that the error message and error code should be revised. An error 500 (Internal Server Error) was not helpful.

Errors are quite explicit on Jetty (see screenshot in the PR) but on Tomcat there is an issue when sending the errors back to the client …

Not until I began tapping the internet connection I found the proxy problem.
I have explored the options you gave.
1/ Analyse links: This had the desired effect, but has to be triggered manually after each harvest. it is also a time consuming process. My current database contains some 10000 links.

2/ Change the parameter in web.xml to
securityMode
NONE</param-val

DO NOT DO THIS!

It froze the entire instance which went into some arrest and ejected hundreds of catalina springwork errors. I had to restart Tomcat with some difficulty and consider myself lucky to be able to get it running again.

What type of errors ?

CONCLUSION: As I am scheduling all harvesters for a weekly run, I will have to remember to manually start a link analysis after each harvest batch.

This can probably be improved to have a background task taking care of this.

Francois

Regards, Mats.E

Den fre 30 apr. 2021 kl 15:24 skrev Francois Prunayre <fx.prunayre@anonymised.com>:

Hi Mats, I also noticed the sendError exception on Tomcat last week which needs to be fixed.

On Jetty, the error is more explicit
See https://github.com/geonetwork/core-geonetwork/pull/4712
So you have 2 options:

  • In the admin, trigger the link analysis which will populates the link table that the proxy is using to allow or not access.
  • turn off proxy check

HTH
Francois

Le ven. 30 avr. 2021 à 14:47, Mats Elfström <mats.elfstrom@anonymised.com> a écrit :

Hi!

I run a Geodata catalog that I want to have as open as possible.
All data should be searchable and downloadable w/o login (Guest). So I put all records in All and Guest.
This has been no problem in GN3 but GN4 changed something.
Here are two urls passed from GN4(0.4-SNAPSHOT) from the same metadata record. The first one does not work, the second one does. The action is "Add layer to map’.

GET http://maps3.sgu.se/geoserver/ows?request=GetCapabilities&SERVICE=WMS

The first one does not work. Error 500 is returned. As you see, a proxy statement is injected, and the link is url encoded (unnecessary)

What may be the reason for this? I have no proxy, and proxy is off in the settings.
If it is by design I would like to be able to switch it off.

Regards, Mats.E

GisKraft, Geodatakonsult

Mats Elfström, Marsvinsholms stationsväg 80, 271 93 Ystad, Sweden
tel: +46 70 595 39 35 / www.giskraft.se


GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

GisKraft, Geodatakonsult

Mats Elfström, Marsvinsholms stationsväg 80, 271 93 Ystad, Sweden
tel: +46 70 595 39 35 / www.giskraft.se

GisKraft, Geodatakonsult

Mats Elfström, Marsvinsholms stationsväg 80, 271 93 Ystad, Sweden
tel: +46 70 595 39 35 / www.giskraft.se