lablup / lablup/backend.ai

v2 CLI `resource-group get` fails with ValidationError due to DTO schema mismatch

Open
#10,893 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
670
Forks
183
Avg merge
17h 7m
Merged PRs (30d)
358

Description

Running `./bai resource-group get default` crashes with a Pydantic `ValidationError` containing 7 field errors.

The REST API response does not match the `ResourceGroupNode` DTO:

- `id` is returned as the name string (`"default"`) instead of a UUID

- Required fields `domain_name`, `is_active`, `total_resource_slots`, `allowed_vfolder_hosts`, `created_at`, `modified_at` are missing from the response

Steps to reproduce:

1. `./bai resource-group get default`

Expected: Resource group details displayed

Actual: `pydantic_core._pydantic_core.ValidationError: 7 validation errors for ResourceGroupNode`

Root cause: The REST v2 handler for `resource-group get` returns a different response shape than what `ResourceGroupNode` expects. Either the handler needs to include all required fields, or the DTO needs to align with the actual response.

JIRA Issue: BA-5642

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.