Repository navigation
fix: pass --credentials to Solr 10 CLI, fail on collection creation errors - #80
Merged
Merged
Conversation
…rrors Solr 10.1.0 "bin/solr create" uses the V2 Collections API with a request body. Credentials from SOLR_AUTHENTICATION_OPTS are only sent after a 401 challenge, and the body can't be replayed, so the techproducts collection was never created and "|| true" hid the error. - Solr 10+: append --credentials to the CLI commands that accept it - create collections only if missing, without "|| true" - tests: show curl error bodies, check "ddev solr create" Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Short Summary (TL;DR)
Fixes the Solr 10 test failure that started with the
solr:10image moving to 10.1.0:bin/solr creategot a 401, so the configset collection was never created.The Issue
Scheduled tests fail on all runners in
install from directory Solr 10(run), showing onlyexit status 22fromcurl -sf.In Solr 10.1.0,
bin/solr createswitched to the V2 Collections API (POST /api/collectionswith a JSON body). Credentials fromSOLR_AUTHENTICATION_OPTS(system property orsolr.httpclient.configfile) go throughPreemptiveBasicAuthClientCustomizer, which despite its name only answers a 401 challenge. Jetty can't replay the streamed request body, so the request fails with 401.solr create ... || truehid the error and the healthcheck still passed.Only the
-u/--credentialsCLI option sends theAuthorizationheader up front.How This PR Solves The Issue
/etc/default/solr.in.sh(sourced bybin/solr) appends--credentials(taken fromSOLR_AUTHENTICATION_OPTS) to the CLI commands that accept it in both 10.0.0 and 10.1.0. This also fixesddev solr createetc. Thesolr.security.auth.basicauth.credentialssystem property stays as the fallback for anything not in the list.solr zk ls /collections/<name>says it doesn't exist, without|| true. A real failure now stops the init, the healthcheck fails, and the error is visible inddev logs -s solr.curl -sS --fail-with-bodyto show error responses, and a newddev solr create -c ddev-testcheck.Manual Testing Instructions
Automated Testing Overview
bats tests/test.bats --filter "Solr 10"passes locally with Solr 10.1.0, and the same checks pass manually withsolr:10.0.0.Release/Deployment Notes
No user action needed.
🤖 Generated with Claude Code