Skip to content

Conversation

@pcrespov
Copy link
Member

@pcrespov pcrespov commented Sep 24, 2024

What do these changes do?

This PR provides some helpers for better error-handling and diagnostics. This is applicable to any type of excption but in this case, we apply to a common unhandled error we found when a platform product is partially configured and the groups_extra_properties configuration is missing.

  • The exception is first categorized as MissingGroupExtraPropertiesForProductError error in the web-server
  • Using decorator _handle_users_exceptions we handle it in the users rest API handlers

There we handle as

image

An exception is handled at the rest-handler level. This exception cannot be resolved and we need to send a comprehensive message to the front-end user as well as log sufficient information in the server for troubleshooting. The handling of the exception has the following steps

  1. create an OEC
  2. compose a human-readable message appending the OEC.
  3. user create_troubleshotting_log_message to produce a rich log message
  4. log.exception including extras
  5. raise HTTP error with human-readable message to the front-end

Related issue/s

  • maintenance: error handling

How to test

Dev-ops checklist

None

@pcrespov pcrespov self-assigned this Sep 24, 2024
@pcrespov pcrespov added a:webserver webserver's codebase. Assigning the area is particularly useful for bugs a:services-library issues on packages/service-libs labels Sep 24, 2024
@codecov
Copy link

codecov bot commented Sep 24, 2024

Codecov Report

Attention: Patch coverage is 74.19355% with 8 lines in your changes missing coverage. Please review.

Project coverage is 88.0%. Comparing base (cafbf96) to head (745d806).
Report is 605 commits behind head on master.

Files with missing lines Patch % Lines
...r/src/simcore_service_webserver/users/_handlers.py 50.0% 5 Missing ⚠️
.../server/src/simcore_service_webserver/users/api.py 66.6% 2 Missing ⚠️
...es/service-library/src/servicelib/logging_utils.py 88.8% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #6432      +/-   ##
=========================================
+ Coverage    84.5%   88.0%    +3.4%     
=========================================
  Files          10    1375    +1365     
  Lines         214   59436   +59222     
  Branches       25    1553    +1528     
=========================================
+ Hits          181   52339   +52158     
- Misses         23    6846    +6823     
- Partials       10     251     +241     
Flag Coverage Δ
integrationtests 64.6% <50.0%> (?)
unittests 85.9% <74.1%> (+1.3%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...odels-library/src/models_library/errors_classes.py 100.0% <100.0%> (ø)
.../src/simcore_service_webserver/users/_constants.py 100.0% <100.0%> (ø)
.../src/simcore_service_webserver/users/exceptions.py 93.5% <100.0%> (ø)
...es/service-library/src/servicelib/logging_utils.py 77.8% <88.8%> (ø)
.../server/src/simcore_service_webserver/users/api.py 94.6% <66.6%> (ø)
...r/src/simcore_service_webserver/users/_handlers.py 92.7% <50.0%> (ø)

... and 1354 files with indirect coverage changes

@pcrespov pcrespov added this to the MartinKippenberger milestone Sep 30, 2024
@pcrespov pcrespov added the t:maintenance Some planned maintenance work label Sep 30, 2024
@pcrespov pcrespov marked this pull request as ready for review September 30, 2024 14:58
@pcrespov pcrespov changed the title WIP: Fix/config error 🐛🎨 Fixes unhandled config error and new log helpers Sep 30, 2024
@pcrespov pcrespov changed the title 🐛🎨 Fixes unhandled config error and new log helpers 🐛🎨 Fixes unhandled config error and new log helpers for better troubleshotting Sep 30, 2024
Copy link
Contributor

@GitHK GitHK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 nice

@pcrespov pcrespov enabled auto-merge (squash) October 1, 2024 07:50
Copy link
Member

@mrnicegyu11 mrnicegyu11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good :--)

@pcrespov pcrespov disabled auto-merge October 1, 2024 11:41
@pcrespov pcrespov merged commit 22c86fa into ITISFoundation:master Oct 1, 2024
2 checks passed
@pcrespov pcrespov deleted the fix/config-error branch October 1, 2024 11:41
@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 1, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a:services-library issues on packages/service-libs 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.

4 participants