MrMEEE / awx-build

144 stars 39 forks source link

After upgrade to the latest version websocket not working #234

Closed hypemedia closed 2 years ago

hypemedia commented 4 years ago

After the upgrade to the latest version and lots of downgrades I have managed to almost have a functional AWX but I still have an issue that I cannot solve.

WebSocket connection to 'wss://xxxx:8052/websocket/' failed: WebSocket is closed before the connection is established.
[Error] WebSocket connection to 'wss://xxxx:8052/websocket/' failed: Unexpected response code: 504

Daphne is working and telnet to 127.0.0.1 8051 is working.

● awx-daphne.service - AWX daphne service
   Loaded: loaded (/usr/lib/systemd/system/awx-daphne.service; disabled; vendor preset: disabled)
   Active: active (running) since Wed 2020-04-15 02:10:43 EEST; 5h 50min ago
 Main PID: 27306 (scl)
   CGroup: /system.slice/awx-daphne.service
           ├─27306 /usr/bin/scl enable rh-python36 rh-postgresql10 daphne -b 127.0.0.1 -p 8051 awx.asgi:channel_layer
           ├─27307 /bin/bash /var/tmp/sclLx5sZr
           └─27313 /opt/rh/rh-python36/root/usr/bin/python3 /opt/rh/rh-python36/root/usr/bin/daphne -b 127.0.0.1 -p 8051 awx.asgi:channel_layer

Apr 15 02:10:43 tower.mcc-soft.com systemd[1]: Stopped AWX daphne service.
Apr 15 02:10:43 tower.mcc-soft.com systemd[1]: Unit awx-daphne.service entered failed state.
Apr 15 02:10:43 tower.mcc-soft.com systemd[1]: awx-daphne.service failed.
Apr 15 02:10:43 tower.mcc-soft.com systemd[1]: Started AWX daphne service.
Apr 15 02:10:44 tower.mcc-soft.com scl[27306]: 2020-04-14 23:10:44,981 INFO     Starting server at tcp:port=8051:interface=127.0.0.1, channel layer aw...el_layer.
Apr 15 02:10:44 tower.mcc-soft.com scl[27306]: 2020-04-14 23:10:44,981 INFO     HTTP/2 support not enabled (install the http2 and tls Twisted extras)
Apr 15 02:10:44 tower.mcc-soft.com scl[27306]: 2020-04-14 23:10:44,981 INFO     Using busy-loop synchronous mode on channel layer
Apr 15 02:10:44 tower.mcc-soft.com scl[27306]: 2020-04-14 23:10:44,982 INFO     Listening on endpoint tcp:port=8051:interface=127.0.0.1

In NGINX console I have this error:

2020/04/15 07:53:38 [error] 1239#0: *423 upstream timed out (110: Connection timed out) while reading response header from upstream, client: xxxxx, server: tower.mcc-soft.com, request: "GET /websocket/ HTTP/1.1", upstream: "http://127.0.0.1:8051/websocket/", host: "xxxxxx:8052"

This is my websocket section:

        location /websocket {
            # Pass request to the upstream alias
            proxy_pass http://127.0.0.1:8051;
            # Require http version 1.1 to allow for upgrade requests
            proxy_http_version 1.1;
            # We want proxy_buffering off for proxying to websockets.
            proxy_buffering off;
            # http://en.wikipedia.org/wiki/X-Forwarded-For
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            # enable this if you use HTTPS:
            proxy_set_header X-Forwarded-Proto https;
            # pass the Host: header from the client for the sake of redirects
            proxy_set_header Host $http_host;
            # We've set the Host header, so we don't need Nginx to muddle
            # about with redirects
            proxy_intercept_errors on;
            proxy_redirect off;
            proxy_cache_bypass $http_upgrade;
            # Depending on the request value, set the Upgrade and
            # connection headers
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection $connection_upgrade;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-NginX-Proxy true;
            proxy_ssl_session_reuse off;
        }

I am out of ideas on what I can do. Any suggestions?

hypemedia commented 4 years ago

I was able to fix the socket error by running this: sudo -u awx scl enable rh-postgresql10 rh-python36 "GIT_PYTHON_REFRESH=quiet awx-manage provision_instance --hostname=$(hostname)"

sudo -u awx scl enable rh-postgresql10 rh-python36 "GIT_PYTHON_REFRESH=quiet awx-manage register_queue --queuename=tower --hostnames=$(hostname)"

MrMEEE commented 2 years ago

Project has been updated and moved...

Please move to the new version and report any issues

PROJECT MOVED: https://github.com/miracle-as/AWX-RPM

Issues at: https://github.com/miracle-as/AWX-RPM/issues

**Install guide, tools, utilities are located at: https://awx.wiki

LinkedIn group for Questions, support, talk and more: https://www.linkedin.com/groups/13694893/