1

Before: Service-A ===> Service-B (works properly over https)

Now: Service-A ===> Service-B (over http)

I've made sure service A is configured to use http for requests but I get the following error:

[2019-09-02 02:15:11,579] ERROR in app: Exception on /api/users [POST]
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "./app/view/__init__.py", line 243, in decorated_function
    return make_request()
  File "./app/view/__init__.py", line 222, in make_request
    response = f(parsed_params)
....
REDACTED
....
  File "./app/user.py", line 620, in create_user
    headers=cls._USER_AGENT_HEADER
  File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 112, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/requests/adapters.py", line 490, in send
    raise ConnectionError(err, request=request)
ConnectionError: ('Connection aborted.', BadStatusLine("''",))

If I set the protocol back to https I get Unknown SSLProtocol error, so Service-B is definitely on http.

User-Agent header is set properly. I've tried modifying it to an empty header and a web browser header but it didn't seem to affect anything.

The error seems to occur intermittently and the frequency of the error varies.

Requests version: 2.18.4

3
  • 1
    Can you POST request on /api/users using something like Postman or Insomnia ? What do you get over http then ? Commented Sep 2, 2019 at 7:15
  • Sorry for the late response. I've setup Postman and issued GET requests against instances. Looks like some instances are responsive and some are not. Probably due to the removal of load balancer but I'm not sure yet. Commented Sep 5, 2019 at 0:59
  • Postman error Could not get any response Commented Sep 5, 2019 at 0:59

1 Answer 1

1

It was a service discovery issue. Two containers/services were registered with the same name while using registrator. Need to change the docker-compose file

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.