UKGovLD / registry-core

Linked data registry - core application and example UI
https://github.com/UKGovLD/registry-core/wiki
Apache License 2.0
23 stars 9 forks source link

loginoa / responseoa 415 – Unsupported Media Type #120

Closed marqh closed 4 years ago

marqh commented 4 years ago

@der @simonoakesepimorphics

I am getting an error from tomcat on POST to /system/security/loginoa on a new trialling installation (part of the login work flow)

HTTP Status 415 – Unsupported Media Type

Type Status Report

Message Unsupported Media Type

Description The origin server is refusing to service the request because the payload is in a format not supported by this method on the target resource.
Apache Tomcat/9.0.30

Using tomcat 9 and java 13

I have reproduced this using a vanilla 2.1 registry core with master registry config, plus some updated launch parameters to get a docker container with tomcat9 java13 and nginx1.6 see https://github.com/marqh/registry-config-base/tree/updatedDocker

for getting going details. also update app.conf to mandate remote password via OAuth (note it is not required to set up a remote provider, as the error occurs in application, prior to communication)

The problem occurs when the POST to /system/security/loginoa occurs

I wonder if there is something related to newer versions of java and tomcat that is causing this limitation.

If we can identify an easy fix, I'm happy to help.

If there's a known stable java+tomcat version that we could target whilst this is looked at, that would be all right for now. But, i would prefer to know the application can run on java13 and tomcat9 is it's easy to find out what's going wrong

many thanks mark

der commented 4 years ago

Hi Mark,

It has certainly never been tested on java13 / tomcat9, wouldn't be surprising if there are problems. Our normal environment is java8 and tomcat7 (very reluctant to step onto the new java version escalator and OpenJDK 8 will be supported for some time to come).

If you want to shift to a more modern java then strongly suggest sticking to LTS versions (i.e. java 11) though I'm betting on tomcat 9 being the issue here.

No doubt this could be tracked down and sorted out.

Is there urgency to sort this out before the new year?

Dave

marqh commented 4 years ago

Hi @der

many thanks for the response, no urgency at all here.

The only needs are:

i'll update my container build to target these known versions and we can keep this ticket open to see if/when it's worth working on

much obliged mark

marqh commented 4 years ago

p.s. i'm always a sucker for latest whenever I have migration to do

simonoakesepimorphics commented 4 years ago

@marqh Investigating this I found that the issue arises only when running in Java 13, and does not arise on Tomcat 9 as long as you are using a Java version supported by the registry (8 is recommended). The pull request #121 should fix this and a few other places where the same issue occurs.