From 3542ee816474a20d35bd271288acd9d86130a635 Mon Sep 17 00:00:00 2001 From: Nino Date: Tue, 20 Aug 2024 11:31:39 +0200 Subject: [PATCH 1/5] Add better logging when a task completion fails --- app/apps/workflow/signals.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/apps/workflow/signals.py b/app/apps/workflow/signals.py index bcf94a1e5..bae32f010 100644 --- a/app/apps/workflow/signals.py +++ b/app/apps/workflow/signals.py @@ -1,5 +1,6 @@ import copy import datetime +import logging import pytz from apps.events.models import TaskModelEventEmitter @@ -16,6 +17,8 @@ from .user_tasks import DEFAULT_USER_TASK_DUE_DATE, get_task_by_name from .utils import get_latest_version_from_config +logger = logging.getLogger(__name__) + @receiver(pre_save, dispatch_uid="event_emitter_pre_save") def event_emitter_pre_save(instance, **kwargs): @@ -36,6 +39,9 @@ def event_emitter_pre_save(instance, **kwargs): case_user_task_id=instance.case_user_task_id ) if type_instance: + logger.error( + f"TaskModelEventEmitter of type '{instance.__class__.__name__}', with id '{instance.case_user_task_id}', already exists" + ) raise EventEmitterExistsError( f"TaskModelEventEmitter of type '{instance.__class__.__name__}', with id '{instance.case_user_task_id}', already exists" ) From 0df371d21c7aec72e403426ff42e1a1829a4e18d Mon Sep 17 00:00:00 2001 From: Nino Date: Tue, 20 Aug 2024 11:52:58 +0200 Subject: [PATCH 2/5] failure logs --- .github/workflows/main.workflow.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/main.workflow.yml b/.github/workflows/main.workflow.yml index 9b33db443..b0de0820f 100644 --- a/.github/workflows/main.workflow.yml +++ b/.github/workflows/main.workflow.yml @@ -26,3 +26,14 @@ jobs: run: docker compose -f docker-compose.local.yml up -d - name: Run Tests run: docker compose -f docker-compose.local.yml exec -T zaak-gateway python manage.py test + - if: ${{ failure() }} + name: "ON FAILURE: Which containers were running while failing?" + run: docker ps -a + + - if: ${{ failure() }} + name: "ON FAILURE: Backend logs" + run: docker logs backend_zaak-gateway_1 + + - if: ${{ failure() }} + name: "ON FAILURE: Database logs" + run: docker logs backend_database_1 From c80befd523622ba4e381a906cc9025534c649a90 Mon Sep 17 00:00:00 2001 From: Nino Date: Tue, 20 Aug 2024 11:53:07 +0200 Subject: [PATCH 3/5] failure logs --- .github/workflows/main.workflow.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.workflow.yml b/.github/workflows/main.workflow.yml index b0de0820f..6b9d9d1cc 100644 --- a/.github/workflows/main.workflow.yml +++ b/.github/workflows/main.workflow.yml @@ -26,6 +26,7 @@ jobs: run: docker compose -f docker-compose.local.yml up -d - name: Run Tests run: docker compose -f docker-compose.local.yml exec -T zaak-gateway python manage.py test + - if: ${{ failure() }} name: "ON FAILURE: Which containers were running while failing?" run: docker ps -a From 2ef42ac32ac523585155467d713a4db0715bba62 Mon Sep 17 00:00:00 2001 From: Nino Date: Tue, 20 Aug 2024 11:57:08 +0200 Subject: [PATCH 4/5] failure logs --- .github/workflows/main.workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.workflow.yml b/.github/workflows/main.workflow.yml index 6b9d9d1cc..3fac2d721 100644 --- a/.github/workflows/main.workflow.yml +++ b/.github/workflows/main.workflow.yml @@ -33,8 +33,8 @@ jobs: - if: ${{ failure() }} name: "ON FAILURE: Backend logs" - run: docker logs backend_zaak-gateway_1 + run: docker logs zaken-backend-zaak-gateway-1 - if: ${{ failure() }} name: "ON FAILURE: Database logs" - run: docker logs backend_database_1 + run: docker logs zaken-backend-database-1 From 63d50282837e167561a708d72c4664848d2df3f1 Mon Sep 17 00:00:00 2001 From: Nino Date: Tue, 20 Aug 2024 12:11:49 +0200 Subject: [PATCH 5/5] add sleep --- .github/workflows/main.workflow.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.workflow.yml b/.github/workflows/main.workflow.yml index 3fac2d721..b5b1fe974 100644 --- a/.github/workflows/main.workflow.yml +++ b/.github/workflows/main.workflow.yml @@ -24,6 +24,7 @@ jobs: run: docker network create top_and_zaak_backend_bridge - name: Start images run: docker compose -f docker-compose.local.yml up -d + - run: sleep 30 - name: Run Tests run: docker compose -f docker-compose.local.yml exec -T zaak-gateway python manage.py test