HTTP Status 500 – Internal Server Error navigating to authenticated signin page

Good day,

I successfully deployed to render on free tier and can navigate to my unauthenticated pages.

On my local machine, when you want to perform an action that requires authentication the app redirects you to the path /signin so you can sign in. This logic and configuration work well on the local even at the moment of typing this, but while the application is deployed on render and I am redirected to the same /signin the application breaks. See error message below…

# HTTP Status 500 – Internal Server Error

The logs do not contain any useful information to debug the issue but seems to be auth issue.

Kindly help me with an insight into the problem or let me know if the problem is peculiar to free tier so I can upgrade immediately to continue testing.

Thank you!

Hi,

I replied to the ticket you also opened.

A 500 error will be coming from your code. Maybe you could share some of the logs? Filtering by level:error should highlight any issues.

Alan

Request URL:

bubonline.onrender.com/signin

Request Method:

GET

Status Code:

500 Internal Server Error

Remote Address:

216.24.57.252:443

Referrer Policy:

strict-origin-when-cross-origin

Request Headers

Alt-Svc:
h3=“:443”; ma=86400
Cache-Control:
no-cache, no-store, max-age=0, must-revalidate
Cf-Cache-Status:
DYNAMIC

Cf-Ray:
87132f78bf7247f7-CPT
Content-Language:
en
Content-Type:
text/html;charset=UTF-8
Date:
Mon, 08 Apr 2024 15:10:40 GMT
Expires:
0
Pragma:
no-cache
Rndr-Id:
25395ad6-b6ae-4a09
Server:
cloudflare
Strict-Transport-Security:
max-age=31536000 ; includeSubDomains
Vary:
Accept-Encoding
X-Content-Type-Options:
nosniff
X-Frame-Options:
DENY
X-Render-Origin-Server:
Render
X-Xss-Protection:
1; mode=block

Response Headers

:authority:
bubonline.onrender.com
:method:
GET
:path:
/signin
:scheme:
https
Accept:
text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.7
Accept-Encoding:
gzip, deflate, br, zstd
Accept-Language:
en-US,en;q=0.9
Cache-Control:
max-age=0
Cookie:
JSESSIONID=BA90C72313DFED3CDCF58385AC239F5C
Sec-Ch-Ua:
“Microsoft Edge”;v=“123”, “Not:A-Brand”;v=“8”, “Chromium”;v=“123”
Sec-Ch-Ua-Mobile:
?0
Sec-Ch-Ua-Platform:
“Windows”
Sec-Fetch-Dest:
document
Sec-Fetch-Mode:
navigate
Sec-Fetch-Site:
none
Sec-Fetch-User:
?1
Upgrade-Insecure-Requests:
1
User-Agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 Edg/123.0.0.0

Thank you!

A 500 error, is an Internal Server Error, as your screenshot shows.

You’ve shared client-side/browser console logs.

Look at the service (server) logs in your Render dashboard.

Alan

1 Like

Here are the service logs in image

Trying filtering those logs just by errors over the last few hours, e.g. level:error and the time dropdown.

Alan

Ok. I did. That was the issue log. Could it be the IP address binding?

500 errors aren’t usually related to IP/Port binding. If you’re getting far enough to make a request to your service for it to return a 500, then the IP/port settings are probably fine.

The one error (highlighted red) in your screenshot mentions an error resolving a template:

Error resolving template [error], template might not exist or might not be accessible by any of the configured Template Resolvers

Alan

1 Like

Yeah, I am wondering because it is working on my local

This particular problem is now conquered. I modified the below.

@GetMapping(“/signin”)
public String login() {
System.out.println(“I am inside the signin controller xyz”);
return “/login”;
}

I removed the / in return “/login”; to become

@GetMapping(“/signin”)
public String login() {
System.out.println(“I am inside the signin controller xyz”);
return “login”;
}

So, with the / it worked on my local but it did not when hosted until the fix above.