cancel
Showing results for 
Search instead for 
Did you mean: 
android
Mission Specialist
Mission Specialist
  • 968 Views

Ansible Private Hub 502 Bad Gateway

Jump to solution

Anybody get 502 Bad Gateway after installing Automation Private Hub? This is my inventory as of this morning testing it.

[automationcontroller]

[execution_nodes]

[automationhub]
ansible01.oc.ops.local

[automationedacontroller]

[database]

[sso]

[all:vars]

registry_url='ansible01.oc.ops.local'
registry_username='ansible'
registry_password='password'
ee_from_hub_only = True

# Automation Hub Configuration
#

automationhub_admin_password='password'

automationhub_pg_host=''
automationhub_pg_port=''

automationhub_pg_database='automationhub'
automationhub_pg_username='automationhub'
automationhub_pg_password='password'
automationhub_pg_sslmode='prefer'

automationhub_require_content_approval = False

 

 

 

 

 

Labels (1)
1 Solution

Accepted Solutions
android
Mission Specialist
Mission Specialist
  • 963 Views

I think I fixed it! I went and made sure:

yum remove httpd
yum remove nginx
yum remove postgresql
yum remove redis
yum remove pulpcore-selinux

cd to /var/lib/

rm -rf pgsql, nginx, redis, containers, private pulp, redis


rerun ./setup.sh

wait

when its done check nginx

if you see the error below I removed the duplicate default deferred server.

restarted nginx.

nginx healthy.

 


######################
Troubleshooting nginx
/etc/nginx/conf.d/automation-hub.nginx.conf

If there are duplicate default
Mar 30 08:18:05 ansible01 nginx[51642]: nginx: [emerg] a duplicate default server for 0.0.0.0:443 in /etc/nginx/conf.d/automation-hub.nginx.conf:11
Mar 30 08:18:05 ansible01 systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE

There can only be one default server for each port not for the same port number example below in the automation-hub nginx.conf file

