When GeoServer SQL Server stores won’t load on a new server

We’ve been migrating a large GeoServer instance onto a new Windows 2019 server. The old GeoServer instance was running version 2.7, the new one version 2.15.1. Nearly everything “just worked” after copying the old data directory into the new location, however several SQL Server stores didn’t appear.

This kind of thing was seen for each store in the GeoServer logs:

2020-06-01 13:26:43,677 WARN [org.geoserver] - Failed to load data store 'MyStoreName'
com.thoughtworks.xstream.converters.ConversionException:
---- Debugging information ----
cause-exception     : org.jasypt.exceptions.EncryptionOperationNotPossibleException
cause-message       : null
class               : org.geoserver.catalog.impl.DataStoreInfoImpl
required-type       : org.geoserver.catalog.impl.DataStoreInfoImpl
converter-type      : org.geoserver.config.util.XStreamPersister$StoreInfoConverter
line number         : 31
version             : 2.15.1
-------------------------------

First we verified that we could create a new SQL Server store using the GeoServer administrative interfaces – this proved that the plugin for SQL Server and the various driver files were installed and working correctly.

So why were the old stores not working? The store database connection for each store is defined in a file like this:

"D:\Geoserver_data_dir\workspaces\MyStoreName\MyStoreName\datastore.xml"

and in this file we find a line like this:

<entry key="passwd">crypt1:ywSBY9D+HjlxxL/SuRwBPVmT8P98f47M</entry>

The solution is to delete that line in the definition file for each store, then restart GeoServer. The stores then appear in the GeoServer admin pages, and you can edit each one to re-enter the password, after which any layers should be operational.

Comments

Jordy Moos

re: When GeoServer SQL Server stores won’t load on a new server

23 March 2022

We had the same issue, i think it is because some salt changed and the password is no longer valid.

As we have this in our docker development environment we changed it to plain password:

<entry key="passwd">plain:mypassword</entry>

Reinout van Rees

Same when changing IP addresses

07 June 2022

Thanks for the info, it helped me figure out why the database connections appeared to have disappeared after changing our server's IP address. I noticed the EncryptionOperationNotPossibleException. Apparently one of the things used to decrypt the stored passwords is the IP address.

Find out more