st2api and st2auth always binds to 127.0.0.1
See original GitHub issueI’ve set the host
param in st2.conf for auth and api to 0.0.0.0
, but the config is ignored and the gunicorn process binds to 127.0.0.1:
[root@base-stackstorm2-138-onint ~]# ps -ef | grep gunicorn
st2 20711 1 9 22:50 ? 00:00:00 /opt/stackstorm/st2/bin/python /opt/stackstorm/st2/bin/gunicorn_pecan /opt/stackstorm/st2/lib/python2.7/site-packages/st2api/gunicorn_config.py -k eventlet -b 127.0.0.1:9101 --workers 1 --threads 1 --graceful-timeout 10 --timeout 30
st2 20723 1 9 22:50 ? 00:00:00 /opt/stackstorm/st2/bin/python /opt/stackstorm/st2/bin/gunicorn_pecan /opt/stackstorm/st2/lib/python2.7/site-packages/st2stream/gunicorn_config.py -k eventlet -b 127.0.0.1:9102 --workers 1 --threads 10 --graceful-timeout 10 --timeout 30
st2 20735 1 9 22:50 ? 00:00:00 /opt/stackstorm/st2/bin/python /opt/stackstorm/st2/bin/gunicorn_pecan /opt/stackstorm/st2/lib/python2.7/site-packages/st2auth/gunicorn_config.py -k eventlet -b 127.0.0.1:9100 --workers 1 --threads 1 --graceful-timeout 10 --timeout 30
...
I’ve tried modifying the hard-coded local addresses in both https://github.com/StackStorm/st2/blob/master/st2api/st2api/gunicorn_config.py#L29 and https://github.com/StackStorm/st2/blob/master/st2auth/st2auth/gunicorn_config.py#L29
as well as the init scripts /etc/init.d/st2api
, /etc/init.d/st2auth
, which was hard-coding the bind address in the DAEMON_ARGS variable: DAEMON_ARGS="-k eventlet -b 127.0.0.1:9101 --workers 1 --threads 1 --graceful-timeout 10 --timeout 30 --pid ${PIDFILE}"
.
However, the auth and api endpoints are still binding to 127.0.0.1 after restarting the st2 processes.
I’m using st2 v1.4, and my environment was set up by following the documentation.
My st2.conf looks like:
[exporter]
logging = /etc/st2/logging.exporter.conf
[garbagecollector]
logging = /etc/st2/logging.garbagecollector.conf
[auth]
host = 0.0.0.0
port = 9100
use_ssl = False
debug = True
enable = True
logging = /etc/st2/logging.auth.conf
mode = standalone
# Note: Settings bellow are only used in "standalone" mode
backend = flat_file
backend_kwargs = {"file_path": "/etc/st2/.htpasswd"}
# Base URL to the API endpoint excluding the version (e.g. http://myhost.net:9101/)
api_url =
[system]
base_path = /opt/stackstorm
[syslog]
host = 127.0.0.1
port = 514
facility = local7
protocol = udp
[log]
excludes = requests,paramiko
redirect_stderr = False
mask_secrets = True
[system_user]
user = stanley
ssh_key_file = /home/stanley/.ssh/stanley_rsa
[messaging]
url = amqp://guest:guest@127.0.0.1:5672/
[ssh_runner]
remote_dir = /tmp
use_paramiko_ssh_runner = True
Perhaps I am missing other hard-coded overrides?
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (5 by maintainers)
Top GitHub Comments
Not sure why it doesn’t work for the author, but updating DAEMON_ARGS via /etc/sysconfig/st2api worked very well for me:
This way I don’t have to update the original init.d script, which can be updated during upgrade. I am on CentOS 6.8
https://stackstorm.slack.com/archives/community/p1492824598789091