A user is unable to comment on tickets in Jira Data Center with the error "Uncaught exception thrown by REST service: Failed operation: SetOperation"
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
One or more users is unable to comment on a ticket in Jira Data Center. Errors similar to the following are observed in the Jira application logs:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2024-01-01 00:00:00,000+0000 http-nio-8080-exec-1 ERROR username 123x45678x9 123abcd 1.2.3.4 /rest/greenhopper/1.0/xboard/issue/details.json [c.a.p.r.c.error.jersey.ThrowableExceptionMapper] Uncaught exception abcd1234-ef56-01ab-23cd-0123456abcdef thrown by REST service: Failed operation: SetOperation[entityName=ApplicationUser,entityId=10000,propertyKey=user.issue.comments.order,newType=5,newMapper=TypeMapper[handler=StringPropertyHandler,valueEntity=OSPropertyString]]
com.opensymphony.module.propertyset.PropertyImplementationException: Failed operation: SetOperation[entityName=ApplicationUser,entityId=10000,propertyKey=user.issue.comments.order,newType=5,newMapper=TypeMapper[handler=StringPropertyHandler,valueEntity=OSPropertyString]]
at com.atlassian.jira.propertyset.CachingOfBizPropertyEntryStore.propEx(CachingOfBizPropertyEntryStore.java:409)
at com.atlassian.jira.propertyset.CachingOfBizPropertyEntryStore.retry(CachingOfBizPropertyEntryStore.java:395)
at com.atlassian.jira.propertyset.CachingOfBizPropertyEntryStore.setEntry(CachingOfBizPropertyEntryStore.java:173)
at com.atlassian.jira.propertyset.CachingOfBizPropertySet.setImpl(CachingOfBizPropertySet.java:183)
at com.opensymphony.module.propertyset.AbstractPropertySet.set(AbstractPropertySet.java:502)
at com.opensymphony.module.propertyset.AbstractPropertySet.setString(AbstractPropertySet.java:300)
at com.atlassian.jira.user.preferences.JiraUserPreferences.setString(JiraUserPreferences.java:109)
at com.atlassian.jira.issue.comments.CommentOrderManagerImpl.setIssueCommentsOrder(CommentOrderManagerImpl.java:32)
[...]
Caused by: com.querydsl.core.NonUniqueResultException: Only one result is allowed for fetchOne calls
at com.querydsl.core.support.FetchableQueryBase.uniqueResult(FetchableQueryBase.java:64)
at com.querydsl.sql.ProjectableSQLQuery.fetchOne(ProjectableSQLQuery.java:398)
Environment
Jira Data Center on any version from 8.0.0.
Diagnosis
Run the following SQL queries, replacing <username> with the username (in lowercase) of the user experiencing problems:
1
2
3
SELECT * FROM propertyentry WHERE property_key = 'user.issue.comments.order' AND entity_id = (SELECT id FROM app_user WHERE lower_user_name='<username>');
SELECT * FROM propertystring WHERE id IN (SELECT id FROM propertyentry WHERE property_key = 'user.issue.comments.order' AND entity_id = (SELECT id FROM app_user WHERE lower_user_name='<username>'));
If the query results return more than one row, the user is affected by this problem, e.g.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
╭───────┬─────────────────┬───────────┬───────────────────────────┬──────────────╮
│ ID │ ENTITY_NAME │ ENTITY_ID │ PROPERTY_KEY │ PROPERTYTYPE │
├───────┼─────────────────┼───────────┼───────────────────────────┼──────────────┤
│ 99998 │ ApplicationUser │ 10000 │ user.issue.comments.order │ 5 │
│ 99999 │ ApplicationUser │ 10000 │ user.issue.comments.order │ 5 │
╰───────┴─────────────────┴───────────┴───────────────────────────┴──────────────╯
╭───────┬───────────────╮
│ ID │ PROPERTYVALUE │
├───────┼───────────────┤
│ 99998 │ desc │
│ 99999 │ desc │
╰───────┴───────────────╯
Cause
Jira saves its user preferences as properties in the database, including the user's preferred comment order (newest first or oldest first). If duplicate entries exist for the same preference, an error will occur. The exact reason why duplicate entries might appear in these tables is currently unknown, since such data discrepancy cannot be replicated in a fresh vanilla Jira application.
Solution
Always back up your data before making any database modifications. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.
Remove the duplicate entries with the lower ID value (note that both ID values should match). In the above example, we would do this using the following database queries:
1
2
3
DELETE FROM propertyentry WHERE id=99998;
DELETE FROM propertystring WHERE id=99998;
Was this helpful?