server {
# Gunicorn docs suggest the use of the "deferred" directive on Linux.
listen 443 default_server deferred ssl;
# listen [::]:443 default_server deferred ssl;


server {
listen 80 default_server;
# listen [::]:80 default_server;

Systemctl restart nginx should show:

HEALTHY Nginx after change.

● nginx.service - The nginx HTTP and reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/nginx.service.d
└─override.conf
Active: active (running) since Sat 2024-03-30 08:33:13 CDT; 7s ago
Process: 51924 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
Process: 51926 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)
Process: 51927 ExecStart=/usr/sbin/nginx (code=exited, status=0/SUCCESS)
Main PID: 51928 (nginx)
Tasks: 2 (limit: 100248)
Memory: 3.1M
CPU: 30ms
CGroup: /system.slice/nginx.service
├─51928 "nginx: master process /usr/sbin/nginx"
└─51929 "nginx: worker process"

Mar 30 08:33:13 ansible01 systemd[1]: Starting The nginx HTTP and reverse proxy server...
Mar 30 08:33:13 ansible01 nginx[51926]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
Mar 30 08:33:13 ansible01 nginx[51926]: nginx: configuration file /etc/nginx/nginx.conf test is successful
Mar 30 08:33:13 ansible01 systemd[1]: Started The nginx HTTP and reverse proxy server.
######################
Troubleshooting nginx
/etc/nginx/conf.d/automation-hub.nginx.conf

If there are duplicate default
Mar 30 08:18:05 ansible01 nginx[51642]: nginx: [emerg] a duplicate default server for 0.0.0.0:443 in /etc/nginx/conf.d/automation-hub.nginx.conf:11
Mar 30 08:18:05 ansible01 systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE

There can only be one default server for each port not for the same port number example below in the automation-hub nginx.conf file

server {
# Gunicorn docs suggest the use of the "deferred" directive on Linux.
listen 443 default_server deferred ssl;
# listen [::]:443 default_server deferred ssl;


server {
listen 80 default_server;
# listen [::]:80 default_server;

Systemctl restart nginx should show:

HEALTHY Nginx after change.

● nginx.service - The nginx HTTP and reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/nginx.service.d
└─override.conf
Active: active (running) since Sat 2024-03-30 08:33:13 CDT; 7s ago
Process: 51924 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
Process: 51926 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)
Process: 51927 ExecStart=/usr/sbin/nginx (code=exited, status=0/SUCCESS)
Main PID: 51928 (nginx)
Tasks: 2 (limit: 100248)
Memory: 3.1M
CPU: 30ms
CGroup: /system.slice/nginx.service
├─51928 "nginx: master process /usr/sbin/nginx"
└─51929 "nginx: worker process"

Mar 30 08:33:13 ansible01 systemd[1]: Starting The nginx HTTP and reverse proxy server...
Mar 30 08:33:13 ansible01 nginx[51926]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
Mar 30 08:33:13 ansible01 nginx[51926]: nginx: configuration file /etc/nginx/nginx.conf test is successful
Mar 30 08:33:13 ansible01 systemd[1]: Started The nginx HTTP and reverse proxy server.

View solution in original post

2 Replies
android
Mission Specialist
Mission Specialist
  • 964 Views

I think I fixed it! I went and made sure:

yum remove httpd
yum remove nginx
yum remove postgresql
yum remove redis
yum remove pulpcore-selinux

cd to /var/lib/

rm -rf pgsql, nginx, redis, containers, private pulp, redis


rerun ./setup.sh

wait

when its done check nginx

if you see the error below I removed the duplicate default deferred server.

restarted nginx.

nginx healthy.

 


######################
Troubleshooting nginx
/etc/nginx/conf.d/automation-hub.nginx.conf

If there are duplicate default
Mar 30 08:18:05 ansible01 nginx[51642]: nginx: [emerg] a duplicate default server for 0.0.0.0:443 in /etc/nginx/conf.d/automation-hub.nginx.conf:11
Mar 30 08:18:05 ansible01 systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE

There can only be one default server for each port not for the same port number example below in the automation-hub nginx.conf file

server {
# Gunicorn docs suggest the use of the "deferred" directive on Linux.
listen 443 default_server deferred ssl;
# listen [::]:443 default_server deferred ssl;


server {
listen 80 default_server;
# listen [::]:80 default_server;

Systemctl restart nginx should show:

HEALTHY Nginx after change.

● nginx.service - The nginx HTTP and reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/nginx.service.d
└─override.conf
Active: active (running) since Sat 2024-03-30 08:33:13 CDT; 7s ago
Process: 51924 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
Process: 51926 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)
Process: 51927 ExecStart=/usr/sbin/nginx (code=exited, status=0/SUCCESS)
Main PID: 51928 (nginx)
Tasks: 2 (limit: 100248)
Memory: 3.1M
CPU: 30ms
CGroup: /system.slice/nginx.service
├─51928 "nginx: master process /usr/sbin/nginx"
└─51929 "nginx: worker process"

Mar 30 08:33:13 ansible01 systemd[1]: Starting The nginx HTTP and reverse proxy server...
Mar 30 08:33:13 ansible01 nginx[51926]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
Mar 30 08:33:13 ansible01 nginx[51926]: nginx: configuration file /etc/nginx/nginx.conf test is successful
Mar 30 08:33:13 ansible01 systemd[1]: Started The nginx HTTP and reverse proxy server.
######################
Troubleshooting nginx
/etc/nginx/conf.d/automation-hub.nginx.conf

If there are duplicate default
Mar 30 08:18:05 ansible01 nginx[51642]: nginx: [emerg] a duplicate default server for 0.0.0.0:443 in /etc/nginx/conf.d/automation-hub.nginx.conf:11
Mar 30 08:18:05 ansible01 systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE

There can only be one default server for each port not for the same port number example below in the automation-hub nginx.conf file

server {
# Gunicorn docs suggest the use of the "deferred" directive on Linux.
listen 443 default_server deferred ssl;
# listen [::]:443 default_server deferred ssl;


server {
listen 80 default_server;
# listen [::]:80 default_server;

Systemctl restart nginx should show:

HEALTHY Nginx after change.

● nginx.service - The nginx HTTP and reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/nginx.service.d
└─override.conf
Active: active (running) since Sat 2024-03-30 08:33:13 CDT; 7s ago
Process: 51924 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
Process: 51926 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)
Process: 51927 ExecStart=/usr/sbin/nginx (code=exited, status=0/SUCCESS)
Main PID: 51928 (nginx)
Tasks: 2 (limit: 100248)
Memory: 3.1M
CPU: 30ms
CGroup: /system.slice/nginx.service
├─51928 "nginx: master process /usr/sbin/nginx"
└─51929 "nginx: worker process"

Mar 30 08:33:13 ansible01 systemd[1]: Starting The nginx HTTP and reverse proxy server...
Mar 30 08:33:13 ansible01 nginx[51926]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
Mar 30 08:33:13 ansible01 nginx[51926]: nginx: configuration file /etc/nginx/nginx.conf test is successful
Mar 30 08:33:13 ansible01 systemd[1]: Started The nginx HTTP and reverse proxy server.

JoshuaN
Cadet
Cadet
  • 100 Views

Just wanted to say thank you for this solution! Saved my team a bunch of time and headaches during our Ansible Tower to AAP data migration.

0 Kudos
Join the discussion
You must log in to join this conversation.