Skip to content

Conversation

@pcrespov
Copy link
Member

@pcrespov pcrespov commented Jun 23, 2025

What do these changes do?

  • 🐛 Fixed incorrect error logging when web.HTTPCreated was raised in LRT
log_level=ERROR | log_timestamp=2025-07-05 09:25:20,343 | log_source=servicelib.long_running_tasks.http_endpoint_responses:get_task_result(45) | log_uid=None | log_oec=OEC:2f0d6d1c07ab-1751707520343| log_msg=task_id='POST%20%2Fv0%2Fprojects%3Ffrom_study%3D3946db48-5646-11f0-a416-0242ac17e851.865277dc-e461-41e0-b0b7-37f111f836ad' raised an exception.
{
  "exception_type": "<class 'aiohttp.web_exceptions.HTTPCreated'>",
  "exception_string": "Created",
  "exception_causes": "",
  "error_code": "OEC:2f0d6d1c07ab-1751707520343",
  "context": {
    "task_context": {
      "servicelib.request_keys.userid": 371,
      "simcore_service_webserver.constants.RQ_PRODUCT_KEY": "s4lacad"
    },
    "task_id": "POST%20%2Fv0%2Fprojects%3Ffrom_study%3D3946db48-5646-11f0-a416-0242ac17e851.865277dc-e461-41e0-b0b7-37f111f836ad"
  },
  "tip": null
}
Traceback (most recent call last):
  File "/home/scu/.venv/lib/python3.11/site-packages/servicelib/long_running_tasks/http_endpoint_responses.py", line 35, in get_task_result
    task_result = tasks_manager.get_task_result(
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/scu/.venv/lib/python3.11/site-packages/servicelib/long_running_tasks/task.py", line 254, in get_task_result
    return tracked_task.task.result()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/scu/.venv/lib/python3.11/site-packages/servicelib/long_running_tasks/task.py", line 395, in _progress_task
    return await handler(progress, **task_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/scu/.venv/lib/python3.11/site-packages/simcore_service_webserver/projects/_crud_api_create.py", line 484, in create_project
    raise web.HTTPCreated(
aiohttp.web_exceptions.HTTPCreated: Created
  • Refactored create_project to return web.HTTPCreated instead of raising it

  • image

  • ♻️ Cleaned up web.HTTPSuccessful handling in rest_middleware

Related issue/s

How to test

  • packages/service-library/tests/aiohttp/test_rest_middlewares.py
  • services/web/server/tests/unit/isolated/test_exception_handling_factory.py

Dev-ops

@pcrespov pcrespov self-assigned this Jun 23, 2025
@pcrespov pcrespov added this to the Engage milestone Jun 23, 2025
@pcrespov pcrespov added the a:webserver webserver's codebase. Assigning the area is particularly useful for bugs label Jun 23, 2025
@codecov
Copy link

codecov bot commented Jun 23, 2025

Codecov Report

Attention: Patch coverage is 75.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 87.62%. Comparing base (904b669) to head (22c808c).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7952      +/-   ##
==========================================
- Coverage   87.82%   87.62%   -0.21%     
==========================================
  Files        1848     1422     -426     
  Lines       71250    59060   -12190     
  Branches     1250      626     -624     
==========================================
- Hits        62575    51750   -10825     
+ Misses       8313     7100    -1213     
+ Partials      362      210     -152     
Flag Coverage Δ
integrationtests 63.23% <50.00%> (-1.04%) ⬇️
unittests 86.04% <75.00%> (-0.38%) ⬇️
Components Coverage Δ
api ∅ <ø> (∅)
pkg_aws_library ∅ <ø> (∅)
pkg_celery_library ∅ <ø> (∅)
pkg_dask_task_models_library ∅ <ø> (∅)
pkg_models_library ∅ <ø> (∅)
pkg_notifications_library ∅ <ø> (∅)
pkg_postgres_database ∅ <ø> (∅)
pkg_service_integration ∅ <ø> (∅)
pkg_service_library 71.54% <70.00%> (-0.02%) ⬇️
pkg_settings_library ∅ <ø> (∅)
pkg_simcore_sdk 85.05% <ø> (+0.05%) ⬆️
agent 96.29% <ø> (ø)
api_server 92.31% <ø> (ø)
autoscaling 96.03% <ø> (ø)
catalog 92.29% <ø> (ø)
clusters_keeper 99.13% <ø> (ø)
dask_sidecar 91.79% <ø> (ø)
datcore_adapter 97.94% <ø> (ø)
director 76.73% <ø> (ø)
director_v2 91.12% <ø> (+0.02%) ⬆️
dynamic_scheduler 96.69% <ø> (ø)
dynamic_sidecar 90.09% <ø> (ø)
efs_guardian 89.65% <ø> (ø)
invitations 93.60% <ø> (ø)
payments 92.57% <ø> (ø)
resource_usage_tracker 89.00% <ø> (-0.11%) ⬇️
storage 86.31% <ø> (ø)
webclient ∅ <ø> (∅)
webserver 87.31% <100.00%> (-0.33%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 904b669...22c808c. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pcrespov pcrespov force-pushed the mai/follow-up-error-handling branch from 12e2896 to f2eeccb Compare June 23, 2025 13:19
@pcrespov pcrespov changed the title WIP: Mai/follow up error handling 🐛♻️ webserver error handling: Fix incorrect error logging for web.HTTPCreated; cleanup success response handling Jun 23, 2025
@pcrespov pcrespov marked this pull request as ready for review June 23, 2025 13:38
@pcrespov pcrespov added the t:maintenance Some planned maintenance work label Jun 23, 2025
@pcrespov pcrespov enabled auto-merge (squash) June 23, 2025 13:39
@pcrespov
Copy link
Member Author

@mergify queue

@pcrespov pcrespov added the 🤖-automerge marks PR as ready to be merged for Mergify label Jun 23, 2025
@mergify
Copy link
Contributor

mergify bot commented Jun 23, 2025

queue

🟠 Waiting for conditions to match

  • -closed [📌 queue requirement]
  • -conflict [📌 queue requirement]
  • -draft [📌 queue requirement]
  • any of: [📌 queue -> configuration change requirements]
    • -mergify-configuration-changed
    • check-success = Configuration changed
  • any of: [🔀 queue conditions]
    • all of: [📌 queue conditions of queue default]
      • #approved-reviews-by >= 2 [🛡 GitHub branch protection]
      • #approved-reviews-by>=2
      • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
      • #changes-requested-reviews-by=0
      • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
      • #review-threads-unresolved=0
      • -conflict
      • -draft
      • base=master
      • branch-protection-review-decision = APPROVED [🛡 GitHub branch protection]
      • label!=🤖-do-not-merge
      • label=🤖-automerge
      • any of: [🛡 GitHub branch protection]
        • check-skipped = deploy to dockerhub
        • check-neutral = deploy to dockerhub
        • check-success = deploy to dockerhub
      • any of: [🛡 GitHub branch protection]
        • check-success = system-tests
        • check-neutral = system-tests
        • check-skipped = system-tests
      • any of: [🛡 GitHub branch protection]
        • check-success = unit-tests
        • check-neutral = unit-tests
        • check-skipped = unit-tests
      • any of: [🛡 GitHub branch protection]
        • check-success = check OAS' are up to date
        • check-neutral = check OAS' are up to date
        • check-skipped = check OAS' are up to date
      • any of: [🛡 GitHub branch protection]
        • check-success = integration-tests
        • check-neutral = integration-tests
        • check-skipped = integration-tests
      • any of: [🛡 GitHub branch protection]
        • check-success = build-test-images (frontend) / build-test-images
        • check-neutral = build-test-images (frontend) / build-test-images
        • check-skipped = build-test-images (frontend) / build-test-images

@sonarqubecloud
Copy link

@pcrespov pcrespov merged commit ce92bee into ITISFoundation:master Jun 23, 2025
95 of 97 checks passed
@pcrespov pcrespov deleted the mai/follow-up-error-handling branch June 25, 2025 08:12
@matusdrobuliak66 matusdrobuliak66 mentioned this pull request Aug 5, 2025
88 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤖-automerge marks PR as ready to be merged for Mergify a:webserver webserver's codebase. Assigning the area is particularly useful for bugs t:maintenance Some planned maintenance work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants