-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
External 'requests.post' not working #3284
Comments
The above |
Part of our earlier confusion was due to the fact that the reverse proxy for the backend api, was configured on port |
With the adjusted port root@ubuntu-xenial:/vagrant# python3 test.py
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 137, in _new_conn
(self.host, self.port), self.timeout, **extra_kw)
File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 91, in create_connection
raise err
File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 81, in create_connection
sock.connect(sa)
socket.timeout: timed out |
Our problems need to be further investigated based on the following: root@ubuntu-xenial:/vagrant# nmap -sS -p8585 xx.xx.xx.xx
Starting Nmap 7.01 ( https://nmap.org ) at 2018-09-29 22:01 UTC
Nmap scan report for xx.xx.xx.xx (xx.xx.xx.xx)
Host is up (0.0020s latency).
PORT STATE SERVICE
8585/tcp open unknown
Nmap done: 1 IP address (1 host up) scanned in 0.67 seconds
root@ubuntu-xenial:/vagrant#
root@ubuntu-xenial:/vagrant#
root@ubuntu-xenial:/vagrant#
root@ubuntu-xenial:/vagrant# nmap -sS -p9595 xx.xx.xx.xx
Starting Nmap 7.01 ( https://nmap.org ) at 2018-09-29 22:01 UTC
Nmap scan report for xx.xx.xx.xx (xx.xx.xx.xx)
Host is up (0.00072s latency).
PORT STATE SERVICE
9595/tcp filtered pds
Nmap done: 1 IP address (1 host up) scanned in 0.77 seconds |
We sent a >>> import requests
>>> requests.post('http://webserver-api:6001/login', headers={'Content-Type': 'application/json'}, data={'user[login]': 'jeff1evesque', 'user[password]': 'password123'}, verify=False)
<Response [400]>
>>> requests.post('http://webserver-api:6001/login', headers={'Content-Type': 'application/json'}, data={'user[login]': 'jeff1evesque', 'user[password]': 'password123'})
<Response [400]> |
Posting from the >>> requests.post('http://webserver-api:6001/login', data={'user[login]': 'jeff1evesque', 'user[password]': 'password123'})
<Response [500]> |
Even after executing the above, no logs entries exists: root@webserver-api:/var/log/webserver# ls -l
total 0
-rw-r--r-- 1 root root 0 Jun 21 05:54 flask.log
root@webserver-api:/var/log/webserver# cd /var/machine-learning/log
root@webserver-api:/var/machine-learning/log# ls -l
total 12
-rw-r--r-- 1 root root 117 Sep 12 20:54 __init__.py
-rw-r--r-- 1 root root 5670 Sep 12 20:54 logger.py |
We'll need to fix, and ensure that some logging mechanism is capable of capturing errors associated with our earlier |
When issuing a
requests.post
from outside the corresponding docker unit tests, we get a 500 error. Specifically, the following was tested from a vagrant virtual machine:Then, we get the following error:
Note: we used the
verify = False
, since the corresponding application implements a self signed certificate. Additionally, the application redirects allhttp
requests tohttps
.The text was updated successfully, but these errors were encountered: