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 10.8.146.19 "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(ExceptionRewriteAdvice.java:41) ~[stash-platform-3.7.0.jar:na]
at com.atlassian.applinks.core.auth.trusted.ProviderConfigurationServlet.render(ProviderConfigurationServlet.java:320) ~[na:na]
at com.atlassian.applinks.core.auth.trusted.ProviderConfigurationServlet.doGet(ProviderConfigurationServlet.java:134) ~[na:na]
at com.atlassian.applinks.ui.AbstractApplinksServlet.service(AbstractApplinksServlet.java:159) ~[na:na]
at com.atlassian.applinks.ui.auth.AdminFilter.doFilter(AdminFilter.java:60) ~[na:na]
at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:25) ~[na:na]
at com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:181) ~[sitemesh-2.5-atlassian-10.jar:na]
at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:85) ~[sitemesh-2.5-atlassian-10.jar:na]
at com.atlassian.stash.internal.spring.security.StashAuthenticationFilter.doFilter(StashAuthenticationFilter.java:86) ~[StashAuthenticationFilter.class:na]
at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doInsideSpringSecurityChain(BeforeLoginPluginAuthenticationFilter.java:111) ~[BeforeLoginPluginAuthenticationFilter.class:na]
at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:77) ~[BeforeLoginPluginAuthenticationFilter.class:na]
at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:100) ~[atlassian-trusted-apps-core-3.0.8.jar:na]
at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:79) ~[na:na]
at com.atlassian.analytics.client.filter.DefaultAnalyticsFilter.doFilter(DefaultAnalyticsFilter.java:32) ~[na:na]
at com.atlassian.analytics.client.filter.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:32) ~[na:na]
at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doBeforeBeforeLoginFilters(BeforeLoginPluginAuthenticationFilter.java:89) ~[BeforeLoginPluginAuthenticationFilter.class:na]
at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:75) ~[BeforeLoginPluginAuthenticationFilter.class:na]
at com.atlassian.stash.internal.request.DefaultRequestManager.doAsRequest(DefaultRequestManager.java:85) ~[stash-service-impl-3.7.0.jar:na]
at com.atlassian.stash.internal.hazelcast.ConfigurableWebFilter.doFilter(ConfigurableWebFilter.java:38) ~[ConfigurableWebFilter.class:na]
at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:198) ~[jira-javamelody-1.53.0.jar:na]
at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:176) ~[jira-javamelody-1.53.0.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.7.0_17]
at java.lang.Thread.run(Unknown 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(AbstractQueryImpl.java:975) ~[hibernate-core-4.3.6.Final.jar:4.3.6.Final]
at org.hibernate.internal.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:966) ~[hibernate-core-4.3.6.Final.jar:4.3.6.Final]
at com.atlassian.stash.internal.auth.trusted.HibernateTrustedApplicationDao.getByApplicationId(HibernateTrustedApplicationDao.java:41) ~[stash-dao-impl-3.7.0.jar:na]
at com.atlassian.stash.internal.auth.trusted.TrustedApplicationsManagerImpl.getTrustedApplication(TrustedApplicationsManagerImpl.java:105) ~[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

This widget could not be displayed.

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
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Aug 10, 2018 in Bitbucket

What is your #1 piece of advice to new users getting started using Bitbucket?

Hello Community! My name is Claire Maynard, and I’m a Product Marketing Manager on the Bitbucket team. I’m interested in hearing what advice or tips you have for new users getting started on ...

275 views 15 2
Join discussion

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