com.atlassian.jira.exception.DataAccessException: com.atlassian.jira.jql.parser.JqlParseException:com.atlassian.jira.jql.parser.antlr.RuntimeRecognitionException: MismatchedSetException(46!=null)

Atlassian JIRA | James Roper [Atlassian] | 6 years ago
  1. 0

    The following code: {code:java} searchRequestManager.getAll().foreach(new SharedEntityGroupUpdator<SearchRequest>(oldName, newName, filterPermissions)); {code} is throwing the following exception: {noformat} com.atlassian.jira.exception.DataAccessException: com.atlassian.jira.jql.parser.JqlParseException:com.atlassian.jira.jql.parser.antlr.RuntimeRecognitionException: MismatchedSetException(46!=null) at com.atlassian.jira.issue.search.OfBizSearchRequestStore.getSearchQueryFromGv(OfBizSearchRequestStore.java:415) at com.atlassian.jira.issue.search.OfBizSearchRequestStore.convertGVToRequest(OfBizSearchRequestStore.java:389) at com.atlassian.jira.issue.search.OfBizSearchRequestStore.access$000(OfBizSearchRequestStore.java:48) at com.atlassian.jira.issue.search.OfBizSearchRequestStore$1.get(OfBizSearchRequestStore.java:84) at com.atlassian.jira.issue.search.OfBizSearchRequestStore$1.get(OfBizSearchRequestStore.java:82) at com.atlassian.jira.ofbiz.DatabaseIterator.pullNext(DatabaseIterator.java:69) at com.atlassian.jira.ofbiz.DatabaseIterator.populateNextIfNull(DatabaseIterator.java:78) at com.atlassian.jira.ofbiz.DatabaseIterator.hasNext(DatabaseIterator.java:41) at com.atlassian.jira.util.collect.CollectionUtil.foreach(CollectionUtil.java:41) at com.atlassian.jira.util.collect.CloseableIterator$Functions.foreach(CloseableIterator.java:58) at com.atlassian.jira.ofbiz.DatabaseIterable.foreach(DatabaseIterable.java:45) at com.atlassian.jira.util.collect.TransformingEnclosedIterable.foreach(TransformingEnclosedIterable.java:29) at com.atlassian.studio.importer.DefaultStudioImportManager.updateGroupName(DefaultStudioImportManager.java:400) at com.atlassian.studio.importer.DefaultStudioImportManager.postImportStudify(DefaultStudioImportManager.java:298) at com.atlassian.jira.studio.importer.StudioImport.doImport(StudioImport.java:100) ... Caused by: com.atlassian.jira.jql.parser.JqlParseException: com.atlassian.jira.jql.parser.antlr.RuntimeRecognitionException: MismatchedSetException(46!=null) at com.atlassian.jira.jql.parser.DefaultJqlQueryParser.parseClause(DefaultJqlQueryParser.java:135) at com.atlassian.jira.jql.parser.DefaultJqlQueryParser.parseQuery(DefaultJqlQueryParser.java:37) at sun.reflect.GeneratedMethodAccessor274.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:592) at com.atlassian.jira.ProxyAdapter$ProxiedComponentInvocationHandler.invoke(ProxyAdapter.java:167) at $Proxy141.parseQuery(Unknown Source) at com.atlassian.jira.issue.search.OfBizSearchRequestStore.getSearchQueryFromGv(OfBizSearchRequestStore.java:410) ... 122 more Caused by: com.atlassian.jira.jql.parser.antlr.RuntimeRecognitionException: MismatchedSetException(46!=null) at com.atlassian.jira.jql.parser.antlr.LexerErrorHelper.handleError(LexerErrorHelper.java:54) at com.atlassian.jira.jql.parser.antlr.JqlLexer.recover(JqlLexer.java:121) at com.atlassian.jira.jql.parser.antlr.JqlLexer.recover(JqlLexer.java:127) at com.atlassian.jira.jql.parser.antlr.JqlLexer.mERROR_RESERVED(JqlLexer.java:1511) at com.atlassian.jira.jql.parser.antlr.JqlLexer.mTokens(JqlLexer.java:2207) at org.antlr.runtime.Lexer.nextToken(Lexer.java:84) at org.antlr.runtime.CommonTokenStream.fillBuffer(CommonTokenStream.java:119) at org.antlr.runtime.CommonTokenStream.LT(CommonTokenStream.java:238) at com.atlassian.jira.jql.parser.antlr.JqlParser.query(JqlParser.java:191) at com.atlassian.jira.jql.parser.DefaultJqlQueryParser.parseClause(DefaultJqlQueryParser.java:124) ... 129 more Caused by: MismatchedSetException(46!=null) at com.atlassian.jira.jql.parser.antlr.JqlLexer.recover(JqlLexer.java:126) ... 136 more {noformat} It would appear that one of the filters being loaded has invalid JQL. I don't think this should stop them from being loaded from the database by the {{DatabaseIterable}} though. This error occurred after a fresh JIRA import (that's probably how the corrupt filter got in there), during the Studio import process. \\ \\ *Cause* An invalid character gets stored into *searchrequest* the database, for example the query is stored like this: {code} fixVersion = 3.0 {code} * this causes problems as JIRA cannot properly parse the 3.0 Instead, what should be stored is: {code} fixVersion = "3.0" {code} * It is not known how the JQL gets improperly stored into the db

    Atlassian JIRA | 6 years ago | James Roper [Atlassian]
    com.atlassian.jira.exception.DataAccessException: com.atlassian.jira.jql.parser.JqlParseException:com.atlassian.jira.jql.parser.antlr.RuntimeRecognitionException: MismatchedSetException(46!=null)
  2. 0

    The following code: {code:java} searchRequestManager.getAll().foreach(new SharedEntityGroupUpdator<SearchRequest>(oldName, newName, filterPermissions)); {code} is throwing the following exception: {noformat} com.atlassian.jira.exception.DataAccessException: com.atlassian.jira.jql.parser.JqlParseException:com.atlassian.jira.jql.parser.antlr.RuntimeRecognitionException: MismatchedSetException(46!=null) at com.atlassian.jira.issue.search.OfBizSearchRequestStore.getSearchQueryFromGv(OfBizSearchRequestStore.java:415) at com.atlassian.jira.issue.search.OfBizSearchRequestStore.convertGVToRequest(OfBizSearchRequestStore.java:389) at com.atlassian.jira.issue.search.OfBizSearchRequestStore.access$000(OfBizSearchRequestStore.java:48) at com.atlassian.jira.issue.search.OfBizSearchRequestStore$1.get(OfBizSearchRequestStore.java:84) at com.atlassian.jira.issue.search.OfBizSearchRequestStore$1.get(OfBizSearchRequestStore.java:82) at com.atlassian.jira.ofbiz.DatabaseIterator.pullNext(DatabaseIterator.java:69) at com.atlassian.jira.ofbiz.DatabaseIterator.populateNextIfNull(DatabaseIterator.java:78) at com.atlassian.jira.ofbiz.DatabaseIterator.hasNext(DatabaseIterator.java:41) at com.atlassian.jira.util.collect.CollectionUtil.foreach(CollectionUtil.java:41) at com.atlassian.jira.util.collect.CloseableIterator$Functions.foreach(CloseableIterator.java:58) at com.atlassian.jira.ofbiz.DatabaseIterable.foreach(DatabaseIterable.java:45) at com.atlassian.jira.util.collect.TransformingEnclosedIterable.foreach(TransformingEnclosedIterable.java:29) at com.atlassian.studio.importer.DefaultStudioImportManager.updateGroupName(DefaultStudioImportManager.java:400) at com.atlassian.studio.importer.DefaultStudioImportManager.postImportStudify(DefaultStudioImportManager.java:298) at com.atlassian.jira.studio.importer.StudioImport.doImport(StudioImport.java:100) ... Caused by: com.atlassian.jira.jql.parser.JqlParseException: com.atlassian.jira.jql.parser.antlr.RuntimeRecognitionException: MismatchedSetException(46!=null) at com.atlassian.jira.jql.parser.DefaultJqlQueryParser.parseClause(DefaultJqlQueryParser.java:135) at com.atlassian.jira.jql.parser.DefaultJqlQueryParser.parseQuery(DefaultJqlQueryParser.java:37) at sun.reflect.GeneratedMethodAccessor274.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:592) at com.atlassian.jira.ProxyAdapter$ProxiedComponentInvocationHandler.invoke(ProxyAdapter.java:167) at $Proxy141.parseQuery(Unknown Source) at com.atlassian.jira.issue.search.OfBizSearchRequestStore.getSearchQueryFromGv(OfBizSearchRequestStore.java:410) ... 122 more Caused by: com.atlassian.jira.jql.parser.antlr.RuntimeRecognitionException: MismatchedSetException(46!=null) at com.atlassian.jira.jql.parser.antlr.LexerErrorHelper.handleError(LexerErrorHelper.java:54) at com.atlassian.jira.jql.parser.antlr.JqlLexer.recover(JqlLexer.java:121) at com.atlassian.jira.jql.parser.antlr.JqlLexer.recover(JqlLexer.java:127) at com.atlassian.jira.jql.parser.antlr.JqlLexer.mERROR_RESERVED(JqlLexer.java:1511) at com.atlassian.jira.jql.parser.antlr.JqlLexer.mTokens(JqlLexer.java:2207) at org.antlr.runtime.Lexer.nextToken(Lexer.java:84) at org.antlr.runtime.CommonTokenStream.fillBuffer(CommonTokenStream.java:119) at org.antlr.runtime.CommonTokenStream.LT(CommonTokenStream.java:238) at com.atlassian.jira.jql.parser.antlr.JqlParser.query(JqlParser.java:191) at com.atlassian.jira.jql.parser.DefaultJqlQueryParser.parseClause(DefaultJqlQueryParser.java:124) ... 129 more Caused by: MismatchedSetException(46!=null) at com.atlassian.jira.jql.parser.antlr.JqlLexer.recover(JqlLexer.java:126) ... 136 more {noformat} It would appear that one of the filters being loaded has invalid JQL. I don't think this should stop them from being loaded from the database by the {{DatabaseIterable}} though. This error occurred after a fresh JIRA import (that's probably how the corrupt filter got in there), during the Studio import process. \\ \\ *Cause* An invalid character gets stored into *searchrequest* the database, for example the query is stored like this: {code} fixVersion = 3.0 {code} * this causes problems as JIRA cannot properly parse the 3.0 Instead, what should be stored is: {code} fixVersion = "3.0" {code} * It is not known how the JQL gets improperly stored into the db

    Atlassian JIRA | 6 years ago | James Roper [Atlassian]
    com.atlassian.jira.exception.DataAccessException: com.atlassian.jira.jql.parser.JqlParseException:com.atlassian.jira.jql.parser.antlr.RuntimeRecognitionException: MismatchedSetException(46!=null)
  3. 0

    h1. Symptom Getting the following error when trying to view a profile page: {noformat} jiraschema.userhistoryitem (ID, entitytype, entityid, USERNAME, lastviewed, data) VALUES (?, ?, ?, ?, ?, ?) (Cannot insert duplicate key row in object 'jiraschema.userhistoryitem' with unique index 'uh_type_user_entity'.)) com.atlassian.jira.exception.DataAccessException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:UserHistoryItem][id,10374][username,admin][data,null][entityId,admin][lastViewed,1350569188345][type,Assignee] (SQL Exception while executing the following:INSERT INTO jiraschema.userhistoryitem (ID, entitytype, entityid, USERNAME, lastviewed, data) VALUES (?, ?, ?, ?, ?, ?) (Cannot insert duplicate key row in object 'jiraschema.userhistoryitem' with unique index 'uh_type_user_entity'.)) at com.atlassian.jira.ofbiz.DefaultOfBizDelegator.createValue(DefaultOfBizDelegator.java:379) at com.atlassian.jira.user.OfBizUserHistoryStore.addHistoryItemNoChecks(OfBizUserHistoryStore.java:104) at com.atlassian.jira.user.CachingUserHistoryStore$2.run(CachingUserHistoryStore.java:94) at com.atlassian.util.concurrent.ManagedLocks$ManagedLockImpl.withLock(ManagedLocks.java:333) at com.atlassian.jira.user.CachingUserHistoryStore.addHistoryItem(CachingUserHistoryStore.java:84) at com.atlassian.jira.user.SessionBasedAnonymousUserHistoryStore$2.run(SessionBasedAnonymousUserHistoryStore.java:120) at com.atlassian.util.concurrent.ManagedLocks$ManagedLockImpl.withLock(ManagedLocks.java:333) {noformat} h2. Cause If a user's name changes case and you are connected to a database that does case insensitive comparison (e.g. MSSQL 2008 as setup following the steps on https://confluence.atlassian.com/x/CpX2Cw). The most common way for a user's name to change is for it to change in an external user directory where case is important (e.g. some LDAP servers). h2. Steps * Setup JIRA to an LDAP directory. * Create a user with username "testuser" in the internal JIRA directory. * Login with username "testuser" * Go to the user's profile page. * Inside the LDAP directory, create a user "TestUser". * Move the LDAP directory to the top. * (BUG) Go to the current user's profile page. You will get the above exception.

    Atlassian JIRA | 4 years ago | Brenden Bain [Atlassian]
    com.atlassian.jira.exception.DataAccessException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:UserHistoryItem][id,10374][username,admin][data,null][entityId,admin][lastViewed,1350569188345][type,Assignee] (SQL Exception while executing the following:INSERT INTO jiraschema.userhistoryitem (ID, entitytype, entityid, USERNAME, lastviewed, data) VALUES (?, ?, ?, ?, ?, ?) (Cannot insert duplicate key row in object 'jiraschema.userhistoryitem' with unique index 'uh_type_user_entity'.))
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    When user with enormous username tries to subscribe to filter, it fails with error in log. h6. Steps to reproduce * Create user with long username e.g. *extraLongUsername0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789* * Log in with that user * Save issue search as filter * Subscribe to filter Now exception is thrown {code} 2013-10-01 11:52:42,488 http-bio-8443-exec-17 ERROR [500ErrorPage.jsp] Exception caught in 500 page org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:FilterSubscription][id,14551][username,extralongusername0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789][filterID,26581][lastRun,null][emailOnEmpty,false][group,null] (SQL Exception while executing the following:INSERT INTO public.filtersubscription (ID, FILTER_I_D, USERNAME, groupname, LAST_RUN, EMAIL_ON_EMPTY) VALUES (?, ?, ?, ?, ?, ?) (ERROR: value too long for type character varying(60))) com.atlassian.jira.exception.DataAccessException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:FilterSubscription][id,14551][username,extralongusername0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789][filterID,26581][lastRun,null][emailOnEmpty,false][group,null] (SQL Exception while executing the following:INSERT INTO public.filtersubscription (ID, FILTER_I_D, USERNAME, groupname, LAST_RUN, EMAIL_ON_EMPTY) VALUES (?, ?, ?, ?, ?, ?) (ERROR: value too long for type character varying(60))) at com.atlassian.jira.ofbiz.DefaultOfBizDelegator.createValue(DefaultOfBizDelegator.java:379) at com.atlassian.jira.entity.EntityUtils.createValue(EntityUtils.java:39) at com.atlassian.jira.issue.subscription.DefaultSubscriptionManager.createSubscription(DefaultSubscriptionManager.java:250) at com.atlassian.jira.bc.filter.DefaultFilterSubscriptionService.storeSubscription(DefaultFilterSubscriptionService.java:105) at com.atlassian.jira.web.action.filter.FilterSubscription.doExecute(FilterSubscription.java:165) <+1> (ActionSupport.java:165) at com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:83) <+7> (DefaultInterceptorChain.java:39) (NestedInterceptorChain.java:31) (ChainedInterceptor.java:16) (DefaultInterceptorChain.java:35) (GenericDispatcher.java:225) (GenericDispatcher.java:154) (JiraWebworkActionDispatcher.java:151) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) <+14> (ApplicationFilterChain.java:305) (ApplicationFilterChain.java:210) (ChainedFilterStepRunner.java:84) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (XContentTypeOptionsNoSniffFilter.java:22) (AbstractHttpFilter.java:31) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (HeaderSanitisingFilter.java:44) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (IteratingFilterChain.java:46) (DelegatingPluginFilter.java:66) at com.atlassian.jira.tzdetect.IncludeResourcesFilter.doFilter(IncludeResourcesFilter.java:39) <+3> (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:66) at com.atlassian.jira.baseurl.IncludeResourcesFilter.doFilter(IncludeResourcesFilter.java:38) <+8> (AbstractHttpFilter.java:31) (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:66) (ContextFilter.java:25) (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:66) at com.atlassian.mywork.client.filter.ServingRequestsFilter.doFilter(ServingRequestsFilter.java:37) <+3> (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:66) at com.atlassian.prettyurls.filter.PrettyUrlsDispatcherFilter.doFilter(PrettyUrlsDispatcherFilter.java:60) <+3> (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:66) at com.atlassian.prettyurls.filter.PrettyUrlsSiteMeshFilter.doFilter(PrettyUrlsSiteMeshFilter.java:92) <+3> (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:66) at com.atlassian.prettyurls.filter.PrettyUrlsMatcherFilter.doFilter(PrettyUrlsMatcherFilter.java:56) <+3> (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:66) at com.intenso.jira.contentinjection.filter.ContentInjectionFilter.doFilter(ContentInjectionFilter.java:69) <+3> (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:66) at com.atlassian.labs.botkiller.BotKillerFilter.doFilter(BotKillerFilter.java:36) <+20> (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (ServletFilterModuleContainerFilter.java:77) (ServletFilterModuleContainerFilter.java:63) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (AccessLogFilter.java:103) (AccessLogFilter.java:87) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (XsrfTokenAdditionRequestFilter.java:54) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (SiteMeshFilter.java:129) (SiteMeshFilter.java:77) (SitemeshPageFilter.java:124) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (IteratingFilterChain.java:46) (DelegatingPluginFilter.java:66) at com.atlassian.plugin.remotable.plugin.module.permission.ApiScopingFilter.doFilter(ApiScopingFilter.java:62) <+3> (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:66) at com.atlassian.prettyurls.filter.PrettyUrlsCombinedMatchDispatcherFilter.doFilter(PrettyUrlsCombinedMatchDispatcherFilter.java:61) <+22> (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (ServletFilterModuleContainerFilter.java:77) (ServletFilterModuleContainerFilter.java:63) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (SecurityFilter.java:234) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (TrustedApplicationsFilter.java:98) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (BaseLoginFilter.java:169) (JiraLoginFilter.java:70) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (IteratingFilterChain.java:46) (DelegatingPluginFilter.java:66) (OAuthFilter.java:55) (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:66) at com.atlassian.prettyurls.filter.PrettyUrlsCombinedMatchDispatcherFilter.doFilter(PrettyUrlsCombinedMatchDispatcherFilter.java:61) <+13> (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (ServletFilterModuleContainerFilter.java:77) (ServletFilterModuleContainerFilter.java:63) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (ProfilingFilter.java:99) (JIRAProfilingFilter.java:19) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (AbstractJohnsonFilter.java:71) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176) at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145) at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92) <+9> (UrlRewriteFilter.java:394) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (GzipFilter.java:80) (GzipFilter.java:51) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (IteratingFilterChain.java:46) (DelegatingPluginFilter.java:66) at com.atlassian.plugin.remotable.plugin.module.oauth.OAuth2LOFilter.doFilter(OAuth2LOFilter.java:70) <+3> (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:66) at com.atlassian.plugin.remotable.host.common.service.http.bigpipe.BigPipeRequestIdFilter.doFilter(BigPipeRequestIdFilter.java:33) <+3> (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:66) at com.atlassian.prettyurls.filter.PrettyUrlsCombinedMatchDispatcherFilter.doFilter(PrettyUrlsCombinedMatchDispatcherFilter.java:61) <+41> (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:66) (JWDSendRedirectFilter.java:25) (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (ServletFilterModuleContainerFilter.java:77) (ServletFilterModuleContainerFilter.java:63) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (ChainedFilterStepRunner.java:84) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (AbstractCachingFilter.java:33) (AbstractHttpFilter.java:31) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (AbstractEncodingFilter.java:41) (AbstractHttpFilter.java:31) (PathMatchingEncodingFilter.java:49) (AbstractHttpFilter.java:31) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (JiraStartupChecklistFilter.java:74) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (ChainedFilterStepRunner.java:84) (JiraFirstFilter.java:57) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (StandardWrapperValve.java:225) (StandardContextValve.java:123) (AuthenticatorBase.java:581) (StandardHostValve.java:168) (ErrorReportValve.java:98) (StandardEngineValve.java:118) (AccessLogValve.java:927) (CoyoteAdapter.java:407) (AbstractHttp11Processor.java:1001) (AbstractProtocol.java:585) (JIoEndpoint.java:310) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:722) Caused by: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:FilterSubscription][id,14551][username,extralongusername0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789][filterID,26581][lastRun,null][emailOnEmpty,false][group,null] (SQL Exception while executing the following:INSERT INTO public.filtersubscription (ID, FILTER_I_D, USERNAME, groupname, LAST_RUN, EMAIL_ON_EMPTY) VALUES (?, ?, ?, ?, ?, ?) (ERROR: value too long for type character varying(60))) at org.ofbiz.core.entity.GenericDAO.singleInsert(GenericDAO.java:136) at org.ofbiz.core.entity.GenericDAO.insert(GenericDAO.java:101) at org.ofbiz.core.entity.GenericHelperDAO.create(GenericHelperDAO.java:64) at org.ofbiz.core.entity.GenericDelegator.create(GenericDelegator.java:487) at org.ofbiz.core.entity.GenericDelegator.create(GenericDelegator.java:467) at com.atlassian.jira.ofbiz.DefaultOfBizDelegator.createValue(DefaultOfBizDelegator.java:374) ... 188 more {code} Problem is caused by *filtersubscription* DB table to have *username* column defined as *character varying(60)* Note that, i'm using PostgreSQL 9 and my JIRA DB has been around for ages and has been upgraded from previous versions. *Suggested Workaround* Add user with huge username to a new group, and subscribe the group to filters instead.

    Atlassian JIRA | 3 years ago | Lauri Vasko
    com.atlassian.jira.exception.DataAccessException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:FilterSubscription][id,14551][username,extralongusername0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789][filterID,26581][lastRun,null][emailOnEmpty,false][group,null] (SQL Exception while executing the following:INSERT INTO public.filtersubscription (ID, FILTER_I_D, USERNAME, groupname, LAST_RUN, EMAIL_ON_EMPTY) VALUES (?, ?, ?, ?, ?, ?) (ERROR: value too long for type character varying(60)))
  6. 0

    h1. Symptom Getting the following error when trying to view a profile page: {noformat} jiraschema.userhistoryitem (ID, entitytype, entityid, USERNAME, lastviewed, data) VALUES (?, ?, ?, ?, ?, ?) (Cannot insert duplicate key row in object 'jiraschema.userhistoryitem' with unique index 'uh_type_user_entity'.)) com.atlassian.jira.exception.DataAccessException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:UserHistoryItem][id,10374][username,admin][data,null][entityId,admin][lastViewed,1350569188345][type,Assignee] (SQL Exception while executing the following:INSERT INTO jiraschema.userhistoryitem (ID, entitytype, entityid, USERNAME, lastviewed, data) VALUES (?, ?, ?, ?, ?, ?) (Cannot insert duplicate key row in object 'jiraschema.userhistoryitem' with unique index 'uh_type_user_entity'.)) at com.atlassian.jira.ofbiz.DefaultOfBizDelegator.createValue(DefaultOfBizDelegator.java:379) at com.atlassian.jira.user.OfBizUserHistoryStore.addHistoryItemNoChecks(OfBizUserHistoryStore.java:104) at com.atlassian.jira.user.CachingUserHistoryStore$2.run(CachingUserHistoryStore.java:94) at com.atlassian.util.concurrent.ManagedLocks$ManagedLockImpl.withLock(ManagedLocks.java:333) at com.atlassian.jira.user.CachingUserHistoryStore.addHistoryItem(CachingUserHistoryStore.java:84) at com.atlassian.jira.user.SessionBasedAnonymousUserHistoryStore$2.run(SessionBasedAnonymousUserHistoryStore.java:120) at com.atlassian.util.concurrent.ManagedLocks$ManagedLockImpl.withLock(ManagedLocks.java:333) {noformat} h2. Cause If a user's name changes case and you are connected to a database that does case insensitive comparison (e.g. MSSQL 2008 as setup following the steps on https://confluence.atlassian.com/x/CpX2Cw). The most common way for a user's name to change is for it to change in an external user directory where case is important (e.g. some LDAP servers). h2. Steps * Setup JIRA to an LDAP directory. * Create a user with username "testuser" in the internal JIRA directory. * Login with username "testuser" * Go to the user's profile page. * Inside the LDAP directory, create a user "TestUser". * Move the LDAP directory to the top. * (BUG) Go to the current user's profile page. You will get the above exception.

    Atlassian JIRA | 4 years ago | Brenden Bain [Atlassian]
    com.atlassian.jira.exception.DataAccessException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:UserHistoryItem][id,10374][username,admin][data,null][entityId,admin][lastViewed,1350569188345][type,Assignee] (SQL Exception while executing the following:INSERT INTO jiraschema.userhistoryitem (ID, entitytype, entityid, USERNAME, lastviewed, data) VALUES (?, ?, ?, ?, ?, ?) (Cannot insert duplicate key row in object 'jiraschema.userhistoryitem' with unique index 'uh_type_user_entity'.))

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. com.atlassian.jira.exception.DataAccessException

      com.atlassian.jira.jql.parser.JqlParseException:com.atlassian.jira.jql.parser.antlr.RuntimeRecognitionException: MismatchedSetException(46!=null)

      at com.atlassian.jira.issue.search.OfBizSearchRequestStore.getSearchQueryFromGv()
    2. com.atlassian.jira
      TransformingEnclosedIterable.foreach
      1. com.atlassian.jira.issue.search.OfBizSearchRequestStore.getSearchQueryFromGv(OfBizSearchRequestStore.java:415)
      2. com.atlassian.jira.issue.search.OfBizSearchRequestStore.convertGVToRequest(OfBizSearchRequestStore.java:389)
      3. com.atlassian.jira.issue.search.OfBizSearchRequestStore.access$000(OfBizSearchRequestStore.java:48)
      4. com.atlassian.jira.issue.search.OfBizSearchRequestStore$1.get(OfBizSearchRequestStore.java:84)
      5. com.atlassian.jira.issue.search.OfBizSearchRequestStore$1.get(OfBizSearchRequestStore.java:82)
      6. com.atlassian.jira.ofbiz.DatabaseIterator.pullNext(DatabaseIterator.java:69)
      7. com.atlassian.jira.ofbiz.DatabaseIterator.populateNextIfNull(DatabaseIterator.java:78)
      8. com.atlassian.jira.ofbiz.DatabaseIterator.hasNext(DatabaseIterator.java:41)
      9. com.atlassian.jira.util.collect.CollectionUtil.foreach(CollectionUtil.java:41)
      10. com.atlassian.jira.util.collect.CloseableIterator$Functions.foreach(CloseableIterator.java:58)
      11. com.atlassian.jira.ofbiz.DatabaseIterable.foreach(DatabaseIterable.java:45)
      12. com.atlassian.jira.util.collect.TransformingEnclosedIterable.foreach(TransformingEnclosedIterable.java:29)
      12 frames
    3. com.atlassian.studio
      DefaultStudioImportManager.postImportStudify
      1. com.atlassian.studio.importer.DefaultStudioImportManager.updateGroupName(DefaultStudioImportManager.java:400)
      2. com.atlassian.studio.importer.DefaultStudioImportManager.postImportStudify(DefaultStudioImportManager.java:298)
      2 frames
    4. com.atlassian.jira
      StudioImport.doImport
      1. com.atlassian.jira.studio.importer.StudioImport.doImport(StudioImport.java:100)
      1 frame