This happens if the database is encrypted and the plugin requires a callback to get the key (instead of using a server-local encryption key).
If configured to use a callback to obtain the encryption key, during the attach phase, Firebird will send a packet with operation code op_crypt_key_callback
(= 97) (and plugin specific data) to the client, and the client in turn should respond to that with the encryption key (or at least, with plugin specific data that the plugin can use to derive the encryption key).
Jaybird versions before 3.0.4 do not support handling of encryption key callbacks (operation code 97), so this error occurs.
Basic support to pass a fixed response to an encryption key callback has been introduced in Jaybird 3.0.4. For earlier versions, if you can't upgrade, the workaround would be to use a server-local encryption key.
Solution
The solution is to upgrade Jaybird to Jaybird 3.0.4, which introduced support for database encryption callbacks. If the encryption plugin performs a callback, but doesn't actually need to use the content of the response, then it will work out of the box.
It the encryption plugin needs a reply with the key, you can set the key in the dbCryptConfig
connection property. You can either use a base64 encoded value by prefixing it with base64:
or a string key, which will be converted to bytes using UTF-8 encoding.
For example in a connection string:
jdbc:firebirdsql://localhost/appdbalias?dbCryptConfig=base64:dmVyeXNlY3JldGtleQ==
or
jdbc:firebirdsql://localhost/appdbalias?dbCryptConfig=verysecretkey
The implementation currently does not support more advanced callbacks.
Jaybird 3.0.4 (or higher) can be downloaded from https://www.firebirdsql.org/en/jdbc-driver/
See Jaybird 3.0.x release notes, section Database encryption support for more information.
Workaround
NOTE Only use this workaround if you can't yet upgrade to Jaybird 3.0.4 or higher.
According to the instructions on https://www.ibphoenix.com/products/software/encryptionplugin you can configure a server-local key by using KeyHolderPlugin = KeyFile
instead of KeyHolderPlugin = Callback
.
Unfortunately, this doesn't work. It looks like the plugin in question is unconditionally performing a callback to the client, even if it has the necessary data available locally. This is possibly a bug in this encryption plugin, or maybe a deliberate design decision.
IBPhoenix has released a new version of this plugin, version 1.2.1, which allows you to disable this callback with an explicit setting in plugins/KeyFile.conf
with setting DisableCallback = true
.