Open pimterry opened 7 years ago
@pimterry I seem get something like this with resin sync
:
$ resin sync -s .
Cannot read property 'app_name' of undefined
but if I add the device UUID, then it works:
$ resin sync -s . ed01bfe
? Destination directory on device container [/usr/src/app]
Getting information for device: ed01bfe
Got application container info.
...
Is there anything I can test? (using resin-cli 6.6.5)
@pimterry also, just issuing resin devices
to list all of my devices seems to have the issue too..
$ resin devices
Cannot read property 'app_name' of undefined
Possibly related to https://github.com/resin-io/resin-cli/issues/654
@imrehg sorry I missed this while I was away, back now! This is fascinating. That error is because we're successfully loading the device from the API, but not getting the application back with it, almost as if it's a device that exists outside an application.
The main thing I need to debug this further is a reliable way to reproduce this. How did you get into this state? Is there anything unusual about the device or its application? Are you collaborator on somebody else's app here, as Kostas suggests?
@pimterry this happened during the testing of a resinOS release. The app is just mine, and neither the app, nor the device was shared with another user.
Now retrying it (different app, different device), I have these experience (resin-cli 6.6.5):
Sorry if it's confusing, as I'm confused too now, it might be multiple things going wrong, or misunderstood. :/ Happy to test anything that you might think to be useful.
Edit: the resin devices
part is erroring out the same way as before on 6.6.6. I have some applications shared with me, but there's a lot application I have at hand. Happy to give you a token if checking out my fleet would be helpful....
This issue still bugs me. Can't do resin devices
on my setup, as it always just errors. (6.12.5 now)
@imrehg this is really weird. Can you run JSON.stringify(await sdk.models.device.getAll())
in the browser console on the web dashboard, and send me the JSON you get back? That's more or less the underlying SDK command the CLI is running, and somehow it must be returning some device data in there that's in an odd state we're not expecting.
@pimterry the result is (a bit big): https://www.flowdock.com/app/rulemotion/resin-frontend/threads/iHwow5Hr37NcDUV3mfFPNswXWou
Discussion continued in the flowdock thread. Short answer: this happens if you have a device that you own, in an application that you no longer have access to.
We're going to have a product call and discuss this more widely, since it's part of a larger issue. As a short-term mitigation, if you end up in this situtation, right now I think you need to either move the device into an app you do own, using the API directly, or delete the device entirely.
TypeError: Cannot read property 'app_name' of undefined
The error can no longer be found in Sentry.io.
this happens if you have a device that you own, in an application that you no longer have access to
I understand that API changes were made since this issue was created, to prevent this situation from arising.
I am closing this issue for the reasons above. However if you come across this problem again, please add a comment and I will reopen it and investigate it further.
I understand that API changes were made since this issue was created, to prevent this situation from arising.
Or maybe not. Re-opening this issue as the error was reported again:
belongs_to__application
is always defined / valid), but a device may be removed from an application if for example the user who registered the device is removed from the application (e.g. the user is removed from a role such as collaborator or developer of an application).belongs_to__application
may be undefined or inaccessible.devices
, device <uuid>
, device move <uuid>
.
https://sentry.io/resinio/cli/issues/289095802/