Skip to content

Conversation

@pcrespov
Copy link
Member

@pcrespov pcrespov commented Oct 10, 2025

What do these changes do?

The endpoint GET /v0/projects/{project_id}/nodes/-/services was returning a 5XX error due to an unhandled pydantic.ValidationError raised by catalog_service.batch_get_my_services. SEE

pydantic_core._pydantic_core.ValidationError: 1 validation error for function-after[functools.partial(<function min_length_validator at 0x773eebd72de0>, min_length=1)(), function-before[_deduplicate_preserving_order(), list[tuple[constrained-str, constrained-str]]]]

  Value should have at least 1 item after validation, not 0 [type=too_short, input_value=[], input_type=list]

    For further information visit https://errors.pydantic.dev/2.11/v/too_short

This occurred when a project had no nodes — resulting in an empty list being passed to the batch operation, which expects at least one service identifier.

The fix ensures that the request short-circuits gracefully when there are no nodes, avoiding the call to batch_get_my_services and returning an empty response instead.

Related issue/s

  • detected by @odeimaiz in master and local deploy

How to test

  • Manually

    • Click "+" in the dashboard and create ane empty project
    • Open info in project
  • Driving test

cd services/web/server
make install-dev
pytest -vv tests/unit/with_dbs -k test_get_project_services_empty_project

Dev-ops

None

@pcrespov pcrespov changed the title 🐛 webserver: 🐛 webserver: Fix 5XX error in GET /v0/projects/{project_id}/nodes/-/services when project has no nodes Oct 10, 2025
@pcrespov pcrespov changed the title 🐛 webserver: Fix 5XX error in GET /v0/projects/{project_id}/nodes/-/services when project has no nodes 🐛 webserver: Fix 5XX error in GET /v0/projects/{project_id}/nodes/-/services when project has no nodes Oct 10, 2025
@codecov
Copy link

codecov bot commented Oct 10, 2025

Codecov Report

❌ Patch coverage is 57.89474% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.60%. Comparing base (3632ac8) to head (dfc45a0).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8501      +/-   ##
==========================================
+ Coverage   87.62%   89.60%   +1.97%     
==========================================
  Files        2001     1576     -425     
  Lines       77920    65050   -12870     
  Branches     1338      496     -842     
==========================================
- Hits        68280    58287    -9993     
+ Misses       9240     6634    -2606     
+ Partials      400      129     -271     
Flag Coverage Δ
integrationtests 64.12% <42.10%> (-0.03%) ⬇️
unittests 88.04% <52.63%> (+1.72%) ⬆️
Components Coverage Δ
pkg_aws_library ∅ <ø> (∅)
pkg_celery_library ∅ <ø> (∅)
pkg_dask_task_models_library ∅ <ø> (∅)
pkg_models_library 93.06% <ø> (ø)
pkg_notifications_library ∅ <ø> (∅)
pkg_postgres_database ∅ <ø> (∅)
pkg_service_integration 70.17% <ø> (ø)
pkg_service_library ∅ <ø> (∅)
pkg_settings_library ∅ <ø> (∅)
pkg_simcore_sdk 84.95% <ø> (+0.05%) ⬆️
agent 93.10% <ø> (ø)
api_server 91.86% <ø> (ø)
autoscaling 95.72% <ø> (ø)
catalog 92.06% <ø> (ø)
clusters_keeper 99.14% <ø> (ø)
dask_sidecar 91.82% <ø> (-0.56%) ⬇️
datcore_adapter 97.95% <ø> (ø)
director 75.72% <ø> (ø)
director_v2 90.94% <ø> (-0.06%) ⬇️
dynamic_scheduler 96.82% <ø> (ø)
dynamic_sidecar 90.44% <ø> (ø)
efs_guardian 89.83% <ø> (ø)
invitations 90.90% <ø> (ø)
payments 92.80% <ø> (ø)
resource_usage_tracker 92.22% <ø> (ø)
storage 86.57% <ø> (+0.37%) ⬆️
webclient ∅ <ø> (∅)
webserver 87.24% <57.89%> (-0.08%) ⬇️

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 3632ac8...dfc45a0. 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 self-assigned this Oct 10, 2025
@pcrespov pcrespov added the a:webserver webserver's codebase. Assigning the area is particularly useful for bugs label Oct 10, 2025
@pcrespov pcrespov marked this pull request as ready for review October 10, 2025 15:31
@mergify
Copy link
Contributor

mergify bot commented Oct 10, 2025

🧪 CI Insights

Here's what we observed from your CI run for dfc45a0.

🟢 All jobs passed!

But CI Insights is watching 👀

@pcrespov pcrespov enabled auto-merge (squash) October 10, 2025 16:59
@pcrespov
Copy link
Member Author

@mergify queue

@mergify
Copy link
Contributor

mergify bot commented Oct 10, 2025

queue

🟠 Waiting for conditions to match

  • -closed [📌 queue requirement]
  • any of: [🔀 queue conditions]
    • all of: [📌 queue conditions of queue default]
      • label=🤖-automerge
      • #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
      • 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
      • any of: [🛡 GitHub branch protection]
        • check-success = SonarCloud Code Analysis
        • check-neutral = SonarCloud Code Analysis
        • check-skipped = SonarCloud Code Analysis
  • -conflict [📌 queue requirement]
  • -draft [📌 queue requirement]
  • any of: [📌 queue -> configuration change requirements]
    • -mergify-configuration-changed
    • check-success = Configuration changed

@pcrespov pcrespov added this to the Cheops milestone Oct 10, 2025
Copy link
Member

@sanderegg sanderegg left a comment

Choose a reason for hiding this comment

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

just some thoughts here.

@sonarqubecloud
Copy link

@pcrespov pcrespov merged commit 7f199cb into ITISFoundation:master Oct 13, 2025
93 of 95 checks passed
@pcrespov pcrespov deleted the fix/catalog-batch-service-follow-up branch October 13, 2025 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a:webserver webserver's codebase. Assigning the area is particularly useful for bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants