Informasjonsforvaltning / organization-catalog

A service providing basic information related to the organizations that are publishers of content in the National Data Directory
Apache License 2.0
0 stars 0 forks source link

Får 500 i retur ved get og accept=text/html #102

Closed stigbd closed 10 months ago

stigbd commented 3 years ago

Får status code 500 ved get av denne i nettleser: https://organization-catalogue.fellesdatakatalog.digdir.no/organizations/974760673

Request header:

GET /organizations/974760673 HTTP/2
Host: organization-catalogue.fellesdatakatalog.digdir.no
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Upgrade-Insecure-Requests: 1
Cache-Control: max

Frå loggen:

"Resolved [org.springframework.http.converter.HttpMessageNotWritableException: No converter for [class no.brreg.informasjonsforvaltning.organizationcatalogue.model.Organization] with preset Content-Type 'null']" 

Forventer 406 ved denne type sitasjon.

stigbd commented 3 years ago

Mens denne via curl oppførerer seg ordentlig:

% curl -i -H "Accept: text/html" https://organization-catalogue.fellesdatakatalog.digdir.no/organizations/974760673
HTTP/2 406 
vary: Origin
vary: Access-Control-Request-Method
vary: Access-Control-Request-Headers
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
cache-control: no-cache, no-store, max-age=0, must-revalidate
pragma: no-cache
expires: 0
strict-transport-security: max-age=31536000 ; includeSubDomains
x-frame-options: DENY
content-type: text/html;charset=UTF-8
content-language: en
content-length: 292
date: Mon, 28 Jun 2021 13:13:32 GMT
via: 1.1 google
alt-svc: clear
stigbd commented 3 years ago

Når eg hermer nettleser sin accept header i curl, får eg 500:

curl -i -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8" https://organization-catalogue.fellesdatakatalog.digdir.no/organizations/974760673
HTTP/2 500 
vary: Origin
vary: Access-Control-Request-Method
vary: Access-Control-Request-Headers
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
cache-control: no-cache, no-store, max-age=0, must-revalidate
pragma: no-cache
expires: 0
strict-transport-security: max-age=31536000 ; includeSubDomains
x-frame-options: DENY
content-type: text/html;charset=UTF-8
content-language: en
content-length: 299
date: Mon, 28 Jun 2021 13:19:08 GMT
via: 1.1 google
alt-svc: clear

<html><body><h1>Whitelabel Error Page</h1><p>This application has no explicit mapping for /error, so you are seeing this as a fallback.</p><div id='created'>Mon Jun 28 15:19:08 CEST 2021</div><div>There was an unexpected error (type=Internal Server Error, status=500).</div><div></div></body></html>% 
valosnah commented 3 years ago

Applikasjonsloggen ved 406-respons: "Resolved [org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation]"

Applikasjonsloggen ved 500-respons: "Resolved [org.springframework.http.converter.HttpMessageNotWritableException: No converter for [class no.brreg.informasjonsforvaltning.organizationcatalogue.model.Organization] with preset Content-Type 'null']"

KjerstiSteien commented 10 months ago

@valosnah kan du sjekke om vi fortsatt har denne bugen?

KjerstiSteien commented 10 months ago

Klarer ikke gjenskape, lukker saken.