How do I manually delete a trusted application link from Stash?

I am trying to set up an Application Link between Stash and Jira. I was having some SSL issues with these links, but now I've gotten all my keys straightened out, and I'm able to create a link between the two applications.

However, when I edit my link to JIRA from the Stash settings and try to configure the link from Stash to Jira to use Trusted Applications, I get a 500 error.

From the log the error is:

2015-03-11 15:00:12,437 ERROR [http-nio-5443-exec-6] @OG1X23x900x1535x0 e7xtqt "GET /mvc/error500 HTTP/1.1" c.a.s.i.web.ErrorPageController There was an unhandled exception loading [/plugins/servlet/applinks/auth/conf/trusted/inbound-non-ual/8bcc7f6c-e699-319e-9ae7-ad3eb0a23965]
com.atlassian.stash.exception.DataStoreException: A database error has occurred.
at com.atlassian.stash.internal.aop.ExceptionRewriteAdvice.afterThrowing( ~[stash-platform-3.7.0.jar:na]
at com.atlassian.applinks.core.auth.trusted.ProviderConfigurationServlet.render( ~[na:na]
at com.atlassian.applinks.core.auth.trusted.ProviderConfigurationServlet.doGet( ~[na:na]
at com.atlassian.applinks.ui.AbstractApplinksServlet.service( ~[na:na]
at com.atlassian.applinks.ui.auth.AdminFilter.doFilter( ~[na:na]
at ~[na:na]
at com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent( ~[sitemesh-2.5-atlassian-10.jar:na]
at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter( ~[sitemesh-2.5-atlassian-10.jar:na]
at ~[StashAuthenticationFilter.class:na]
at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doInsideSpringSecurityChain( ~[BeforeLoginPluginAuthenticationFilter.class:na]
at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter( ~[BeforeLoginPluginAuthenticationFilter.class:na]
at ~[atlassian-trusted-apps-core-3.0.8.jar:na]
at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter( ~[na:na]
at ~[na:na]
at ~[na:na]
at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doBeforeBeforeLoginFilters( ~[BeforeLoginPluginAuthenticationFilter.class:na]
at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter( ~[BeforeLoginPluginAuthenticationFilter.class:na]
at com.atlassian.stash.internal.request.DefaultRequestManager.doAsRequest( ~[stash-service-impl-3.7.0.jar:na]
at com.atlassian.stash.internal.hazelcast.ConfigurableWebFilter.doFilter( ~[ConfigurableWebFilter.class:na]
at net.bull.javamelody.MonitoringFilter.doFilter( ~[jira-javamelody-1.53.0.jar:na]
at net.bull.javamelody.MonitoringFilter.doFilter( ~[jira-javamelody-1.53.0.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.7.0_17]
at Source) [na:1.7.0_17]
... 205 frames trimmed
Caused by: org.hibernate.NonUniqueResultException: query did not return a unique result: 2
at org.hibernate.internal.AbstractQueryImpl.uniqueElement( ~[hibernate-core-4.3.6.Final.jar:4.3.6.Final]
at org.hibernate.internal.AbstractQueryImpl.uniqueResult( ~[hibernate-core-4.3.6.Final.jar:4.3.6.Final]
at com.atlassian.stash.internal.auth.trusted.HibernateTrustedApplicationDao.getByApplicationId( ~[stash-dao-impl-3.7.0.jar:na]
at com.atlassian.stash.internal.auth.trusted.TrustedApplicationsManagerImpl.getTrustedApplication( ~[stash-service-impl-3.7.0.jar:na]
... 23 common frames omitted


If I delete the application link from Stash, I get a message that says:

There are existing Trusted Applications or OAuth relationships that should be upgraded to Application Links. Click here to upgrade.

When I follow the link to upgrade I see a list with two items:

Trusted Applications Certificate jira:10909871 Upgrade to Application Link | Delete
Trusted Applications Certificate jira:10909871 Upgrade to Application Link | Delete

But if I attempt to delete either one of them I get:

Failed to delete orphaned trust certificate: A database error has occurred.

I assume there's some corrupted or old data in Stash's database that's causing these problems, but I haven't been able to find any info on manually deleting application links from stash. I found an article on deleting links from jira, but the tables are sufficiently different that it can't be easily translated to stash.

1 answer

0 votes

Hello Nathan,

Thank you for your question.

Please, refer to Errors from trusted application link or Unable to delete application link for further information.

If you find this answer useful, I would kindly ask you to accept it so the same will be visible to others who might be facing the same issue you have inquired.

Thank you for your understanding.

Kind regards,
Rafael P. Sperafico
Atlassian Support

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 14, 2019 in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder :  #!/bin/bash source "$(dirname "$0")/" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

274 views 0 12
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you