Skip to content

Fix logs export/search: drop invalid tail=all from full_url#93

Merged
kavehtoyser merged 1 commit into
developfrom
fix-logs-export-tail-all
Jun 29, 2026
Merged

Fix logs export/search: drop invalid tail=all from full_url#93
kavehtoyser merged 1 commit into
developfrom
fix-logs-export-tail-all

Conversation

@kavehtoyser

Copy link
Copy Markdown
Collaborator

Problem

Exporting (or searching) logs in the new logs view saved a 150-byte JSON error instead of the log:

{"detail":[{"type":"int_parsing","loc":["query","tail"],"msg":"Input should be a valid integer, unable to parse string as an integer","input":"all"}]}

full_url was built with tail=all, but /services/~logs and /logs/stream type tail as Optional[int], so FastAPI 422s on "all". Both export and search fetch FULL_URL, so both were broken.

Fix

Omit tail from full_url. The endpoint then receives tail=None, and the runtime connector already maps a falsy tail to Docker's "all" (whole log) — see runtime_connectors.py "tail": tail if tail else "all".

  • manager/routers/service_api.py — service log view full_urlbase (no tail)
  • manager/routers/logging_api.py — manager log view full_url/logs/stream
  • tests/manager_test/test_ui_redesign.py — guard tests previously asserted the buggy tail=all; now assert full_url carries no tail and tail=all is absent.

Verification

  • tail=all → 422 (reproduced the bug); omitted/int tail → reaches handler (200).
  • 17/17 test_ui_redesign.py pass; black ✓, flake8 ✓, pylint 10/10.

🤖 Generated with Claude Code

The logs view built full_url with tail=all, but the /services/~logs and
/logs/stream endpoints type tail as Optional[int], so FastAPI rejected
"all" with a 422. The export and search features (both fetch FULL_URL)
saved/searched that error JSON instead of the log.

Omit tail entirely so the endpoint receives None; the runtime connector
already maps a falsy tail to Docker's "all" (whole log). Guard tests
updated to assert full_url carries no tail and that tail=all is absent.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@kavehtoyser kavehtoyser merged commit 56ec851 into develop Jun 29, 2026
8 checks passed
@kavehtoyser kavehtoyser deleted the fix-logs-export-tail-all branch June 29, 2026 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant