AWS EC2 - GET http://localhost:3310/forest/healthcheck net::ERR_CONNECTION_REFUSED

Hi there!

I’m trying to set up a ForestAdmin environment but not succeeding very well. I currently have the database stored as an RDS instance on AWS and then I’ve setup an EC2 Instance linked to the RDS so it can access it to run the ForestAdmin App. Great, it runs. What’s not great is I can’t login to the dashboard at http://app.forestadmin.com/ - I did have a look through the forums and though it was a CORS issue but I set the orgin to all to see if it has fixed it but no luck. When I go to the forest admin app, in the console I get this error

GET http://localhost:3310/forest/healthcheck net::ERR_CONNECTION_REFUSED
and
POST http://localhost:3310/forest/sessions net::ERR_CONNECTION_REFUSED

So I went back to my server screen and tried restarting the app but still no luck. If I go to {mypublicip}:3310 the screen it displays is the lumber ’ Your application is running! ’ and I can see the requests within the application here.

Your application is listening on port 3310.
Your admin panel is available here: https://app.forestadmin.com/projects
GET /forest/sessions 404 154 - 10.065 ms
GET /forest/sessions 404 154 - 3.444 ms
GET /forest/healthcheck 200 - - 1.666 ms
GET /forest/healthcheck 200 - - 1.012 ms
GET /forest/healthcheck 200 - - 0.903 ms
GET /forest/healthcheck 200 - - 0.923 ms
GET / 304 - - 2.351 ms
GET / 304 - - 0.964 ms
HEAD /forest/sessions 404 155 - 1.163 ms
HEAD /forest 204 - - 0.826 ms
HEAD /forest/healthcheck 200 - - 0.797 ms

I’m really not too sure what to do from here. If anyone has any ideas could you let me know :+1:

Thanks,
Louie.

  • Project Name: UEG Admin

EDIT

Running
curl -I http://localhost:3310/forest/healthcheck
Returns

HTTP/1.1 200 OK
X-Powered-By: Express
Access-Control-Allow-Origin: *
Vary: Origin
Access-Control-Allow-Credentials: true
Date: Wed, 30 Dec 2020 15:44:32 GMT
Connection: keep-alive
Keep-Alive: timeout=5

Running
curl -I http://localhost:3310/forest
Returns

HTTP/1.1 204 No Content
X-Powered-By: Express
Access-Control-Allow-Origin: *
Date: Wed, 30 Dec 2020 15:46:19 GMT
Connection: keep-alive
Keep-Alive: timeout=5


1 Like

Hi @Louie_Heaton and welcome in our community :champagne:,

So if I summarise you just tried to install Forest Admin on a remote server but got that error.
You never created a Development environment before, right ?
If that’s the case this just mean that you created your environment on localhost while it should be the url of your EC2 instance.

To fix that you have 3 solutions:

  • Hide the login popup (By editing the html)
  • Access your project settings
  • Go to environments tab
  • Select your environment
  • Update the url of your environment
  • Refresh

Second solution:

  • Create a new project
  • When you see the generated command, there is a --application-host and --application-port replace them by the correct value

Third solution:

  • Create a new project
  • Install on LOCAL, not on a remote
  • Test the app
  • Go to project settings
  • Go to environments tab
  • Create a new remote/production environment
  • Follow the steps

I strongly suggest the last solution :wink: which is way more simple in my opinion

Hope that helps you :slightly_smiling_face:

1 Like

Thanks @vince!

I actually ended up assigning the EC2 instance to an Elastic IP and then to a Load Balancer then linked the Load Balancer to a domain endpoint and used ACM to activate an SSL certificate for it to be able to use it securely. I then closed the login form through HTML and then adjusting the environment URL within the backend and it worked!

2 Likes