During the booking faces, I have the following exception.
s: None
gooutsafe_1 | 172.25.0.1 - - [22/Nov/2020 00:03:35] "POST /restaurant/book HTTP/1.1" 200 -
gooutsafe_1 | [2020-11-22 00:03:41,964] DEBUG in restaurant_services: URL microservices: http://ngnix/restaurants
gooutsafe_1 | [2020-11-22 00:03:41,966] DEBUG in http_utils: Url is: http://ngnix/restaurants
restaurants_api_1 | INFO:werkzeug:172.25.0.2 - - [22/Nov/2020 00:03:41] "GET /restaurants HTTP/1.0" 200 -
ngnix_1 | 172.25.0.12 - - [22/Nov/2020:00:03:41 +0000] "GET /restaurants HTTP/1.1" 200 702 "-" "python-requests/2.25.0" "-"
gooutsafe_1 | [2020-11-22 00:03:41,984] DEBUG in http_utils: Header Request: {'User-Agent': 'python-requests/2.25.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'}
gooutsafe_1 | [2020-11-22 00:03:41,985] DEBUG in http_utils: Response is: {'restaurants': [{'avg_time': 30, 'covid_measures': 'Distance between tables 2mt; Menù touch; Alcohol Gel; Only Electronic Payment', 'id': 1, 'lat': 43.720586, 'lon': 10.408347, 'name': 'Trial Restaurant', 'owner_email': '[email protected]', 'phone': 555123456, 'rating': 2.6666666666666665}, {'avg_time': 30, 'covid_measures': 'Distance between tables 2mt; Menù touch; Alcohol Gel; Only Electronic Payment', 'id': 2, 'lat': 33.720586, 'lon': 11.408347, 'name': 'Pepperwood', 'owner_email': '[email protected]', 'phone': 555123427, 'rating': 0.0}]}
gooutsafe_1 | 172.25.0.1 - - [22/Nov/2020 00:03:41] "GET / HTTP/1.1" 200 -
celery_1 | [2020-11-22 00:03:54,347: INFO/Beat] Scheduler: Sending due task Rating (background.calculate_rating_for_all_celery)
celery_1 | [2020-11-22 00:03:54,350: DEBUG/Beat] background.calculate_rating_for_all_celery sent. id->29349a8d-f271-4175-b9dc-570428bf9114
celery_1 | [2020-11-22 00:03:54,351: DEBUG/Beat] beat: Waking up in 29.99 seconds.
celery_1 | [2020-11-22 00:03:54,352: INFO/MainProcess] Received task: background.calculate_rating_for_all_celery[29349a8d-f271-4175-b9dc-570428bf9114]
celery_1 | [2020-11-22 00:03:54,352: DEBUG/MainProcess] TaskPool: Apply <function _trace_task_ret at 0x7f8fb7a3c9d8> (args:('background.calculate_rating_for_all_celery', '29349a8d-f271-4175-b9dc-570428bf9114', {'lang': 'py', 'task': 'background.calculate_rating_for_all_celery', 'id': '29349a8d-f271-4175-b9dc-570428bf9114', 'shadow': None, 'eta': None, 'expires': None, 'group': None, 'group_index': None, 'retries': 0, 'timelimit': [None, None], 'root_id': '29349a8d-f271-4175-b9dc-570428bf9114', 'parent_id': None, 'argsrepr': '()', 'kwargsrepr': '{}', 'origin': 'gen12@510c7047a456', 'reply_to': 'be109ec3-119c-3ef4-8ec1-5fb77e612f54', 'correlation_id': '29349a8d-f271-4175-b9dc-570428bf9114', 'hostname': 'celery@510c7047a456', 'delivery_info': {'exchange': '', 'routing_key': 'celery', 'priority': 0, 'redelivered': None}, 'args': [], 'kwargs': {}}, b'[[], {}, {"callbacks": null, "errbacks": null, "chain": null, "chord": null}]', 'application/json', 'utf-8') kwargs:{})
celery_1 | [2020-11-22 00:03:54,354: DEBUG/MainProcess] Task accepted: background.calculate_rating_for_all_celery[29349a8d-f271-4175-b9dc-570428bf9114] pid:8
celery_1 | [2020-11-22 00:03:54,359: DEBUG/ForkPoolWorker-2] Rating calculate for restaurant with name Trial Restaurant is 2.6666666666666665
celery_1 | [2020-11-22 00:03:54,370: INFO/ForkPoolWorker-2] Task background.calculate_rating_for_all_celery[29349a8d-f271-4175-b9dc-570428bf9114] succeeded in 0.016193370000110008s: None
gooutsafe_1 | [2020-11-22 00:04:02,781] DEBUG in http_utils: Url is: http://ngnix/book
gooutsafe_1 | [2020-11-22 00:04:02,781] DEBUG in http_utils: Body request is: {'restaurant_id': 2, 'user_id': 1, 'datetime': '2020-11-28T21:00:00Z', 'people_number': 2, 'raw_friends': '[email protected]'}
booking_api_1 | DEBUG:connexion.apis.flask_api:Getting data and status code
booking_api_1 | DEBUG:connexion.decorators.validation:http://booking_api:5004/book validating schema...
booking_api_1 | DEBUG:connexion.decorators.parameter:Function Arguments: ['private']
booking_api_1 | DEBUG:app:Request received: {'restaurant_id': 2, 'user_id': 1, 'datetime': '2020-11-28T21:00:00Z', 'people_number': 2, 'raw_friends': '[email protected]'}
booking_api_1 | DEBUG:app:Translated obj to vars
booking_api_1 | DEBUG:app:Friends: ['[email protected]']
booking_api_1 | DEBUG:app:Url is: http://ngnix/user/1
booking_api_1 | DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): ngnix:80
ngnix_1 | 2020/11/22 00:04:02 [error] 27#27: *19 connect() failed (111: Connection refused) while connecting to upstream, client: 172.25.0.5, server: , request: "GET /user/1 HTTP/1.1", upstream: "http://172.25.0.2:5002/user/1", host: "ngnix"
ngnix_1 | 2020/11/22 00:04:02 [warn] 27#27: *19 upstream server temporarily disabled while connecting to upstream, client: 172.25.0.5, server: , request: "GET /user/1 HTTP/1.1", upstream: "http://172.25.0.2:5002/user/1", host: "ngnix"
user_api_1 | DEBUG:connexion.apis.flask_api:Getting data and status code
user_api_1 | DEBUG:connexion.decorators.validation:http://user_api:5002/user/1 validating parameters...
user_api_1 | DEBUG:connexion.decorators.parameter:Function Arguments: ['id']
user_api_1 | DEBUG:connexion.apis.abstract:Getting data and status code
user_api_1 | DEBUG:connexion.apis.abstract:Prepared body and status code (404)
user_api_1 | DEBUG:connexion.apis.abstract:Got framework response
user_api_1 | INFO:werkzeug:172.25.0.2 - - [22/Nov/2020 00:04:02] "GET /user/1 HTTP/1.0" 404 -
ngnix_1 | 172.25.0.5 - - [22/Nov/2020:00:04:02 +0000] "GET /user/1 HTTP/1.1" 404 33 "-" "python-requests/2.25.0" "-"
booking_api_1 | DEBUG:urllib3.connectionpool:http://ngnix:80 "GET /user/1 HTTP/1.1" 404 33
booking_api_1 | DEBUG:app:Header Request: {'User-Agent': 'python-requests/2.25.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'}
booking_api_1 | ERROR:app:Error from microservice
booking_api_1 | ERROR:app:Error received NOT FOUND
booking_api_1 | INFO:werkzeug:172.25.0.2 - - [22/Nov/2020 00:04:02] "POST /book HTTP/1.0" 500 -
ngnix_1 | 172.25.0.12 - - [22/Nov/2020:00:04:02 +0000] "POST /book HTTP/1.1" 500 27321 "-" "python-requests/2.25.0" "-"
gooutsafe_1 | [2020-11-22 00:04:02,856] DEBUG in http_utils: Header Request: {'User-Agent': 'python-requests/2.25.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Length': '125', 'Content-Type': 'application/json'}
gooutsafe_1 | [2020-11-22 00:04:02,856] ERROR in http_utils: Error from microservice
gooutsafe_1 | [2020-11-22 00:04:02,856] ERROR in http_utils: Error received INTERNAL SERVER ERROR
gooutsafe_1 | 172.25.0.1 - - [22/Nov/2020 00:04:02] "POST /restaurant/book HTTP/1.1" 500 -
gooutsafe_1 | Traceback (most recent call last):
gooutsafe_1 | File "/usr/local/lib/python3.7/json/decoder.py", line 353, in raw_decode
gooutsafe_1 | obj, end = self.scan_once(s, idx)
gooutsafe_1 | StopIteration: 0
gooutsafe_1 |
gooutsafe_1 | During handling of the above exception, another exception occurred:
gooutsafe_1 |
gooutsafe_1 | Traceback (most recent call last):
gooutsafe_1 | File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2464, in __call__
gooutsafe_1 | return self.wsgi_app(environ, start_response)
gooutsafe_1 | File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2450, in wsgi_app
gooutsafe_1 | response = self.handle_exception(e)
gooutsafe_1 | File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1867, in handle_exception
gooutsafe_1 | reraise(exc_type, exc_value, tb)
gooutsafe_1 | File "/usr/local/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
gooutsafe_1 | raise value
gooutsafe_1 | File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
gooutsafe_1 | response = self.full_dispatch_request()
gooutsafe_1 | File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
gooutsafe_1 | rv = self.handle_user_exception(e)
gooutsafe_1 | File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
gooutsafe_1 | reraise(exc_type, exc_value, tb)
gooutsafe_1 | File "/usr/local/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
gooutsafe_1 | raise value
gooutsafe_1 | File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
gooutsafe_1 | rv = self.dispatch_request()
gooutsafe_1 | File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
gooutsafe_1 | return self.view_functions[rule.endpoint](**req.view_args)
gooutsafe_1 | File "/usr/local/lib/python3.7/site-packages/flask_login/utils.py", line 272, in decorated_view
gooutsafe_1 | return func(*args, **kwargs)
gooutsafe_1 | File "/code/monolith/auth.py", line 24, in f
gooutsafe_1 | return func(*args, **kwargs)
gooutsafe_1 | File "/code/monolith/views/book.py", line 68, in index
gooutsafe_1 | request.form.get("friends"),
gooutsafe_1 | File "/code/monolith/services/booking_services.py", line 27, in book
gooutsafe_1 | response, code = HttpUtils.make_post_request(BOOKING_MICROSERVICE_URL, json)
gooutsafe_1 | File "/code/monolith/utils/http_utils.py", line 65, in make_post_request
gooutsafe_1 | current_app.logger.error("Error content {}".format(response.json()))
gooutsafe_1 | File "/usr/local/lib/python3.7/site-packages/requests/models.py", line 900, in json
gooutsafe_1 | return complexjson.loads(self.text, **kwargs)
gooutsafe_1 | File "/usr/local/lib/python3.7/json/__init__.py", line 348, in loads
gooutsafe_1 | return _default_decoder.decode(s)
gooutsafe_1 | File "/usr/local/lib/python3.7/json/decoder.py", line 337, in decode
gooutsafe_1 | obj, end = self.raw_decode(s, idx=_w(s, 0).end())
gooutsafe_1 | File "/usr/local/lib/python3.7/json/decoder.py", line 355, in raw_decode
gooutsafe_1 | raise JSONDecodeError("Expecting value", s, err.value) from None
gooutsafe_1 | json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
gooutsafe_1 | 172.25.0.1 - - [22/Nov/2020 00:04:02] "GET /restaurant/book?__debugger__=yes&cmd=resource&f=style.css HTTP/1.1" 200 -
gooutsafe_1 | 172.25.0.1 - - [22/Nov/2020 00:04:02] "GET /restaurant/book?__debugger__=yes&cmd=resource&f=jquery.js HTTP/1.1" 200 -
gooutsafe_1 | 172.25.0.1 - - [22/Nov/2020 00:04:02] "GET /restaurant/book?__debugger__=yes&cmd=resource&f=debugger.js HTTP/1.1" 200 -
gooutsafe_1 | 172.25.0.1 - - [22/Nov/2020 00:04:03] "GET /restaurant/book?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 200 -
gooutsafe_1 | 172.25.0.1 - - [22/Nov/2020 00:04:03] "GET /restaurant/book?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 200 -
celery_1 | [2020-11-22 00:04:24,366: INFO/Beat] Scheduler: Sending due task Rating (background.calculate_rating_for_all_celery)
celery_1 | [2020-11-22 00:04:24,368: DEBUG/Beat] background.calculate_rating_for_all_celery sent. id->fb2fa92f-e676-484f-9e39-6cc5405cef4c
celery_1 | [2020-11-22 00:04:24,368: DEBUG/Beat] beat: Waking up in 29.99 seconds.
celery_1 | [2020-11-22 00:04:24,369: INFO/MainProcess] Received task: background.calculate_rating_for_all_celery[fb2fa92f-e676-484f-9e39-6cc5405cef4c]
celery_1 | [2020-11-22 00:04:24,370: DEBUG/MainProcess] TaskPool: Apply <function _trace_task_ret at 0x7f8fb7a3c9d8> (args:('background.calculate_rating_for_all_celery', 'fb2fa9