New issue
Advanced search Search tips

Issue 3882 link

Starred by 1 user

Issue metadata

Status: Released
Owner: ----
Closed: Feb 2016



Sign in to add a comment

"No user on email thread" exception when label with group parameter is used in watched projects predicate

Reported by david.pu...@sonymobile.com, Feb 8 2016

Issue description

*****************************************************************
*****                                                       *****
***** !!!! 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: 2.11.x

What steps will reproduce the problem?
1. As user 'foo', create a project watch on "test-project" with the query `label:Code-Review=+1,group=bar`
2. As user 'baz' add a comment on a change for project "test-project"
3.

What is the expected output? What do you see instead?

Mail is not sent and error  OutOfScopeException("No user on email thread") is raised.

Please provide any additional information below.

Originally reported by Remy Bohmer in the mailing list:

https://groups.google.com/d/msg/repo-discuss/lMsQrj1fhGE/ajfMEX4lEgAJ

Stack trace:

[2016-01-28 09:52:38,223] ERROR 
com.google.gerrit.server.change.EmailReviewComments : Cannot email 
comments for 98404,1 
com.google.inject.ProvisionException: Unable to provision, see the 
following errors: 

1) Error in custom provider, com.google.inject.OutOfScopeException: No 
user on email thread 
  at com.google.gerrit.server.util.ThreadLocalRequestContext$1.provideCurrentUser(ThreadLocalRequestContext.java:56) 
(via modules: com.google.gerrit.server.config.GerritGlobalModule -> 
com.google.gerrit.server.util.ThreadLocalRequestContext$1) 
  while locating com.google.gerrit.server.CurrentUser 

1 error 
        at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1025) 
        at com.google.gerrit.server.account.GroupControl$Factory.controlFor(GroupControl.java:88) 
        at com.google.gerrit.server.account.GroupControl$Factory.controlFor(GroupControl.java:84) 
        at com.google.gerrit.server.account.InternalGroupBackend$2.apply(InternalGroupBackend.java:82) 
        at com.google.gerrit.server.account.InternalGroupBackend$2.apply(InternalGroupBackend.java:78) 
        at com.google.common.collect.Iterators$7.computeNext(Iterators.java:652) 
        at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143) 
        at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138) 
        at com.google.common.collect.TransformedIterator.hasNext(TransformedIterator.java:43) 
        at com.google.common.collect.Iterators.addAll(Iterators.java:361) 
        at com.google.common.collect.Lists.newArrayList(Lists.java:160) 
        at com.google.common.collect.Lists.newArrayList(Lists.java:144) 
        at com.google.gerrit.server.account.InternalGroupBackend.suggest(InternalGroupBackend.java:86) 
        at com.google.gerrit.server.account.UniversalGroupBackend.suggest(UniversalGroupBackend.java:91) 
        at com.google.gerrit.server.account.GroupBackends.findBestSuggestion(GroupBackends.java:64) 
        at com.google.gerrit.server.account.GroupBackends.findBestSuggestion(GroupBackends.java:49) 
        at com.google.gerrit.server.query.change.ChangeQueryBuilder.parseGroup(ChangeQueryBuilder.java:803) 
        at com.google.gerrit.server.query.change.ChangeQueryBuilder.label(ChangeQueryBuilder.java:542) 
        at com.google.gerrit.server.query.change.ChangeQueryBuilder.defaultField(ChangeQueryBuilder.java:777) 
        at com.google.gerrit.server.query.QueryBuilder.defaultField(QueryBuilder.java:293) 
        at com.google.gerrit.server.query.QueryBuilder.toPredicate(QueryBuilder.java:220) 
        at com.google.gerrit.server.query.QueryBuilder.children(QueryBuilder.java:321) 
        at com.google.gerrit.server.query.QueryBuilder.toPredicate(QueryBuilder.java:213) 
        at com.google.gerrit.server.query.QueryBuilder.parse(QueryBuilder.java:185) 
        at com.google.gerrit.server.mail.ProjectWatch.filterMatch(ProjectWatch.java:210) 
        at com.google.gerrit.server.mail.ProjectWatch.add(ProjectWatch.java:183) 
        at com.google.gerrit.server.mail.ProjectWatch.getWatchers(ProjectWatch.java:71) 
        at com.google.gerrit.server.mail.ChangeEmail.getWatchers(ChangeEmail.java:309) 
        at com.google.gerrit.server.mail.NotificationEmail.includeWatchers(NotificationEmail.java:68) 
        at com.google.gerrit.server.mail.CommentSender.init(CommentSender.java:93) 
        at com.google.gerrit.server.mail.OutgoingEmail.send(OutgoingEmail.java:90) 
        at com.google.gerrit.server.change.EmailReviewComments.run(EmailReviewComments.java:137) 
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) 
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) 
        at com.google.gerrit.server.git.WorkQueue$Task.run(WorkQueue.java:379) 
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
        at java.lang.Thread.run(Thread.java:745) 
Caused by: com.google.inject.OutOfScopeException: No user on email thread 
        at com.google.gerrit.server.change.EmailReviewComments.getCurrentUser(EmailReviewComments.java:156) 
        at com.google.gerrit.server.util.ThreadLocalRequestContext$1.provideCurrentUser(ThreadLocalRequestContext.java:56) 
        at com.google.gerrit.server.util.ThreadLocalRequestContext$1$$FastClassByGuice$$75e0eb90.invoke(<generated>) 
        at com.google.inject.internal.ProviderMethod$FastClassProviderMethod.doProvision(ProviderMethod.java:272) 
        at com.google.inject.internal.ProviderMethod.get(ProviderMethod.java:172) 
        at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81) 
        at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:53) 
        at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:61) 
        at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45) 
        at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016) 
        at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092) 
        at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012) 
        ... 39 more 

 
Status: ChangeUnderReview
https://gerrit-review.googlesource.com/#/c/74687/
Labels: FixedIn-2.11.7
Status: Submitted
Status: Released

Comment 4 by polyme...@gmail.com, Jul 19 2016

What!!!! Got you all this time

Sign in to add a comment