Delete applications that have been upgraded


#1

Is anyone else having trouble deleting applications that have been “upgraded” to STARTER. I don’t remember what the applications were called before the new types, maybe it was BASIC or something like that?

Either way, in my dashboard when I try to delete an old application I get an error. There are no devices associated to this application.

Application not found: xxxxxx

image

I didn’t see any other mention of this behavior on the forums. I have the same error with two different applications that I’d like to delete to clean up my dashboard.


#4

Hi @klutchell,

Did the application delete succeed after you got the error message? In other words, is the application still available/visible in your dashboard?

Best, Kostas


#10

One possibility is that the dashboard is polling the data around the time that the delete request was sent, and there’s a disconnect of what’s displayed (still showing the app) and what does the API says (no such app) regarding the application.

Do you still face this issue? If you go to your main dashboard view where the applications are listed, does that one in question show up?

In the meantime we are checking things on our side as well.


#11

I am having the same problem. I can’t delete my applications. They continue to show up in the dashboard. Tried several times.


#12

@rpelletier Can you give us an application number that we can check out (basically the https://dashboard.resin.io/apps/APP_ID/devices link is good) and enable support access (in the application actions)?


#13

I have granted you access
https://dashboard.resin.io/apps/1031360/devices


#14

Thanks, checking.


#23

Hey @rpelletier we have a reasonably good idea what’s going on in your case (some information left about application releases that devices in that application were running before, that are blocking the application delete). We’ll keep you posted when we clean things up and the application should be deletable.

I think that’s the same situation for @klutchell as well. Could you please add support access for us for that application that you have the screenshot for? (or any other that you have issues with)


#27

Hey @rpelletier, we’ve done the modification to the application you’ve sent us, can you check whether you can delete the application now?


#29

Embarrassingly, I gave you the wrong Application. My apologies, it is been that kind of day. This is the correct one.
https://dashboard.resin.io/apps/1032304/actions

My sincere apologies


#30

Is there a way in which I can do this myself through the cli maybe? I do not see any cli documentation for deleting an app, but thought I would ask. Thank you.


#31

Hey team, sorry I didn’t see all the responses until now.

The application still cannot be deleted. I have two apps in this state at the moment.

I have granted support access to https://dashboard.resin.io/apps/882813/actions.

Cheers


#32

Hey @klutchell, we haven’t changed anything on your application yet, before your approval.

Now I’ve done the one that you’ve enabled support access just above, let us know if deletion works now!


#35

@rpelletier the problem is not that there’s no “deletion” action, or such. But currently when a deletion is issued, not all relevant data objects are cleared out first, before the application is deleted, and they block the deletion (because of internal consistency constraints.)

I’ve just done the fix for this other application you’ve sent, and should be able to delete. Let us know if still not!
Fortunately the other application had no devices, so the mixup didn’t cause any issues. And no worries at all. :slight_smile:

For doing it yourself - you hopefully won’t need it anymore (as this app is fixed, and the permanent change is in testing now), but here it is.

The dashboard is using the resin SDK under the hood, and we’ve included it for easy use in the Chrome Development Tools / Javascript Console. Thus e.g. if you go to the dashboard and hit Ctrl+Shift+I (or depends on the OS you are on, see the link with the right keyboard shortcut), you will see something like this:

devconsole

Then where there’s the command prompt at the bottom, set a variable with your app’s ID.

id=...

thus in your case

id=1032304

After that, pasting this Javascript snippet will delete all the image_install resources that are dangling for this application and allows deletion. After pasting, just wait until the done is emitted in the console.

sdk.pine.get({ 
    resource: 'release', 
    options: { 
        $filter: { 
            belongs_to__application: id 
        }, 
        $expand: { 
            provides__image_install: { 
                $select: 'id' 
            } 
        } 
    }
})
.then((releases) => {
    return releases.map((r) => r.provides__image_install);
})
.then(_.flatten)
.then((iis) => { 
    return Promise.all(iis.map((ii) => sdk.pine.delete({ resource: 'image_install', id: ii.id }) )) 
})
.then(() => console.log('done'))

Our fix is pretty much this but run automatically when you hit delete for an application in the dashboard, or issue resin app rm ... in the resin CLI.

So, let us know if you have any issues with your application when you try to delete (as mentioned, we’ve run this above fix on it).


#37

Yes, I was able to delete application 882813 now that it was fixed manually by @imrehg.

I was also able to delete 1032070 by following @imrehg’s JavaScript Console steps.

Great work team!


#38

Hey @klutchell & @rpelletier, the fix for this app-deletion issue is now in production, should not hit it again! (and won’t need the manual fix posted above either)
Cheers!