Error on atlas-debug server app - Database: JIRA couldn't connect to your database

Vladimir Yakimov
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 22, 2022

Hello everyone,

 

I'm trying atlas-debug for an existing JIRA plugin I have. Unfortunately, I'm getting:Screen Shot 2022-08-22 at 16.21.29.png

What I can find in atlassian-jira.log is:

2022-08-22 16:09:53,436+0300 main ERROR [c.a.config.bootstrap.DefaultAtlassianBootstrapManager] Couldn't open a connection on Datasource (java:comp/env/jdbc/JiraDS):
java.sql.SQLException: Cannot create PoolableConnectionFactory (General error: "java.lang.IllegalStateException: Unable to read the page at position 181694296676423 [1.4.200/6]" [50000-200])
at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:653)
at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:532)
at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:731)
at com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager.getTestDatasourceConnection(DefaultAtlassianBootstrapManager.java:327)
at com.atlassian.jira.config.database.JndiDatasource.getConnection(JndiDatasource.java:40)
at com.atlassian.jira.config.database.DatabaseConfig.testConnection(DatabaseConfig.java:89)
at com.atlassian.jira.health.checks.DbConfigurationAndConnectionCheck.doPerform(DbConfigurationAndConnectionCheck.java:60)
at com.atlassian.jira.health.HealthCheckTemplate.perform(HealthCheckTemplate.java:23)
at com.atlassian.jira.health.DefaultHealthCheckExecutor.runCheck(DefaultHealthCheckExecutor.java:76)
at com.atlassian.jira.health.DefaultHealthCheckExecutor.lambda$applyAndCollectExceptions$1(DefaultHealthCheckExecutor.java:55)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.Iterator.forEachRemaining(Iterator.java:116)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
at com.atlassian.jira.health.DefaultHealthCheckExecutor.applyAndCollectExceptions(DefaultHealthCheckExecutor.java:55)
at com.atlassian.jira.health.DefaultHealthCheckExecutor.performHealthChecks(DefaultHealthCheckExecutor.java:44)
at com.atlassian.jira.health.HealthChecks.executeChecksAndRecordResults(HealthChecks.java:164)
at com.atlassian.jira.health.HealthChecks.runHealthChecks(HealthChecks.java:154)
at com.atlassian.jira.health.HealthChecks.runHealthChecks(HealthChecks.java:66)
at com.atlassian.jira.startup.BootstrapContainerLauncher.start(BootstrapContainerLauncher.java:48)
at com.atlassian.jira.startup.DefaultJiraLauncher.preDbLaunch(DefaultJiraLauncher.java:115)
at com.atlassian.jira.startup.DefaultJiraLauncher.lambda$start$0(DefaultJiraLauncher.java:101)
at com.atlassian.jira.util.devspeed.JiraDevSpeedTimer.run(JiraDevSpeedTimer.java:31)
at com.atlassian.jira.startup.DefaultJiraLauncher.start(DefaultJiraLauncher.java:100)
at com.atlassian.jira.startup.LauncherContextListener.initSlowStuff(LauncherContextListener.java:154)
at com.atlassian.jira.startup.LauncherContextListener.initSlowStuffInBackground(LauncherContextListener.java:139)
at com.atlassian.jira.startup.LauncherContextListener.contextInitialized(LauncherContextListener.java:101)
... 8 filtered
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
... 12 filtered
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
... 11 filtered
at java.lang.reflect.Method.invoke(Method.java:498)
... 2 filtered
Caused by: org.h2.jdbc.JdbcSQLNonTransientException: General error: "java.lang.IllegalStateException: Unable to read the page at position 181694296676423 [1.4.200/6]" [50000-200]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:505)
at org.h2.message.DbException.getJdbcSQLException(DbException.java:429)
at org.h2.message.DbException.get(DbException.java:194)
at org.h2.message.DbException.convert(DbException.java:347)
at org.h2.engine.Database.openDatabase(Database.java:333)
... 2 filtered
at org.h2.engine.Engine.openSession(Engine.java:74)
at org.h2.engine.Engine.openSession(Engine.java:192)
at org.h2.engine.Engine.createSessionAndValidate(Engine.java:171)
at org.h2.engine.Engine.createSession(Engine.java:166)
at org.h2.engine.Engine.createSession(Engine.java:29)
at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:340)
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:173)
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:152)
at org.h2.Driver.connect(Driver.java:69)
at org.apache.tomcat.dbcp.dbcp2.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:52)
at org.apache.tomcat.dbcp.dbcp2.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:415)
at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSource.java:111)
at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:649)
... 73 more
Caused by: java.lang.IllegalStateException: Unable to read the page at position 181694296676423 [1.4.200/6]
at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:950)
at org.h2.mvstore.MVStore.readPage(MVStore.java:2213)
at org.h2.mvstore.MVMap.readPage(MVMap.java:672)
at org.h2.mvstore.MVMap.readOrCreateRootPage(MVMap.java:688)
at org.h2.mvstore.MVMap.setRootPos(MVMap.java:682)
at org.h2.mvstore.MVStore.openMap(MVStore.java:535)
at org.h2.mvstore.MVStore.openMap(MVStore.java:516)
at org.h2.mvstore.MVStore.removeMap(MVStore.java:2742)
at org.h2.engine.Database.handleUpgradeIssues(Database.java:866)
at org.h2.engine.Database.open(Database.java:742)
at org.h2.engine.Database.openDatabase(Database.java:307)
... 87 more
Caused by: java.lang.IllegalStateException: Unsupported type 17 [1.4.200/3]
at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:950)
at org.h2.mvstore.type.ObjectDataType.newType(ObjectDataType.java:165)
at org.h2.mvstore.type.ObjectDataType.read(ObjectDataType.java:229)
at org.h2.mvstore.type.ObjectDataType.read(ObjectDataType.java:114)
at org.h2.mvstore.Page.read(Page.java:605)
at org.h2.mvstore.MVStore.readPage(MVStore.java:2211)
... 97 more
2022-08-22 16:09:53,489+0300 main ERROR [c.a.jira.health.HealthChecks] JIRA couldn't connect to your database
2022-08-22 16:09:53,489+0300 main ERROR [c.a.jira.health.HealthChecks] JIRA failed to establish a connection to your database.
This could be because:
- Your database isn't running
- The configuration of your dbconfig.xml file is incorrect (user, password, or database URL etc.)
- There is a network issue between JIRA and your database (e.g. firewall, database doesn't allow remote access etc.)

There are several other solutions you can try, review our documentation and see what works for you.

no other error written. Any ideas anyone?

2 answers

1 vote
alexey
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 22, 2022

@Vladimir Yakimov It seems you have next in your pom.xml

<productDataPath>${basedir}/src/test/resources/generated-test-resources.zip</productDataPath>

 Which you added according to https://developer.atlassian.com/server/framework/atlassian-sdk/create-test-data-and-a-test-fixture/ but it was generated for the previous versions of H2.

After we remove it we were able to start Jira using atlas-debug

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 22, 2022

Welcome to the Atlassian Community!

The possible faults in the error message are all valid things that could cause this, but there is another one that is not listed.

You are using an h2 database.  This is a file and memory based database that is Atlassian use to get stuff up and running quickly when you're using a throw-away system.  It means you don't have to set up a proper database server every time you want to do a bit of development, a demo, or a quick test.

H2 databases are unsuitable for any system that you're not going to throw away in a few days.

They do not scale, and they have little fault tolerance.  If you've got a large Jira, or run out of memory, or you kill the Jira process without shutting it down, the database will fail, and it will fail catastrophically.  It's also prone to random corruptions that won't quite destroy it, but render it pretty much useless.

I suspect you've had a total failure.  

Your choices are to go look for a backup (either of the database files, or the regular XML files), or start clean.  (If you have a backup, you'll need to start with a clean install and restore the backup into it)

Vladimir Yakimov {Appfire}
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 24, 2022

Thanks @Nic Brough -Adaptavist- 

 

In my case the failure is on the very first start after building the app. So the h2 db is supposed to be created upon atlas-debug, so nothing to restore there. Or am I missing something? Furthermore for a quick debug h2 should be fine.

 

Regards,

Vladimir

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 24, 2022

Yes, h2 is suitable for that, but it can fail at the point of creation!

Try deleting (well, moving to a safe place), the files under the jira home directory in the "database" directory.  This should make Jira try to recreate clean h2 files.

alexey
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 19, 2022

@Nic Brough -Adaptavist- 

Hi,

We are trying to migrate our plugin to Jira 9.x. And it's a big problem to debug it using: atlas-clean && atlas-debug

It works for Jira 8.x but not for Jira 9.x

Following error looks like misconfiguration between H2 driver and configuration XML db files 

Caused by: java.lang.IllegalStateException: Unsupported type 17 [1.4.200/3]

Jira 8.x has h2 version = 1.4.185, Jira 9.x has h2 version = 1.4.200


Could you provide any advise how to start Jira 9.x using atlas-debug.

Thanks,
Alexey

P.S. atlas-run-standalone starts Jira 9.x without any issues.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 20, 2022

I don't know why that might be happening, I've not tried to debug anything in Jira 9 code yet (the code I have looked at could be tested in standalone, it didn't need debugging at that level)

Suggest an answer

Log in or Sign up to answer