Giter Club home page Giter Club logo

Comments (8)

jeff1evesque avatar jeff1evesque commented on May 25, 2024

The above 500 error is achieved when the correct port rules are configured to be open. Otherwise, variations of different http errors are returned. However, the former http error indicates either there was a problem with the nginx-api reverse proxy, or the corresponding gunicorn-api webserver.

from machine-learning.

jeff1evesque avatar jeff1evesque commented on May 25, 2024

Part of our earlier confusion was due to the fact that the reverse proxy for the backend api, was configured on port 9595. However, we were making a request the frontend api at port 8585

from machine-learning.

jeff1evesque avatar jeff1evesque commented on May 25, 2024

With the adjusted port 9595, as well as using token = login.json(), we receive a timeout:

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

from machine-learning.

jeff1evesque avatar jeff1evesque commented on May 25, 2024

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

from machine-learning.

jeff1evesque avatar jeff1evesque commented on May 25, 2024

We sent a POST request from the nginx-api, to the webserver-api container:

>>> 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]>

from machine-learning.

jeff1evesque avatar jeff1evesque commented on May 25, 2024

Posting from the nginx-api, to the webserver-api container, without headers:

>>> requests.post('http://webserver-api:6001/login', data={'user[login]': 'jeff1evesque', 'user[password]': 'password123'})
<Response [500]>

from machine-learning.

jeff1evesque avatar jeff1evesque commented on May 25, 2024

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

from machine-learning.

jeff1evesque avatar jeff1evesque commented on May 25, 2024

We'll need to fix, and ensure that some logging mechanism is capable of capturing errors associated with our earlier 500 errors. However, before proceeding, we'll likely need to fix #3287. This requirement will be dictated by the minimum requirement of matching the puppet-agent with xenial, rather than trusty. Then, additional updates associated with python3 + pip3 will be non-required benefits. However, if python3 is implemented, we'll likely need to refactor python code. For example, iteritems will need to be refactored to items.

from machine-learning.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.