My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 3707: Star Change REST API broken
1 person starred this issue and may be notified of changes. Back to list
Status:  New
Owner:  ----
Cc:  ekem...@google.com


Sign in to add a comment
 
Reported by g...@compass.com, Dec 3, 2015
*****************************************************************
*****                                                       *****
***** !!!! THIS BUG TRACKER IS FOR GERRIT CODE REVIEW !!!!  *****
*****                                                       *****
***** DO NOT SUBMIT BUGS FOR CHROME, ANDROID, CYANOGENMOD,  *****
***** INTERNAL ISSUES WITH YOUR COMPANY'S GERRIT SETUP, ETC.*****
*****                                                       *****
*****   THOSE ISSUES BELONG IN DIFFERENT ISSUE TRACKERS     *****
*****                                                       *****
*****************************************************************

Affected Version: v2.10.2

What steps will reproduce the problem?
1. Access the Star Change REST API, put "self" for <account id>
e.g. `curl -X PUT --digest --user <user>:<http password> https://<domain>/a/accounts/<account id>/starred.changes/<change id>`
This should succeed with 204 No Content; and the change is starred, as expected.
2. Repeat step 1, but use a different account id (such as the user's own username)
This will fail with 500 Internal Server Error, and the change is not starred.

What is the expected output? What do you see instead?
I expect an HTTP response code of 204 No Content, and for the change to be starred for the user <account id>.
Instead I get 500 Internal Server Error, and the change is not starred.

Please provide any additional information below.
Here is the stacktrace (account id and change id edited out):

[2015-12-03 19:29:46,839] ERROR com.google.gerrit.httpd.restapi.RestApiServlet : Error in PUT /a/accounts/<account id>/starred.changes/<change id>
com.google.inject.OutOfScopeException: Not in request scoped user
	at com.google.gerrit.server.IdentifiedUser.getStarredChanges(IdentifiedUser.java:293)
	at com.google.gerrit.server.account.StarredChanges.parse(StarredChanges.java:75)
	at com.google.gerrit.server.account.StarredChanges.parse(StarredChanges.java:48)
	at com.google.gerrit.httpd.restapi.RestApiServlet.service(RestApiServlet.java:264)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
	at com.google.inject.servlet.ServletDefinition.doServiceImpl(ServletDefinition.java:279)
	at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:269)
	at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:180)
	at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:85)
	at com.google.gerrit.httpd.RequireIdentifiedUserFilter.doFilter(RequireIdentifiedUserFilter.java:55)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
	at com.google.gwtexpui.server.CacheControlFilter.doFilter(CacheControlFilter.java:70)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
	at com.google.gerrit.httpd.RunAsFilter.doFilter(RunAsFilter.java:113)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
	at com.google.gerrit.httpd.RequireSslFilter.doFilter(RequireSslFilter.java:68)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
	at com.google.gerrit.httpd.ProjectDigestFilter.doFilter(ProjectDigestFilter.java:107)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
	at com.google.gerrit.httpd.AllRequestFilter$FilterProxy$1.doFilter(AllRequestFilter.java:64)
	at com.google.gerrit.httpd.AllRequestFilter$FilterProxy.doFilter(AllRequestFilter.java:57)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
	at com.google.gerrit.httpd.RequestContextFilter.doFilter(RequestContextFilter.java:75)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
	at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:119)
	at com.google.inject.servlet.GuiceFilter$1.call(GuiceFilter.java:133)
	at com.google.inject.servlet.GuiceFilter$1.call(GuiceFilter.java:130)
	at com.google.inject.servlet.GuiceFilter$Context.call(GuiceFilter.java:203)
	at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:130)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1636)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:564)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:219)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1111)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:498)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1045)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:98)
	at org.eclipse.jetty.server.Server.handle(Server.java:461)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:284)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:244)
	at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:534)
	at org.eclipse.[2015-12-03 19:29:46,839] ERROR com.google.gerrit.httpd.restapi.RestApiServlet : Error in PUT /a/accounts/<account id>/starred.changes/<change id>
com.google.inject.OutOfScopeException: Not in request scoped user
	at com.google.gerrit.server.IdentifiedUser.getStarredChanges(IdentifiedUser.java:293)
	at com.google.gerrit.server.account.StarredChanges.parse(StarredChanges.java:75)
	at com.google.gerrit.server.account.StarredChanges.parse(StarredChanges.java:48)
	at com.google.gerrit.httpd.restapi.RestApiServlet.service(RestApiServlet.java:264)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
	at com.google.inject.servlet.ServletDefinition.doServiceImpl(ServletDefinition.java:279)
	at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:269)
	at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:180)
	at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:85)
	at com.google.gerrit.httpd.RequireIdentifiedUserFilter.doFilter(RequireIdentifiedUserFilter.java:55)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
	at com.google.gwtexpui.server.CacheControlFilter.doFilter(CacheControlFilter.java:70)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
	at com.google.gerrit.httpd.RunAsFilter.doFilter(RunAsFilter.java:113)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
	at com.google.gerrit.httpd.RequireSslFilter.doFilter(RequireSslFilter.java:68)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
	at com.google.gerrit.httpd.ProjectDigestFilter.doFilter(ProjectDigestFilter.java:107)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
	at com.google.gerrit.httpd.AllRequestFilter$FilterProxy$1.doFilter(AllRequestFilter.java:64)
	at com.google.gerrit.httpd.AllRequestFilter$FilterProxy.doFilter(AllRequestFilter.java:57)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
	at com.google.gerrit.httpd.RequestContextFilter.doFilter(RequestContextFilter.java:75)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
	at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:119)
	at com.google.inject.servlet.GuiceFilter$1.call(GuiceFilter.java:133)
	at com.google.inject.servlet.GuiceFilter$1.call(GuiceFilter.java:130)
	at com.google.inject.servlet.GuiceFilter$Context.call(GuiceFilter.java:203)
	at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:130)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1636)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:564)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:219)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1111)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:498)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1045)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:98)
	at org.eclipse.jetty.server.Server.handle(Server.java:461)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:284)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:244)
	at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:534)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:536)
	at java.lang.Thread.run(Thread.java:745)
Dec 3, 2015
#1 m...@paulgroudas.com
For a little more context, the user sending this request has 'administrator' privileges on the server, and the corresponding GET request to fetch another user's starred changes works fine.
Dec 3, 2015
Project Member #2 david.pu...@sonymobile.com
(No comment was entered for this change.)
Cc: ekem...@google.com
Sign in to add a comment

Powered by Google Project Hosting