theonedev/onedev · error · NotAcceptableException
Please login to perform this query
Error message
Please login to perform this query
What it means
IgnoredByMeCriteria builds a query predicate (or in-memory match) for issues ignored by the current user. It resolves the user from the request context via User.get(); when no user is bound to the thread (anonymous access, or execution outside an authenticated request), it refuses and throws NotAcceptableException with 'Please login to perform this query'. The 'IgnoredByMe' concept is inherently user-relative, so anonymous evaluation is impossible.
Source
Thrown at server-core/src/main/java/io/onedev/server/search/entity/issue/IgnoredByMeCriteria.java:29
import org.jspecify.annotations.Nullable;
import io.onedev.server.exception.NotAcceptableException;
import io.onedev.server.model.Issue;
import io.onedev.server.model.User;
import io.onedev.server.util.ProjectScope;
import io.onedev.server.util.criteria.Criteria;
public class IgnoredByMeCriteria extends Criteria<Issue> {
private static final long serialVersionUID = 1L;
@Override
public Predicate getPredicate(@Nullable ProjectScope projectScope, CriteriaQuery<?> query, From<Issue, Issue> from, CriteriaBuilder builder) {
var user = User.get();
if (user != null)
return getCriteria(user).getPredicate(projectScope, query, from, builder);
else
throw new NotAcceptableException(_T("Please login to perform this query"));
}
@Override
public boolean matches(Issue issue) {
var user = User.get();
if (user != null)
return getCriteria(user).matches(issue);
else
throw new NotAcceptableException(_T("Please login to perform this query"));
}
private Criteria<Issue> getCriteria(User user) {
return new IgnoredByUserCriteria(user);
}
@Override
public String toStringWithoutParens() {
return IssueQuery.getRuleName(IgnoredByMe);View on GitHub (pinned to d44925c47c)
Solutions
- Log in (or authenticate the API request) so User.get() returns a real user before running the query
- Remove 'IgnoredByMe' from queries that anonymous users can execute, or use an explicit user criteria like 'IgnoredBy "name"' via IgnoredByUserCriteria
- For server-side code, run the query within an authenticated user context instead of a bare thread
Example fix
// before (anonymous) IssueQuery.parse(project, "IgnoredByMe").find(...); // after: ensure authenticated or use explicit user criteria new IgnoredByUserCriteria(currentUser).getPredicate(scope, query, from, builder);
Defensive patterns
Strategy: validation
Validate before calling
if (User.get() == null) {
// block user-relative criteria before running the query
throw new NotAcceptableException("Login required for this query");
} Prevention
- Check User.get() before executing queries containing 'IgnoredByMe' or other *Me criteria
- Require authentication for endpoints that accept user-supplied queries
- Prefer explicit-user criteria in server-side/background contexts
When it happens
Trigger: Calling IssueQuery.find/optimize or getPredicate on a query containing 'IgnoredByMe' while the current session is anonymous (no login), or invoking the criteria from background/system code where no User is set on the thread.
Common situations: Anonymous users hitting a saved query or dashboard containing 'IgnoredByMe'; REST API calls without authentication; scheduled jobs or webhooks evaluating issue queries server-side with no user context.
Related errors
- Criteria '${operator}' is not supported here
- Please login to perform this query
- Please login to perform this query
- Please login to perform this query
- Please login to perform this query
AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06).
Data as JSON: /api/errors/aca295905d030521.
Report an issue: GitHub.