From 7ee67b74c8ef9961822be362548415d882ef6a1a Mon Sep 17 00:00:00 2001 From: niallgiggins Date: Sat, 21 Mar 2020 01:49:41 +0000 Subject: [PATCH 1/5] fixing healthcheck which was breaking due to jsonify error The jsonify call was erroring with the message "'Request' object has no attribute 'is_xhr'" - potentially due to recent deprecation. This causes the / page to return a 500 error, which was causing the ALB in the tutorial to fail. have replaced with output that will not fail the check, and produces the same message. --- .../app/monolith-service/service/mythicalMysfitsService.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/workshop-1/app/monolith-service/service/mythicalMysfitsService.py b/workshop-1/app/monolith-service/service/mythicalMysfitsService.py index d362bf6..757c4ec 100644 --- a/workshop-1/app/monolith-service/service/mythicalMysfitsService.py +++ b/workshop-1/app/monolith-service/service/mythicalMysfitsService.py @@ -13,7 +13,10 @@ # sent to the service root will receive a healthy response. @app.route("/") def healthCheckResponse(): - return jsonify({"message" : "Nothing here, used for health check. Try /mysfits instead."}) + flaskResponse = Response(response='{"message" : "Nothing here, used for health check. Try /mysfits instead."}', status=200) + flaskResponse.headers["Content-Type"] = "application/json" + + return flaskResponse # Retrive mysfits from DynamoDB based on provided querystring params, or all # mysfits if no querystring is present. From eb4d22f0a2e2f6c781065bab5aae06ef3e0d19f3 Mon Sep 17 00:00:00 2001 From: niallgiggins Date: Sat, 21 Mar 2020 03:48:15 +0000 Subject: [PATCH 2/5] fixing healthcheck in mysfits_like.py --- workshop-1/app/like-service/service/mysfits_like.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/workshop-1/app/like-service/service/mysfits_like.py b/workshop-1/app/like-service/service/mysfits_like.py index d40fda4..fa374cc 100644 --- a/workshop-1/app/like-service/service/mysfits_like.py +++ b/workshop-1/app/like-service/service/mysfits_like.py @@ -14,7 +14,11 @@ # sent to the service root will receive a healthy response. @app.route("/") def health_check_response(): - return jsonify({"message" : "Nothing here, used for health check."}) + flaskResponse = Response(response='{"message" : "Nothing here, used for health check. Try /mysfits instead."}', status=200) + flaskResponse.headers["Content-Type"] = "application/json" + + return flaskResponse + # indicate that the provided mysfit should be marked as liked. def process_like_request(): From 2622a7fb4a6ac1bd7f7cf705192f7a29f0d1701a Mon Sep 17 00:00:00 2001 From: niallgiggins Date: Sat, 21 Mar 2020 15:14:58 +0000 Subject: [PATCH 3/5] fixing healthcheck on workshop 2 --- .../app/monolith-service/service/mythicalMysfitsService.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/workshop-2/app/monolith-service/service/mythicalMysfitsService.py b/workshop-2/app/monolith-service/service/mythicalMysfitsService.py index ae19fa2..a4bb21a 100644 --- a/workshop-2/app/monolith-service/service/mythicalMysfitsService.py +++ b/workshop-2/app/monolith-service/service/mythicalMysfitsService.py @@ -10,7 +10,10 @@ # sent to the service root will receive a healthy response. @app.route("/") def healthCheckResponse(): - return jsonify({"message" : "Nothing here, used for health check. Try /mysfits instead."}) + flaskResponse = Response(response='{"message" : "Nothing here, used for health check. Try /mysfits instead."}', status=200) + flaskResponse.headers["Content-Type"] = "application/json" + + return flaskResponse # Retrive mysfits from DynamoDB based on provided querystring params, or all # mysfits if no querystring is present. From 94a1706a91194c2fd5798db3da0d6773e1a03f47 Mon Sep 17 00:00:00 2001 From: niallgiggins Date: Sat, 21 Mar 2020 15:15:43 +0000 Subject: [PATCH 4/5] fixing like service healthcheck for workshop 2 --- workshop-2/app/like-service/service/mysfits_like.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/workshop-2/app/like-service/service/mysfits_like.py b/workshop-2/app/like-service/service/mysfits_like.py index a18bfb9..994913b 100644 --- a/workshop-2/app/like-service/service/mysfits_like.py +++ b/workshop-2/app/like-service/service/mysfits_like.py @@ -11,7 +11,10 @@ # sent to the service root will receive a healthy response. @app.route("/") def health_check_response(): - return jsonify({"message" : "Nothing here, used for health check."}) + flaskResponse = Response(response='{"message" : "Nothing here, used for health check. Try /mysfits instead."}', status=200) + flaskResponse.headers["Content-Type"] = "application/json" + + return flaskResponse # indicate that the provided mysfit should be marked as liked. def process_like_request(): From 1db33426ea817b4d2bfcea802fc5916b73fc6ca4 Mon Sep 17 00:00:00 2001 From: niallgiggins Date: Sat, 21 Mar 2020 15:16:47 +0000 Subject: [PATCH 5/5] fixing healthcheck for monolith service in workshop 3 --- .../app/monolith-service/service/mythicalMysfitsService.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/workshop-3/app/monolith-service/service/mythicalMysfitsService.py b/workshop-3/app/monolith-service/service/mythicalMysfitsService.py index 34fedbf..d28fdbb 100755 --- a/workshop-3/app/monolith-service/service/mythicalMysfitsService.py +++ b/workshop-3/app/monolith-service/service/mythicalMysfitsService.py @@ -10,7 +10,10 @@ # sent to the service root will receive a healthy response. @app.route("/") def healthCheckResponse(): - return jsonify({"message" : "Nothing here, used for health check. Try /mysfits instead."}) + flaskResponse = Response(response='{"message" : "Nothing here, used for health check. Try /mysfits instead."}', status=200) + flaskResponse.headers["Content-Type"] = "application/json" + + return flaskResponse # Retrive mysfits from DynamoDB based on provided querystring params, or all # mysfits if no querystring is present.