fix(setup): setup.sh — Qdrant permissions, jq null/array handling#10
Merged
fix(setup): setup.sh — Qdrant permissions, jq null/array handling#10
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
mainsnapshot 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:1000flag denied writes to the named volume because the official Qdrant image runs asroot(UID 0) and/qdrant/storageis 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 andcurlreturned 404. Added|| echo "not_found"so the variable is always set.3.
jqnull + array path errors during hook registrationnull cannot have containment checked— fixed with(.command // "")null fallback beforecontains().object and array cannot be added— fixed by using the explicit pathany(.hooks.SessionStart[]; …)and+=to append, instead ofany(.[]; …)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