Can't delete Application Links to Stash server we removed

brad1050 October 30, 2012

We have a locally-hosted version of Jira. We previously set up Stash on a local server on our office LAN, and an Application Link was created between Jira and Stash correctly. We then decided that we wanted to set up Stash on a different server (at a different IP address) on our office LAN. Doing this created a new Application Link between Jira and Stash, which worked correctly. We then removed the first Stash server (reformatting that server in the process). Now we get an error that Jira can't communicate with the first server:

Request to http://10.4.20.80:7990 failed: An error occurred whilst communicating with Stash: No route to host

This makes sense, since that server is no longer there. So attempted to delete the Application Link to the first server, but when I do I get this error:

Couldn't retrieve manifest for link with id cc353bd3-dd1c-3168-9aeb-c6ebb85c78b2

and I'm unable to delete the Link. Since I can't bring the old Stash server back online, I don't seem to be able to remove the Application Link. Is there any way to work around this?

8 answers

1 accepted

1 vote
Answer accepted
Alejandro Conde Carrillo
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 30, 2012

You should be able to delete it directly in database with teh following steps:

  1. Get the applicatin okey for the application to remove:
    SELECT SUBSTR(a.property_key,16,36) as "Application Key", b.propertyvalue as "Application Name" FROM propertyentry a join propertystring b on a.id=b.id where a.property_key like 'applinks.admin%' and  a.property_key like '%name';
  2. Delete the application link from databse. Replace <tt><APP_KEY></tt>fro the application key from step #1:
    DELETE FROM oauthspconsumer WHERE consumer_key IN (SELECT propertyvalue FROM propertystring WHERE id IN (SELECT id FROM propertyentry WHERE property_key LIKE 'applinks.admin%' AND property_key LIKE '%&lt;APP_KEY&gt;%'));
    DELETE FROM trustedapp WHERE application_id IN (SELECT propertyvalue FROM propertystring WHERE id IN (SELECT id FROM propertyentry WHERE property_key LIKE 'applinks.admin%' AND property_key LIKE '%&lt;APP_KEY&gt;%'));
    DELETE FROM propertystring WHERE id IN (SELECT id FROM propertyentry WHERE property_key LIKE 'applinks.admin%' AND property_key LIKE '%&lt;APP_KEY&gt;%');
    DELETE FROM propertyentry WHERE property_key LIKE 'applinks.admin%' AND property_key LIKE '%&lt;APP_KEY&gt;%';
    UPDATE propertystring SET propertyvalue = REPLACE(propertyvalue,'\n&lt;APP_KEY&gt;','');

More info in this link.

brad1050 November 15, 2012

Sorry for the slow response. I followed your instructions and it worked, although you might want to add that I needed to stop/start Jira before it took effect.

1 vote
Andrzej Pasterczyk
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 20, 2012

Another simple workaround is to inspect button element in browser and remove "disabled" flag.

Works like charm :)

skorzinetzki March 5, 2013

yeah, worked great :) (remove button disabled flag)

0 votes
Anthony Ly March 1, 2016

really bad advice..asking user to delete from database.  Is there a workaround?

0 votes
Sandeep Anand June 22, 2015

Hi,

Can you please tell that on which database shall I run these commands. on JIRA database or STASH database.

I have already removed the links from the JIRA database using above commands. Now I want to remove them from STASH database. 

 

Regards

sandeep

0 votes
Honeywell JIRA Admin July 16, 2013

Thanks Andrzej.

But the sql delete queries are giving another error. "The data types nvarchar and ntext are incompatible in the equal to operator."

0 votes
Honeywell JIRA Admin July 16, 2013

When I am trying to delete I am getting the below error.Iam using JIRA 5.2.7

REST request failed: ApplicationLink with id '84306eb6-4fe7-3aef-98c3-e351870569a0' not found!

Andrzej Pasterczyk
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 16, 2013

Well, either it's already removed or could be any other reason since it's not a supported solution just simple workaround. I don't think I'm able to help you more with that - you can try to fall back to the SQL solution or contact atlassian support.

0 votes
Honeywell JIRA Admin July 16, 2013

How to remove the button disabled flag

Andrzej Pasterczyk
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 16, 2013

That depends on your web browser. In chrome it's kind of like right click on the button, inspect element, then double click on "disabled" flag in HTML source to edit and just remove with backspace.

0 votes
Matheus Fernandes
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 30, 2012

Suggest an answer

Log in or Sign up to answer