Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix _scheduler/docs/... path 500 errors #5103

Merged
merged 1 commit into from
Jun 26, 2024

Conversation

nickva
Copy link
Contributor

@nickva nickva commented Jun 25, 2024

Return a 400 response for _scheduler/docs/foo or _scheduler/docs/w/x/_replicator/y/z paths instead of a 500 error.

Fix: #5089

@rnewson
Copy link
Member

rnewson commented Jun 25, 2024

curl https://foo:bar@localhost:15984/_scheduler/docs/rep2 -i
HTTP/1.1 400 Bad Request
Cache-Control: must-revalidate
Content-Length: 36
Content-Type: application/json
Date: Tue, 25 Jun 2024 09:25:15 GMT
Server: CouchDB/3.3.3-03c4a6a (Erlang OTP/25)
X-Couch-Request-ID: 18b134a7b5
X-CouchDB-Body-Time: 0

{"error":"bad_request","reason":""}

This is definitely an improvement over

{"error":"unknown_error","reason":"function_clause","ref":1083485994}

but I think we should fill in a reason.

@nickva
Copy link
Contributor Author

nickva commented Jun 25, 2024

Good point, I'll add a reason to the bad_request.

Return a 400 response for _scheduler/docs/foo or
_scheduler/docs/w/x/_replicator/y/z paths instead of a 500 error.

Fix: #5089
@nickva nickva force-pushed the fix-replicator-scheduler-docs-api branch from f735481 to ad7414c Compare June 25, 2024 14:43
@nickva
Copy link
Contributor Author

nickva commented Jun 25, 2024

% http $DB/_scheduler/docs/w/x/_replicator/y/z
HTTP/1.1 400 Bad Request

{
    "error": "bad_request",
    "reason": "Invalid path"
}

% http $DB/_scheduler/docs/foo
HTTP/1.1 400 Bad Request

{
    "error": "bad_request",
    "reason": "Invalid path"
}

@nickva nickva merged commit 44436fd into main Jun 26, 2024
17 checks passed
@nickva nickva deleted the fix-replicator-scheduler-docs-api branch June 26, 2024 16:45
This pull request was closed.
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.

Don't crash with a 500 error on a missing replicator db in _scheduler/docs
2 participants