com.atlassian.jira.util.dbc.Assertions$BlankStringArgumentException: names[0] should not be empty!

Atlassian JIRA | Brenden Bain [Atlassian] | 7 years ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    Trying to import data into JIRA that contains a custom field with no name (i.e. "") will clause the following exception to trigger: {code} com.atlassian.jira.util.dbc.Assertions$BlankStringArgumentException: names[0] should not be empty! at com.atlassian.jira.util.dbc.Assertions.containsNoBlanks(Assertions.java:112) at com.atlassian.jira.issue.search.ClauseNames.<init>(ClauseNames.java:42) at com.atlassian.jira.issue.search.ClauseNames.<init>(ClauseNames.java:36) at com.atlassian.jira.issue.search.ClauseNames.forCustomField(ClauseNames.java:71) at com.atlassian.jira.issue.fields.CustomFieldImpl.getClauseNames(CustomFieldImpl.java:281) at com.atlassian.jira.issue.customfields.searchers.TextSearcher.init(TextSearcher.java:62) at com.atlassian.jira.issue.customfields.searchers.TextSearcher.init(TextSearcher.java:33) at com.atlassian.jira.issue.fields.CustomFieldImpl.getCustomFieldSearcher(CustomFieldImpl.java:1502) at com.atlassian.jira.issue.fields.CustomFieldImpl.createAssociatedSearchHandler(CustomFieldImpl.java:615) at com.atlassian.jira.issue.search.managers.DefaultSearchHandlerManager$SearchHandlerIndexer.indexSearchableField(DefaultSearchHandlerManager.java:448) at com.atlassian.jira.issue.search.managers.DefaultSearchHandlerManager$SearchHandlerIndexer.indexCustomField(DefaultSearchHandlerManager.java:435) at com.atlassian.jira.issue.search.managers.DefaultSearchHandlerManager.getHelper(DefaultSearchHandlerManager.java:235) at com.atlassian.jira.issue.search.managers.DefaultSearchHandlerManager.getAllSearchers(DefaultSearchHandlerManager.java:202) at com.atlassian.jira.issue.search.managers.DefaultIssueSearcherManager.getAllSearchers(DefaultIssueSearcherManager.java:27) at com.atlassian.jira.issue.index.managers.FieldIndexerManagerImpl.init(FieldIndexerManagerImpl.java:68) at com.atlassian.jira.issue.index.managers.FieldIndexerManagerImpl.<init>(FieldIndexerManagerImpl.java:51) {code} This came from a customer's data. I have no idea how they got a custom field with no name. Anyways, I think we should simply issue a warning and register the field using its 'cf[xxxx]' name. Might need to test what other parts of JIRA actually expect the custom field name to be > 0.

    Atlassian JIRA | 7 years ago | Brenden Bain [Atlassian]
    com.atlassian.jira.util.dbc.Assertions$BlankStringArgumentException: names[0] should not be empty!
  2. 0

    h3. Summary Trying to import data into JIRA that contains a custom field with no name (i.e. "") fails with an exception. h3. Steps to Reproduce # Create an XML backup, and remove the name of a custom field. # Attempt to import it. h3. Expected Results # The importer provides an error about the data. h3. Actual Results The below exception is thrown: {noformat} com.atlassian.jira.util.dbc.Assertions$BlankStringArgumentException: names[0] should not be empty! at com.atlassian.jira.util.dbc.Assertions.containsNoBlanks(Assertions.java:112) at com.atlassian.jira.issue.search.ClauseNames.<init>(ClauseNames.java:42) at com.atlassian.jira.issue.search.ClauseNames.<init>(ClauseNames.java:36) at com.atlassian.jira.issue.search.ClauseNames.forCustomField(ClauseNames.java:71) at com.atlassian.jira.issue.fields.CustomFieldImpl.getClauseNames(CustomFieldImpl.java:281) at com.atlassian.jira.issue.customfields.searchers.TextSearcher.init(TextSearcher.java:62) at com.atlassian.jira.issue.customfields.searchers.TextSearcher.init(TextSearcher.java:33) at com.atlassian.jira.issue.fields.CustomFieldImpl.getCustomFieldSearcher(CustomFieldImpl.java:1502) at com.atlassian.jira.issue.fields.CustomFieldImpl.createAssociatedSearchHandler(CustomFieldImpl.java:615) at com.atlassian.jira.issue.search.managers.DefaultSearchHandlerManager$SearchHandlerIndexer.indexSearchableField(DefaultSearchHandlerManager.java:448) at com.atlassian.jira.issue.search.managers.DefaultSearchHandlerManager$SearchHandlerIndexer.indexCustomField(DefaultSearchHandlerManager.java:435) at com.atlassian.jira.issue.search.managers.DefaultSearchHandlerManager.getHelper(DefaultSearchHandlerManager.java:235) at com.atlassian.jira.issue.search.managers.DefaultSearchHandlerManager.getAllSearchers(DefaultSearchHandlerManager.java:202) at com.atlassian.jira.issue.search.managers.DefaultIssueSearcherManager.getAllSearchers(DefaultIssueSearcherManager.java:27) at com.atlassian.jira.issue.index.managers.FieldIndexerManagerImpl.init(FieldIndexerManagerImpl.java:68) at com.atlassian.jira.issue.index.managers.FieldIndexerManagerImpl.<init>(FieldIndexerManagerImpl.java:51) {noformat} h3. Workaround Perform the workaround in the instance that has the problematic data in it. # Identify the problem record with the below SQL: {code:SQL} select * from customfield where cfname is null or cfname = ''; {code} # Backup the JIRA instance. # Stop JIRA. # Update the field with the below: {code:SQL} update customfield set cfname = '<give me a name>' where id = <id from step 1>; {code} # Start JIRA. # Attempt a reindex. If this proceeds, the data can be exported and then imported into the target instance.

    Atlassian JIRA | 7 years ago | Brenden Bain [Atlassian]
    com.atlassian.jira.util.dbc.Assertions$BlankStringArgumentException: names[0] should not be empty!

    Root Cause Analysis

    1. com.atlassian.jira.util.dbc.Assertions$BlankStringArgumentException

      names[0] should not be empty!

      at com.atlassian.jira.util.dbc.Assertions.containsNoBlanks()
    2. com.atlassian.jira
      FieldIndexerManagerImpl.<init>
      1. com.atlassian.jira.util.dbc.Assertions.containsNoBlanks(Assertions.java:112)
      2. com.atlassian.jira.issue.search.ClauseNames.<init>(ClauseNames.java:42)
      3. com.atlassian.jira.issue.search.ClauseNames.<init>(ClauseNames.java:36)
      4. com.atlassian.jira.issue.search.ClauseNames.forCustomField(ClauseNames.java:71)
      5. com.atlassian.jira.issue.fields.CustomFieldImpl.getClauseNames(CustomFieldImpl.java:281)
      6. com.atlassian.jira.issue.customfields.searchers.TextSearcher.init(TextSearcher.java:62)
      7. com.atlassian.jira.issue.customfields.searchers.TextSearcher.init(TextSearcher.java:33)
      8. com.atlassian.jira.issue.fields.CustomFieldImpl.getCustomFieldSearcher(CustomFieldImpl.java:1502)
      9. com.atlassian.jira.issue.fields.CustomFieldImpl.createAssociatedSearchHandler(CustomFieldImpl.java:615)
      10. com.atlassian.jira.issue.search.managers.DefaultSearchHandlerManager$SearchHandlerIndexer.indexSearchableField(DefaultSearchHandlerManager.java:448)
      11. com.atlassian.jira.issue.search.managers.DefaultSearchHandlerManager$SearchHandlerIndexer.indexCustomField(DefaultSearchHandlerManager.java:435)
      12. com.atlassian.jira.issue.search.managers.DefaultSearchHandlerManager.getHelper(DefaultSearchHandlerManager.java:235)
      13. com.atlassian.jira.issue.search.managers.DefaultSearchHandlerManager.getAllSearchers(DefaultSearchHandlerManager.java:202)
      14. com.atlassian.jira.issue.search.managers.DefaultIssueSearcherManager.getAllSearchers(DefaultIssueSearcherManager.java:27)
      15. com.atlassian.jira.issue.index.managers.FieldIndexerManagerImpl.init(FieldIndexerManagerImpl.java:68)
      16. com.atlassian.jira.issue.index.managers.FieldIndexerManagerImpl.<init>(FieldIndexerManagerImpl.java:51)
      16 frames