Xeams Upgrade DB and Connection Errors Mr Dan
    Xeams Upgrade DB and Connection Errors Synametrics Support
        Xeams Upgrade DB and Connection Errors Mr Dan
            Xeams Upgrade DB and Connection Errors Synametrics Support
                Xeams Upgrade DB and Connection Errors Mr Dan
                    Xeams Upgrade DB and Connection Errors Conny

From: Mr Dan
Date: 11/6/22 1:25 PM
Topic: Xeams Upgrade DB and Connection Errors
Type: General Discussions
Post a follow up

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

Top

From: Synametrics Support
Date: 11/7/22 9:22 AM
Topic: Xeams Upgrade DB and Connection Errors
Type: General Discussions
Post a follow up

Hi there,

By default, Xeams keeps a backup of your config files for the past 7 days. Please try the following:

1. Stop Xeams server first by clicking stop in the App Center.

2. SSH into your QNAP. Go to your config folder of Xeams. This should be /share/CACHEDEV1_DATA/.qpkg/Xeams/config on your end.

3. In your config directory, there should be a folder named archives. In here, you should see 7 days of backup config files.

4. Create a current backup of all of your files in your current config directory

5. Next, extract the oldest .zip file in your archives, then move all the files to the config directory.

6. Start Xeams again in the App Center.

Top

From: Mr Dan
Date: 11/7/22 12:57 PM
Topic: Xeams Upgrade DB and Connection Errors
Type: General Discussions
Post a follow up

Hey,

Thanks for this, I restored back the config, however the database errors are still there.

xeamsDB has an incompatible format with the current version of the software.

The db sits outside the config from what I can tell

The system sits in a not running state for a long time and doesn't process emails.

Is there any backup from the database as thats what looks like the crux of the problem is!

Thanks again for helping 😊

Top

From: Synametrics Support
Date: 11/7/22 1:06 PM
Topic: Xeams Upgrade DB and Connection Errors
Type: General Discussions
Post a follow up

Hi Dan,

Could you please try the following:

1. Stop Xeams service in App Center.

2. Go to your installation directory of Xeams. Rename the db folder to something else (like dbold)

3. Start Xeams again. Xeams will re-build the database.

If you are still having issues, please send us an email to support@synametrics.com so that we can further troubleshoot the issue.

Top

From: Mr Dan
Date: 11/8/22 1:21 PM
Topic: Xeams Upgrade DB and Connection Errors
Type: General Discussions
Post a follow up

Amazing - thank you! This has fixed it for me :)

Thanks again for the help!!

Top

From: Conny
Date: 4/22/24 5:54 PM
Topic: Xeams Upgrade DB and Connection Errors
Type: General Discussions
Post a follow up

Just had the same problem after the upgrade to 8.4. on QNAP QTS 5.0.1

Renaming the /db directory fixed it for me 

THANK YOU !

 
Top