diff --git a/rest/admin_api.go b/rest/admin_api.go index a63d131163..3f6ce61b34 100644 --- a/rest/admin_api.go +++ b/rest/admin_api.go @@ -123,7 +123,7 @@ func (h *handler) handleCreateDB() error { return httpErr } if errors.Is(err, base.ErrAuthError) { - return base.HTTPErrorf(http.StatusForbidden, "Provided credentials do not have access to specified bucket/scope/collection") + return base.HTTPErrorf(http.StatusForbidden, "The specified bucket/scope/collection does not exist, or the provided credentials do not have access to it") } if errors.Is(err, base.ErrAlreadyExists) { return base.HTTPErrorf(http.StatusConflict, "couldn't load database: %s", err) diff --git a/rest/adminapitest/admin_api_test.go b/rest/adminapitest/admin_api_test.go index 32169e418f..95e7480c3b 100644 --- a/rest/adminapitest/admin_api_test.go +++ b/rest/adminapitest/admin_api_test.go @@ -3612,10 +3612,10 @@ func TestCreateDbOnNonExistentBucket(t *testing.T) { resp := rest.BootstrapAdminRequest(t, http.MethodPut, "/db/", `{"bucket": "nonexistentbucket"}`) resp.RequireStatus(http.StatusForbidden) - assert.Contains(t, resp.Body, "Provided credentials do not have access to specified bucket/scope/collection") + assert.Contains(t, resp.Body, "The specified bucket/scope/collection does not exist, or the provided credentials do not have access to it") resp = rest.BootstrapAdminRequest(t, http.MethodPut, "/nonexistentbucket/", `{}`) resp.RequireStatus(http.StatusForbidden) - assert.Contains(t, resp.Body, "Provided credentials do not have access to specified bucket/scope/collection") + assert.Contains(t, resp.Body, "The specified bucket/scope/collection does not exist, or the provided credentials do not have access to it") } func TestPutDbConfigChangeName(t *testing.T) {