Confluence throws JsonParseException when Updating Atlassian Secure Tunnel Plugin
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Updating Atlassian Secure Tunnel Plugin gets stuck and doesn't allow to update other Plugins. The stuck threads of Atlassian Secure Tunnel Plugin will not allow to update other plugins.
Diagnosis
While updating the Atlassian Secure Tunnel Plugin, the plugin update gets stuck and following error/exception is thrown in atlassian-confluence.log
2023-04-24 08:23:06,961 WARN [UpmAsynchronousTaskManager:thread-3] [tunnel.configuration.dao.EncryptingTunnelDao] deleteTunnelKey Could not delete token key
-- url: /rest/plugins/1.0/ | referer: https://wiki.abcd.com/plugins/servlet/upm | traceId: 554c5779409c3 | userName: admin
com.google.gson.JsonParseException: Expecting object found: "YlsMyoRm3uAlr8Z2tZ_emfj0eU-dJExLgyv-BCtg_Qbh-hA"
at com.google.gson.JsonObjectDeserializationVisitor.visitFieldUsingCustomHandler(JsonObjectDeserializationVisitor.java:100)
at com.google.gson.ReflectingFieldNavigator.visitFieldsReflectively(ReflectingFieldNavigator.java:63)
at com.google.gson.ObjectNavigator.accept(ObjectNavigator.java:120)
Additionally you will be able to see below error/exceptions in atlassian-confluence.log
2023-07-14 10:59:16,042 ERROR [Caesium-1-1] [tunnel.configuration.dao.EncryptingTunnelDao] decrypt Could not decrypt token
com.google.gson.JsonParseException: Expecting object found: "rO0ABXNyABlqYXZheC5jcnlwdG8uU2VhbGVkT2JqZWN0PjY9psdAACW0JbABBlbmNyeXB0ZWRDb250ZW50cQB+AAFMAAlwYXJhbXNBbGd0ABJMamF2YncQB+AAJ4cHVyAAJbQqzzF"
at com.google.gson.JsonObjectDeserializationVisitor.visitFieldUsingCustomHandler(JsonObjectDeserializationVisitor.java:100)
at com.google.gson.ReflectingFieldNavigator.visitFieldsReflectively(ReflectingFieldNavigator.java:63)
at com.google.gson.ObjectNavigator.accept(ObjectNavigator.java:120)
Cause
The exception/error are caused due to corrupted tokens for the Application Tunnel configured in Confluence.
Resolution
Regenerate the security key for impacted application tunnel. Please follow below steps
- Regenerate the security key in admin.atlassian.com. To generate the security key:
- Go to admin.atlassian.com.
- Go to Settings > Application tunnels.
- Next to your tunnel, select Actions > Regenerate security key.
- Go through the wizard to generate a new security key.
- Update the key in your self-managed instance. You can either choose to be redirected to your instance, or copy the key and give it to the admin of this instance so they can update it manually.