Created on 09-01-2019 10:53 PM - last edited on 09-02-2019 02:55 AM by ask_bill_brooks
Hi, I kept getting 502 Bad Gateway nginx/1.15.7 error when I tried to open Ambari with myIP:8080. I'm using a Mac OS system. Is there any way i can fix it?
Thanks!
Created 09-01-2019 11:23 PM
Can you please share the output of the following curl command from the host where you are running the browser? Just want to see if there are any Network proxy added in front of Ambari which is causing the 502 error?
# curl -iLv -u "admin:admin" -H "X-Requested-By: ambari" -X GET http://$AMBARI_HOSTNAME:8080/api/v1/check
Please replace the admin:admin with your ambari admin username and password and also the $AMBARI_HOSTNAME with the actual FQDN of ambari server. Please share the output of the above curl command .
Also please check your browser setting if it has any Network proxy setting added to it?
Created 09-02-2019 12:13 AM
Hi, thank you for replying back to my question.
I am new to all of these. Could you make it more clear where should I run this command?
I'm using Mac system, should i type and run them in the terminal? or somewhere in the browser?
Sorry for this dumb questions.
Created 09-02-2019 01:36 AM
Yes, please try to run the same Curl command from the MAC laptop where you are opening Browser.
Also please check your browser settings to see if it has any network proxy setting added or not?
Created 09-02-2019 08:11 PM
Hi,
I checked the settings for my Chrome. there is nothing checked under Proxy setting.
I tried your command in Terminal, but it didn't provide any feedback.
Created 09-02-2019 10:00 PM
One thing is for sure here is that Ambari is not giving 502 bad gateway error here.
Ambari server runs on Jetty Server (Not on nginx) So definitely the error which you are getting in your browser is not coming from ambari server. It mist be coming from some nginx server as we see
502 Bad Gateway nginx/1.15.7
.
Whatever output was generated from the curl command can you share that same. Even if it is blank output can you please share the screenshot of the error or the browser debugger console output ?
# curl -iLv -u admin:admin -H "X-Requested-By: ambari" -X GET http://$AMBARI_HOSTNAME:8080/api/v1/check
.
Created 06-15-2020 01:27 AM
I'm getting the same issue. As you said, I think it might be coming from Nginx server. This is what I get in the response of cUrl request:
Andreas-MBP:etc aarrotta$ curl -iLv -u "admin:admin" -H "X-Requested-By: ambari" -X GET http://sandbox-hdp.hortonworks.com:8080/api/v1/check
Note: Unnecessary use of -X or --request, GET is already inferred.
* Trying ::1...
* TCP_NODELAY set
* Connected to sandbox-hdp.hortonworks.com (::1) port 8080 (#0)
* Server auth using Basic with user 'admin'
> GET /api/v1/check HTTP/1.1
> Host: sandbox-hdp.hortonworks.com:8080
> Authorization: Basic YWRtaW46YWRtaW4=
> User-Agent: curl/7.64.1
> Accept: */*
> X-Requested-By: ambari
>
< HTTP/1.1 502 Bad Gateway
HTTP/1.1 502 Bad Gateway
< Server: nginx/1.15.0
Server: nginx/1.15.0
< Date: Mon, 15 Jun 2020 08:23:06 GMT
Date: Mon, 15 Jun 2020 08:23:06 GMT
< Content-Type: text/html
Content-Type: text/html
< Content-Length: 173
Content-Length: 173
< Connection: keep-alive
Connection: keep-alive
<
<html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.15.0</center>
</body>
</html>
* Connection #0 to host sandbox-hdp.hortonworks.com left intact
* Closing connection 0
Created 09-22-2023 09:08 AM
hey bro, I got the exact same response from entering the suggested command by @jsensharma, still cannot open Ambari. did you figure it out?
Note: Unnecessary use of -X or --request, GET is already inferred.
* Trying 172.XX.184.YYY...
* TCP_NODELAY set
* Connected to 172.XX.184.YYY (172.XX.184.YYY) port 8080 (#0)
* Server auth using Basic with user 'maria_dev'
> GET /api/v1/check HTTP/1.1
> Host: 172.XX.184.YYY:8080
> Authorization: Basic bWFyaWFfZGV2Om1hcmlhX2Rldg==
> User-Agent: curl/7.64.1
> Accept: */*
> X-Requested-By: ambari
>
< HTTP/1.1 502 Bad Gateway
HTTP/1.1 502 Bad Gateway
< Server: nginx/1.15.0
Server: nginx/1.15.0
< Date: Wed, 20 Sep 2023 16:00:20 GMT
Date: Wed, 20 Sep 2023 16:00:20 GMT
< Content-Type: text/html
Content-Type: text/html
< Content-Length: 173
Content-Length: 173
< Connection: keep-alive
Connection: keep-alive
<
<html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.15.0</center>
</body>
</html>
* Connection #0 to host 172.XX.184.YYY left intact
* Closing connection 0
Created 09-22-2023 09:12 AM
@drew-chill As this is an older post, you would have a better chance of receiving a resolution by starting a new thread. This will also be an opportunity to provide details specific to your environment that could aid others in assisting you with a more accurate answer to your question. You can link this thread as a reference in your new post. Thanks.
Regards,
Diana Torres,Created 01-10-2022 11:47 PM
in that pop up window copy the url and paste it in normal chrome browser and then follow the below steps to get rid from 500 error in ambari.
1)
1.1) click on i symbol -> then click on site settings
it will redirect you to that particular tab settings
2)
2.1) click on reset permissions and then click on clear data
Now Go back to that ambari login opening site :
click on reload you will find login page here and error issue will be resolved.
rest permissions and clear data in chrome browser settings