Skip to content

fix(setup): setup.sh — Qdrant permissions, jq null/array handling#10

Merged
anthroos merged 3 commits intomainfrom
fix/setup-sh-alpiua
May 2, 2026
Merged

fix(setup): setup.sh — Qdrant permissions, jq null/array handling#10
anthroos merged 3 commits intomainfrom
fix/setup-sh-alpiua

Conversation

@anthroos
Copy link
Copy Markdown
Owner

@anthroos anthroos commented May 2, 2026

Cherry-picks the three fixes from @alpiua's #9 onto current main. Original commits and authorship preserved.

The original PR was unmergeable as-is — its branch was based on a main snapshot from 2026-03-22 and merging would have reverted ~2,400 lines added since (v2 redesign, benchmark docs, roadmap, experience pack v3). All credit for the fixes goes to @alpiua; this PR just rebases them.

Fixes

1. Qdrant container permissions
The --user 1000:1000 flag denied writes to the named volume because the official Qdrant image runs as root (UID 0) and /qdrant/storage is owned by root. Replaced with explicit --user 0:0.

2. Silent exit on collection check
COLLECTION_EXISTS=$(curl -sf … | jq -r '.status // "not_found"') would exit with code 22 (no message) when the collection didn't yet exist and curl returned 404. Added || echo "not_found" so the variable is always set.

3. jq null + array path errors during hook registration

  • null cannot have containment checked — fixed with (.command // "") null fallback before contains().
  • object and array cannot be added — fixed by using the explicit path any(.hooks.SessionStart[]; …) and += to append, instead of any(.[]; …) and . + […] which operated on the root object.

Diff

setup.sh | 22 +++++++++++----------- — 11 insertions, 11 deletions, single file.

Closes #9

Co-authored-by: Oleksii Pylypchuk alpi@keemail.me

alpiua added 3 commits May 1, 2026 19:56
…ault

Qdrant official image runs as root (UID 0) by default. The --user 1000:1000
flag was causing permission issues with the named volume storage because:
- The container's /qdrant/storage is owned by root
- Forcing UID 1000 denied write access to storage directory

Running without --user allows the container to use its default root user,
which has proper permissions for the named volume.
Add fallback `|| echo "not_found"` to collection existence check.
Without this, the script would silently exit with code 22 when curl
fails (e.g., 404 Not Found) or jq encounters null/invalid input.

The || fallback ensures COLLECTION_EXISTS is always set to a valid
string, allowing the conditional logic to proceed correctly.
Fix two jq-related errors during Claude Code hooks registration:

1. Null containment error: Change .command | contains() to
   (.command // "") | contains() to handle hook items without
   command field.

2. Array iteration error: Change any(.[]; ...) to
   any(.hooks.SessionStart[]; ...) and use += instead of . + [...]
   to properly append to hook arrays.

Fixes: 'null cannot have containment checked' and
'object and array cannot be added' errors.
@anthroos anthroos merged commit 9c922cb into main May 2, 2026
3 checks passed
@anthroos anthroos deleted the fix/setup-sh-alpiua branch May 2, 2026 03:11
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.

2 participants