Hello!
I’m back again! (I’m sure you’ve missed me!
)
@kporangehat, I have a constraint to make the webapp and the ShotgunEventDeamon work in a separated server and not on my localhost.
So I dug a bit in the issue of not connecting, and something interesting emerged of this.
The socket function does not work. I’ve tried it even on the port I am 100% sure it works: the Jira port 8080.
I’ve installed in an AWS EC2 instance the webapp (the whole sg_jira_bridge with the venv) and correctly set up the security groups to allow port 9090.
It is successfully connecting to both shotgun site and Jira server.
But the daemon which is still located in my local server, is outputing this traceback repeatedly :
ConnectionError: HTTPConnectionPool(host='AWS_IP_ADDRESS', port=9090): Max retries exceeded with url: /sg2jira/default/Task/5803 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f37c535f610>: Failed to establish a new connection: [Errno 111] Connection refused',))
so what I’ve done is to try to look at the opened port in the EC2 instance, and I’ve found that:
sudo lsof -i -P -n | grep LISTEN
rpcbind 2670 rpc 8u IPv4 16437 0t0 TCP *:111 (LISTEN)
rpcbind 2670 rpc 11u IPv6 16440 0t0 TCP *:111 (LISTEN)
master 3121 root 13u IPv4 18620 0t0 TCP 127.0.0.1:25 (LISTEN)
sshd 3286 root 3u IPv4 19900 0t0 TCP *:22 (LISTEN)
sshd 3286 root 4u IPv6 19902 0t0 TCP *:22 (LISTEN)
httpd 3390 root 4u IPv6 21580 0t0 TCP *:80 (LISTEN)
httpd 3391 apache 4u IPv6 21580 0t0 TCP *:80 (LISTEN)
httpd 3392 apache 4u IPv6 21580 0t0 TCP *:80 (LISTEN)
httpd 3393 apache 4u IPv6 21580 0t0 TCP *:80 (LISTEN)
httpd 3394 apache 4u IPv6 21580 0t0 TCP *:80 (LISTEN)
httpd 3395 apache 4u IPv6 21580 0t0 TCP *:80 (LISTEN)
python 3458 ec2-user 3u IPv4 21920 0t0 TCP 127.0.0.1:9090 (LISTEN)
node 12329 ec2-user 18u IPv4 29552 0t0 TCP 127.0.0.1:40447 (LISTEN)
httpd 12560 apache 4u IPv6 21580 0t0 TCP *:80 (LISTEN)
httpd 12566 apache 4u IPv6 21580 0t0 TCP *:80 (LISTEN)
httpd 12567 apache 4u IPv6 21580 0t0 TCP *:80 (LISTEN)
I’ve noticed that the webapp is outputing 127.0.0.1:9090 and almost all the other ones *:80.
So I’ve made a little test on my EC2 instance.
I’ve just created a very simple flask app with 4 tests:
The first one was successful (it outputted correctly the hello world! text in the browser):
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello, World!'
if __name__ == "__main__":
app.run(host="0.0.0.0", port=5000)
The second test returned an unsuccessful code with a ERR_CONNECTION_REFUSED:
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello, World!'
if __name__ == "__main__":
app.run(host="127.0.0.1", port=5000)
]Third one was successful:
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello, World!'
if __name__ == "__main__":
app.run(host="0.0.0.0", port=9090)
And last one was unsuccessful with a ERR_CONNECTION_REFUSED:
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello, World!'
if __name__ == "__main__":
app.run(host="127.0.0.1", port=9090)
Obviously, the only thing I’ve changed is the host value from 127.0.0.1 to 0.0.0.0.
I’ve tried very briefly to dig into the webapp.py and settings.py to find the host and changing it to 0.0.0.0 but I haven’t found it.
Is there any way to change the webapp host? At least we could try this thing to see if it is connecting?
Thanks a lot for your support! 
Geoff
!