← Back to issue list

Pydantic warning: PydanticSerializationUnexpectedValue

View original Github issue

Metadata

Project
rockcraft
Number
#1154
Type
issue
State
open
Author
dimaqq
Labels
Created
Updated
Closed

Current evaluation

PydanticSerializationUnexpectedValue warning emitted during Project.marshal() when rockcraft.yaml checks contain an ExecCheck entry. Maintainer reproduced it locally and narrowed it to a tagged-union serialization issue in the Check/ExecCheck model; no fix committed yet.

Suggested action: keep open

Reason: Maintainer gcomneno actively reproduced the warning and diagnosed it as a tagged-union serialization problem in the Check/ExecCheck model (last activity 153 days ago), so it is triaged and valid. The code still uses a custom pydantic.Discriminator(_get_check_tag) that only accepts Mapping input, which is why serialization of an ExecCheck instance triggers the warning; no fix commit exists yet.

Impact: 35 Quick Win: 21.0 Staleness: 45 Complexity: 40 Confidence: 70 Support Request: 10

Issue body

### Check existing issues - [x] I've verified that this bug isn't described by any existing issues. ### Bug description Recently I'm getting this additional warning output ### Steps to reproduce `rockcraft pack` ### Environment concierge prepare -p k8s ### rockcraft.yaml ```yaml --- name: gubernator version: 3.0.0 summary: High-performance, distributed rate-limiting service description: | Gubernator is a high-performance, distributed rate-limiting service. license: Apache-2.0 platforms: {amd64: null, arm64: null} base: ubuntu@24.04 parts: go-deps: plugin: nil build-packages: - golang-go gubernator: plugin: go source: https://github.com/gubernator-io/gubernator.git source-type: git # The tip of the v3.0 branch fails the health check # source-branch: v3.0 # A known good revision from v3.0 branch from June 2024 source-commit: 2903b1b566dc9beab322e37ecef4aff50c1a7a97 stage-packages: - ca-certificates after: - go-deps services: gubernator: override: replace startup: enabled command: /bin/gubernator environment: GUBER_TRACING_LEVEL: DEBUG GUBER_HTTP_ADDRESS: 0.0.0.0:80 GUBER_GRPC_ADDRESS: 0.0.0.0:81 on-success: shutdown on-failure: shutdown on-check-failure: online: shutdown checks: online: override: replace exec: # The healthcheck binary is provided by gubernator, it uses same env vars as the daemon command: /bin/healthcheck period: 3s ``` ### Log output ```shell Skipping prime for pebble (already ran)/snap/rockcraft/4238/lib/python3.12/site-packages/pydantic/main.py:464: UserWarning: Pydantic serializer warnings: PydanticSerializationUnexpectedValue(Defaulting to left to right union serialization - failed to get discriminator value for tagged union serialization [input_value=ExecCheck(override='repla...None, working_dir=None)), input_type=ExecCheck]) return self.__pydantic_serializer__.to_python( ```

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 35
Quick Win: 21.0
Staleness: 45
Complexity: 40
Confidence: 70
Support Request: 10
keep open PydanticSerializationUnexpectedValue warning emitted during Project.marshal() when rockcraft.yaml checks contain an ExecCheck entry. Maintainer reproduced it locally and narrowed it to a tagged-union serialization issue in the Check/ExecCheck model; no fix committed yet.
qwen/qwen3.6-35b-a3b
Staleness: 55
Complexity: 45
Confidence: 85
Support Request: 5
needs triage Unlabelled bug report about a Pydantic v2 serialization warning during rockcraft pack. Reproduced and isolated to Project.marshal() with ExecCheck models, but remains inactive for over 112 days without labels or maintainer assignment.
qwen3.6-35b-a3b-mtp-q6
Staleness: 45
Complexity: 30
Confidence: 85
Support Request: 10
keep open Reports a Pydantic serialization warning during rockcraft pack when marshaling ExecCheck objects. A maintainer reproduced it and identified it as a tagged-union serialization warning, but no fix has been implemented yet.
qwen3.6-35b-a3b-mtp-q6
Staleness: 65
Complexity: 40
Confidence: 75
Support Request: 10
needs triage Pydantic serialization warning during rockcraft pack when marshalling ExecCheck objects. Reproduced and analyzed by a contributor, but remains unlabelled, unassigned, and inactive for over three months.
qwen3.6-35b-a3b-mtp-q6
Staleness: 65
Complexity: 40
Confidence: 85
Support Request: 10
needs triage Pydantic serialization warning triggers during Project marshal when handling ExecCheck objects. Output remains correct, indicating a tagged-union serialization quirk rather than a validation bug. Reproduced locally and awaiting triage.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.