Nexus 3.18.1 on Kubernetes and nginx ingress - Error 500

595 views
Skip to first unread message

Salvador González González

unread,
Aug 23, 2019, 8:05:01 AM8/23/19
to Nexus Users

Hello,


   I have an strange problem, after migrating to version 3.18.1 when I sing in to nexus manager there is an 500 internal error. As far I can see I get the error if I go to "support --> Status". I use a nginx-ingress controller to access Nexus 3. This was working the right way on version 3.16.1.


   There must be a problem in the ingress controller because using a port-forward to the nexus container works Ok.


   In the ingress controller I can see an error when the app tries to get https://mysite/service/metrics/healthcheck?_dc=1566128866965 as the ingress controller gets an 500 error page.


   Doing some testing I tried inside the container some curl commands (kubectl exec -it xxxxxxx -- bash):


If I execute this curl command on my Pod "curl http://localhost:8081/service/metrics/healthcheck?_dc=1566128866965" I have this web page:

 

 

<!DOCTYPE html>
<html lang="en">
<head>
<title>500 - Nexus Repository Manager</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<!--[if lt IE 9]>
<script>(new Image).src="http://localhost:8081/favicon.ico?3.18.1-01"</script>
<![endif]-->
<link rel="icon" type="image/png" href="http://localhost:8081/favicon-32x32.png?3.18.1-01" sizes="32x32">
<link rel="mask-icon" href="http://localhost:8081/safari-pinned-tab.svg?3.18.1-01" color="#5bbad5">
<link rel="icon" type="image/png" href="http://localhost:8081/favicon-16x16.png?3.18.1-01" sizes="16x16">
<link rel="shortcut icon" href="http://localhost:8081/favicon.ico?3.18.1-01">
<meta name="msapplication-TileImage" content="http://localhost:8081/mstile-144x144.png?3.18.1-01">
<meta name="msapplication-TileColor" content="#00a300">
<link rel="stylesheet" type="text/css" href="http://localhost:8081/static/css/nexus-content.css?3.18.1-01"/>
</head>
<body>
<div class="nexus-header">
<a href="http://localhost:8081">
<div class="product-logo">
<img src="http://localhost:8081/static/images/nexus.png?3.18.1-01" alt="Product logo"/>
</div>
<div class="product-id">
<div class="product-id__line-1">
<span class="product-name">Nexus Repository Manager</span>
</div>
<div class="product-id__line-2">
<span class="product-spec">OSS 3.18.1-01</span>
</div>
</div>
</a>
</div>
<div class="nexus-body">
<div class="content-header">
<img src="http://localhost:8081/static/rapture/resources/icons/x32/exclamation.png?3.18.1-01" alt="Exclamation point" aria-role="presentation"/>
<span class="title">Error 500</span>
<span class="description">Internal Server Error</span>
</div>
<div class="content-body">
<div class="content-section">
javax.servlet.ServletException: org.apache.shiro.subject.support.DisabledSessionException: Session creation has been disabled for the current subject. This exception indicates that there is either a programming error (using a session when it should never be used) or that Shiro's configuration needs to be adjusted to allow Sessions to be created for the current Subject. See the org.apache.shiro.subject.support.DisabledSessionException JavaDoc for more.
</div>
</div>
</div>
</body>
</html>
 

 



If I use "curl -u admin:XXXX http://localhost:8081/service/metrics/healthcheck?_dc=1566128866965" I obtain the right result.
 

  I've tried several nginx-ingress controller header combinations without luck.


  I have attached server.log and access.og files.


  Thank you very much,

 

 

Salvador González González

unread,
Aug 23, 2019, 8:09:27 AM8/23/19
to Nexus Users
Log files
request.log
nexus.log

Rich Seddon

unread,
Aug 23, 2019, 11:08:50 AM8/23/19
to Nexus Users
That endpoint requires authentication, and the user must either be an administrator, or have the "nx-metrics-all" privilege.

You can use the "http://<hostname>:<port>/service/rest/v1/status" endpoint if you want to monitor health without authentication


Rich

Salvador González González

unread,
Aug 24, 2019, 3:44:06 AM8/24/19
to Nexus Users

Actually I'm not doing any monitor health check from Kubernetes (readinessProbe and livenessProbe just check "/" at port 8081). I sign in with my user (nx-admin role) and I can see the error (the red exclamation) on the web header (I've attached a picture). I suspect there is an async call from nexus manager, not my user as I'm authenticated, to the endpoint. 

Captura de pantalla 2019-08-24 a las 8.20.58.png


  In the metrics page I can see a 500 error each time a sign in to nexus repo manager (without doing the curl command on localhost):


Captura de pantalla 2019-08-24 a las 8.37.03.png


  After sign in, If I go to "Support --> Status" I can see an error. In the "request.log" there is an error message: 


./log/request.log:MYIPADDRESS - sgonzalez [24/Aug/2019:07:41:51 +0000] "GET /service/metrics/healthcheck?_dc=1566632510974 HTTP/1.1" 500 - 491 21 "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36" [qtp1053605575-41]


  Thank you very much

Peter Lynch

unread,
Aug 26, 2019, 11:30:06 AM8/26/19
to Salvador González González, Nexus Users
On Sat, Aug 24, 2019 at 4:44 AM Salvador González González <sgon...@opencanarias.es> wrote:

Actually I'm not doing any monitor health check from Kubernetes (readinessProbe and livenessProbe just check "/" at port 8081).

Good that you are not using /service/metrics/healthcheck as a simple "is node alive check" as that is not what it is for.

However, checking "/" is not proper either. Use "http://<hostname>:<port>/service/rest/v1/status" as we stated earlier.

 
I sign in with my user (nx-admin role) and I can see the error (the red exclamation) on the web header (I've attached a picture). I suspect there is an async call from nexus manager, not my user as I'm authenticated, to the endpoint. 

Captura de pantalla 2019-08-24 a las 8.20.58.png


  In the metrics page I can see a 500 error each time a sign in to nexus repo manager (without doing the curl command on localhost):


Captura de pantalla 2019-08-24 a las 8.37.03.png


  After sign in, If I go to "Support --> Status" I can see an error. In the "request.log" there is an error message: 


./log/request.log:MYIPADDRESS - sgonzalez [24/Aug/2019:07:41:51 +0000] "GET /service/metrics/healthcheck?_dc=1566632510974 HTTP/1.1" 500 - 491 21 "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36" [qtp1053605575-41]

Returning a 500 status if a single system health check fails is a known bug. https://issues.sonatype.org/browse/NEXUS-19840 - you'll just have to ignore that for now.

 
--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users...@glists.sonatype.com.
To view this discussion on the web visit https://groups.google.com/a/glists.sonatype.com/d/msgid/nexus-users/b61559eb-53b8-44a1-a019-0c538b41bc9e%40glists.sonatype.com.


--
Sonatype
Peter Lynch
Senior Product Support Engineer

Reply all
Reply to author
Forward
0 new messages