It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Type error while importing Mantis to Jira

I am in the process of migrating our Mantis issue database (v2.12.0) into Jira Server (v8.3.3), but the import is failing on every attempt. Both Mantis and Jira are running on PostGres. The error seems to occur during the Component import step and is caused by some sort of type mismatch, but no information is given as to what is actually causing the error. This error results in no issues being created for the project. I have been unable to find any info on this error online,  so hopefully someone can provide some help with this as it is blocking our transition to Jira.

The full error log is as follows (with project/user names replaced):

2019-09-13 15:03:23,408 INFO - Import started by user using com.atlassian.jira.plugins.importer.imports.mantis.MantisDataBean
2019-09-13 15:03:23,411 INFO - ------------------------------
2019-09-13 15:03:23,411 INFO - Importing: Users
2019-09-13 15:03:23,411 INFO - ------------------------------
2019-09-13 15:03:23,411 INFO - Only new items will be imported
2019-09-13 15:03:23,451 INFO - 78 users associated with import. All of them imported as inactive, this can be changed after import in User Access step.
2019-09-13 15:03:23,451 INFO - ------------------------------
2019-09-13 15:03:23,451 INFO - Finished Importing : Users
2019-09-13 15:03:23,451 INFO - ------------------------------
2019-09-13 15:03:23,451 INFO - 0 users successfully created.
2019-09-13 15:03:23,451 INFO - Retrieving projects...
2019-09-13 15:03:23,451 INFO - Project ExternalProject{id='31', key='TES', externalName='Test', name='Test'} exists and found correctly.
2019-09-13 15:03:23,467 INFO - ------------------------------
2019-09-13 15:03:23,467 INFO - Importing: Versions
2019-09-13 15:03:23,467 INFO - ------------------------------
2019-09-13 15:03:23,467 INFO - Only new items will be imported
2019-09-13 15:03:23,474 INFO - Importing version 1.0
2019-09-13 15:03:23,477 INFO - ------------------------------
2019-09-13 15:03:23,477 INFO - Finished Importing : Versions
2019-09-13 15:03:23,477 INFO - ------------------------------
2019-09-13 15:03:23,477 INFO - ------------------------------
2019-09-13 15:03:23,477 INFO - Importing: Components
2019-09-13 15:03:23,477 INFO - ------------------------------
2019-09-13 15:03:23,477 INFO - Only new items will be imported
2019-09-13 15:03:23,480 ERROR - Unexpected failure occurred. Importer will stop immediately. Data may be in an unstable state
com.atlassian.jira.plugins.importer.SQLRuntimeException: ERROR: operator does not exist: boolean = integer
  Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
  Position: 213
	at com.atlassian.jira.plugins.importer.web.JdbcConnection.queryDb(JdbcConnection.java:187)
	at com.atlassian.jira.plugins.importer.web.JdbcConnection.queryDb(JdbcConnection.java:150)
	at com.atlassian.jira.plugins.importer.imports.mantis.MantisDataBean.getComponents(MantisDataBean.java:92)
	at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.importComponents(DefaultJiraDataImporter.java:721)
	at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.doImport(DefaultJiraDataImporter.java:374)
	at com.atlassian.jira.plugins.importer.imports.importer.impl.ImporterCallable.call(ImporterCallable.java:26)
	at com.atlassian.jira.plugins.importer.imports.importer.impl.ImporterCallable.call(ImporterCallable.java:15)
	at com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:537)
	at com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:495)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at com.atlassian.jira.task.ForkedThreadExecutor$ForkedRunnableDecorator.run(ForkedThreadExecutor.java:216)
	at java.lang.Thread.run(Thread.java:748)
Caused by: org.postgresql.util.PSQLException: ERROR: operator does not exist: boolean = integer
  Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
  Position: 213
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2455)
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2155)
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:288)
	at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:430)
	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:356)
	at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:168)
	at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:116)
	at com.atlassian.jira.plugins.importer.web.JdbcConnection.queryDb(JdbcConnection.java:167)
	... 13 more
2019-09-13 15:03:23,481 INFO - No issues need to be reindexed.

 

Any help is greatly appreciated.

1 answer

1 accepted

0 votes
Answer accepted

After a lot of digging I managed to solve this so I'm going to leave the solution here for anyone else who has the same issue.

What I discovered is that at some point between Mantis 1.2.0 and 2.23 the database schema was updated and a couple table columns were converted to  booleans from integers (more info on the mantis db schemas can be found here and here). The specific column that caused the problem was `mantis_project_table.inherit_global`. The importer plugin wanted the value to be a an integer, but as the database was newer it was in fact a boolean. As a side note the error provided in the log is rather confusing as the order of the types seems to be backwards compared to what you would expect.

The fix was relatively easy, I simply made a copy of the database to use for importing and ran the following commands to convert the database to the correct format:

ALTER TABLE mantis_project_table ALTER COLUMN inherit_global DROP DEFAULT;
ALTER TABLE mantis_project_table ALTER COLUMN inherit_global TYPE integer USING CASE WHEN inherit_global=TRUE THEN 1 ELSE 0 END;
ALTER TABLE mantis_project_table ALTER COLUMN inherit_global SET DEFAULT 0;

 This fixed the issue and allowed me to successfully import the mantis data.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira

The add-in you’ve been waiting for: Jira Cloud for Excel 🙌

Introducing Jira Cloud for Excel Here at the product integrations team at Atlassian, we are thrilled to announce the new Jira Cloud for Excel add-in! This add-in lets you export Jira data directly ...

881 views 7 24
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you