Replying to a message from: Mr Dan

Hi all,

I host my email on a QNAP device - an app upgrade was available, so I updated it!

This moved the app from v7 to v8.3 however I had Xeams had been updating itself, so I have actually already been on 8.4 since release (6232).

After the app updated - the FrontController splash screen appeared as if setting up the server from new.

Looking on the cli all files are still there but the Xeams.log output shows the following:

2022-11-06 16:25:52,208 INFO xeams.ServerStarter - ---------------------------------------------------
2022-11-06 16:25:52,242 INFO xeams.ServerStarter - Starting server. Current directory = /share/CACHEDEV1_DATA/.qpkg/Xeams. Time = 11/6/22 4:25 PM. Build number: 6232 on Linux
2022-11-06 16:25:54,344 INFO xeams.f - SSLProtocols: SSLv2Hello,TLSv1,TLSv1.1,TLSv1.2
2022-11-06 16:25:54,345 INFO xeams.f - Keystore type: JKS
2022-11-06 16:25:57,693 INFO filter.SynaFilter - Initializing SynaFilter
2022-11-06 16:25:57,860 INFO xeams.g - Web server started on port(s): 5272, 5373
2022-11-06 16:25:59,203 INFO db.ha - Database server successfully started.
2022-11-06 16:26:00,186 ERROR db.ha - Unable to connect to Database. DERBY SQL error: SQLCODE: -1, SQLSTATE: XJ040, SQLERRMC: Failed to start database 'xeamsDB', see the next exception for details.::SQLSTATE: XSLANDatabase at /share/CACHEDEV1_DATA/.qpkg/Xeams/db/xeamsDB has an incompatible format with the current version of the software. The database was created by or upgraded by version 10.8.
java.sql.SQLException: DERBY SQL error: SQLCODE: -1, SQLSTATE: XJ040, SQLERRMC: Failed to start database 'xeamsDB', see the next exception for details.::SQLSTATE: XSLANDatabase at /share/CACHEDEV1_DATA/.qpkg/Xeams/db/xeamsDB has an incompatible format with the current version of the software. The database was created by or upgraded by version 10.8.
at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown Source)
at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
at org.apache.derby.jdbc.ClientDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at com.synametrics.commons.util.y.b.D(ConnectionPool.java:168)
at com.synametrics.commons.util.y.b.<init>(ConnectionPool.java:158)
at com.synametrics.commons.util.y.b.E(ConnectionPool.java:106)
at com.synametrics.xeams.db.ha.E(DBConfigurator.java:56)
at com.synametrics.xeams.db.ha.<init>(DBConfigurator.java:26)
at com.synametrics.xeams.db.ha.E(DBConfigurator.java:35)
at com.synametrics.xeams.ServerStarter.E(ServerStarter.java:443)
at com.synametrics.xeams.ServerStarter.main(ServerStarter.java:158)
Caused by: org.apache.derby.client.am.SqlException: DERBY SQL error: SQLCODE: -1, SQLSTATE: XJ040, SQLERRMC: Failed to start database 'xeamsDB', see the next exception for details.::SQLSTATE: XSLANDatabase at /share/CACHEDEV1_DATA/.qpkg/Xeams/db/xeamsDB has an incompatible format with the current version of the software. The database was created by or upgraded by version 10.8.
at org.apache.derby.client.am.Connection.completeSqlca(Unknown Source)
at org.apache.derby.client.net.NetConnectionReply.parseRdbAccessFailed(Unknown Source)
at org.apache.derby.client.net.NetConnectionReply.parseAccessRdbError(Unknown Source)
at org.apache.derby.client.net.NetConnectionReply.parseACCRDBreply(Unknown Source)
at org.apache.derby.client.net.NetConnectionReply.readAccessDatabase(Unknown Source)
at org.apache.derby.client.net.NetConnection.readSecurityCheckAndAccessRdb(Unknown Source)
at org.apache.derby.client.net.NetConnection.flowSecurityCheckAndAccessRdb(Unknown Source)
at org.apache.derby.client.net.NetConnection.flowUSRIDPWDconnect(Unknown Source)
at org.apache.derby.client.net.NetConnection.flowConnect(Unknown Source)
at org.apache.derby.client.net.NetConnection.<init>(Unknown Source)
at org.apache.derby.client.net.NetConnection40.<init>(Unknown Source)
at org.apache.derby.client.net.ClientJDBCObjectFactoryImpl40.newNetConnection(Unknown Source)
... 11 more
2022-11-06 16:26:00,297 INFO xeams.rulesengine - Good folder is: /share/CACHEDEV1_DATA/.qpkg/Xeams/GoodEmails
2022-11-06 16:26:00,298 INFO xeams.rulesengine - Spam folder is: /share/CACHEDEV1_DATA/.qpkg/Xeams/SpamEmails
2022-11-06 16:26:00,298 INFO xeams.rulesengine - Possible spam folder is: /share/CACHEDEV1_DATA/.qpkg/Xeams/PossibleSpams
2022-11-06 16:26:09,503 INFO custom.AntiPhishingUpdate - Fetching AntiPhishing files
2022-11-06 16:26:10,582 INFO xeams.ServerStarter - Profile 1 initialized.
2022-11-06 16:26:10,699 INFO util.F - SMTP Queue thread successfully started
2022-11-06 16:27:01,659 ERROR servlet.FrontController - Unable to get a database connection after waiting for 40 seconds. 

So, it looks like the database is erroring and therefore causing the issues.

I am now unable to connect to the IMAP server, I get authentication errors.

Anyone any ideas how to resolve this? Worse case I would like to get my emails and migrate to a new instance of Xeams. 

Email folders are intact but reading the mail they are encrypted. Is the decryption key stored in the database?

Can I access the db and fix the errors manually?

Any help would be gratefully received.

Thanks