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

List all consent sessions returns 404 #1031

Closed
RazerM opened this issue Sep 13, 2018 · 2 comments
Closed

List all consent sessions returns 404 #1031

RazerM opened this issue Sep 13, 2018 · 2 comments
Assignees
Labels
bug Something is not working. package/consent
Milestone

Comments

@RazerM
Copy link

RazerM commented Sep 13, 2018

Do you want to request a feature or report a bug?
bug

What is the current behavior?
/oauth2/auth/sessions/consent/<user> gave a 404 response instead of []

Click here to show Hydra Traceback
An error occurred while handling a request" code=404 details="map[]" error="Unable to locate the resource" reason= request-id= status="Not Found" trace="Stack trace: 
github.com/ory/hydra/vendor/github.com/ory/sqlcon.HandleError
	/go/src/github.com/ory/hydra/vendor/github.com/ory/sqlcon/error.go:28
github.com/ory/hydra/client.(*SQLManager).GetConcreteClient
	/go/src/github.com/ory/hydra/client/manager_sql.go:342
github.com/ory/hydra/consent.(*SQLManager).GetConsentRequest
	/go/src/github.com/ory/hydra/consent/manager_sql.go:226
github.com/ory/hydra/consent.(*SQLManager).resolveHandledConsentRequests
	/go/src/github.com/ory/hydra/consent/manager_sql.go:438
github.com/ory/hydra/consent.(*SQLManager).FindPreviouslyGrantedConsentRequestsByUser
	/go/src/github.com/ory/hydra/consent/manager_sql.go:432
github.com/ory/hydra/consent.(*Handler).GetConsentSessions
	/go/src/github.com/ory/hydra/consent/handler.go:174
github.com/ory/hydra/consent.(*Handler).GetConsentSessions-fm
	/go/src/github.com/ory/hydra/consent/handler.go:75
github.com/ory/hydra/vendor/github.com/julienschmidt/httprouter.(*Router).ServeHTTP
	/go/src/github.com/ory/hydra/vendor/github.com/julienschmidt/httprouter/router.go:299
github.com/ory/hydra/vendor/github.com/urfave/negroni.Wrap.func1
	/go/src/github.com/ory/hydra/vendor/github.com/urfave/negroni/negroni.go:46
github.com/ory/hydra/vendor/github.com/urfave/negroni.HandlerFunc.ServeHTTP
	/go/src/github.com/ory/hydra/vendor/github.com/urfave/negroni/negroni.go:29
github.com/ory/hydra/vendor/github.com/urfave/negroni.middleware.ServeHTTP
	/go/src/github.com/ory/hydra/vendor/github.com/urfave/negroni/negroni.go:38
github.com/ory/hydra/vendor/github.com/urfave/negroni.(middleware).ServeHTTP-fm
	/go/src/github.com/ory/hydra/vendor/github.com/urfave/negroni/negroni.go:38
net/http.HandlerFunc.ServeHTTP
	/usr/local/go/src/net/http/server.go:1947
github.com/ory/hydra/cmd/server.(*Handler).rejectInsecureRequests
	/go/src/github.com/ory/hydra/cmd/server/handler.go:267
github.com/ory/hydra/cmd/server.(*Handler).(github.com/ory/hydra/cmd/server.rejectInsecureRequests)-fm
	/go/src/github.com/ory/hydra/cmd/server/handler.go:59
github.com/ory/hydra/vendor/github.com/urfave/negroni.HandlerFunc.ServeHTTP
	/go/src/github.com/ory/hydra/vendor/github.com/urfave/negroni/negroni.go:29
github.com/ory/hydra/vendor/github.com/urfave/negroni.middleware.ServeHTTP
	/go/src/github.com/ory/hydra/vendor/github.com/urfave/negroni/negroni.go:38
github.com/ory/hydra/vendor/github.com/urfave/negroni.(middleware).ServeHTTP-fm
	/go/src/github.com/ory/hydra/vendor/github.com/urfave/negroni/negroni.go:38
github.com/ory/hydra/metrics/prometheus.(*MetricsManager).ServeHTTP
	/go/src/github.com/ory/hydra/metrics/prometheus/middleware.go:26
github.com/ory/hydra/vendor/github.com/urfave/negroni.middleware.ServeHTTP
	/go/src/github.com/ory/hydra/vendor/github.com/urfave/negroni/negroni.go:38
github.com/ory/hydra/vendor/github.com/urfave/negroni.(middleware).ServeHTTP-fm
	/go/src/github.com/ory/hydra/vendor/github.com/urfave/negroni/negroni.go:38
github.com/ory/hydra/vendor/github.com/meatballhat/negroni-logrus.(*Middleware).ServeHTTP
	/go/src/github.com/ory/hydra/vendor/github.com/meatballhat/negroni-logrus/middleware.go:136
github.com/ory/hydra/vendor/github.com/urfave/negroni.middleware.ServeHTTP
	/go/src/github.com/ory/hydra/vendor/github.com/urfave/negroni/negroni.go:38
github.com/ory/hydra/vendor/github.com/urfave/negroni.(*Negroni).ServeHTTP
	/go/src/github.com/ory/hydra/vendor/github.com/urfave/negroni/negroni.go:96
github.com/ory/hydra/vendor/github.com/gorilla/context.ClearHandler.func1
	/go/src/github.com/ory/hydra/vendor/github.com/gorilla/context/context.go:141
net/http.HandlerFunc.ServeHTTP
	/usr/local/go/src/net/http/server.go:1947
net/http.serverHandler.ServeHTTP
	/usr/local/go/src/net/http/server.go:2697
net/http.(*conn).serve
	/usr/local/go/src/net/http/server.go:1830
runtime.goexit
	/usr/local/go/src/runtime

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

I think this is related to deleting a client there was a consent session for. After DELETE /oauth2/auth/sessions/consent/<user>, the endpoint responds with [] again.

What is the expected behavior?

Hydra responds with []

Which version of the software is affected?

1.0 beta 9

@aeneasr
Copy link
Member

aeneasr commented Sep 14, 2018

Ah, interesting, I think this is indeed a wrong handling of sql.ErrNoRows which returns 404 but in this case should just return an empty list!

@aeneasr aeneasr added bug Something is not working. package/consent labels Sep 14, 2018
@aeneasr aeneasr added this to the v1.0.0-rc.1 milestone Sep 14, 2018
@aeneasr aeneasr self-assigned this Sep 14, 2018
@aeneasr
Copy link
Member

aeneasr commented Nov 3, 2018

Sorry, I misread your trace and it makes total sense when you look at the stack trace. This is really about consistency between the different modules. I'm closing this as it is tracked by #1131

@aeneasr aeneasr closed this as completed Nov 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working. package/consent
Projects
None yet
Development

No branches or pull requests

2 participants