Skip to content
This repository has been archived by the owner on Aug 28, 2021. It is now read-only.

Sender component fails to deserialize when opening definition on other computer, clearing the contents and history of the related stream #123

Open
PHMRHDHV opened this issue May 20, 2019 · 19 comments
Assignees

Comments

@PHMRHDHV
Copy link

PHMRHDHV commented May 20, 2019

EDIT: See #123 (comment) for the actual problem

Step 0:

Expected Behaviour

  • Create a Grasshopper definition on computer A, containing a Speckle Sender component, that refers to a Speckle Server with Speckle Account A.
  • Open Grasshopper definition on computer B, containing the same Speckle Sender component, refering to the same Speckle Server, but using Speckle Account B.
  • Grasshopper definition deserializes normally and is able to stream data to the referenced Speckle stream.

Actual Behaviour

  • Grasshopper sender component fails to deserialize.
  • Referenced stream gets cleared and history deleted.
  • Stream can still be updated with original account, but contains remain invisible / inaccesible from other accounts, both in Grasshopper and in the admin interface. From the original account everything seems fine.

Affected Projects

SpeckleServer, Speckle for Rhino, SpeckleAdmin

Reproduction Steps & System Config (win, osx, web, etc.)

Windows 10, Rhino Version 6 SR14, Grasshopper 1.0.0007
Chrome web-browser

Proposed Solution (if any)

?

image

@PHMRHDHV
Copy link
Author

Hi @didimitrie, the stream is on a private server, unfortunately...
It seems the component failed to find an account and the GET is trying to do /api/accounts/undefined:

error: {"message":"Cast to ObjectId failed for value "undefined" at path "_id" for model "User"","name":"CastError","stringValue":""undefined"","kind":"ObjectId","value":"undefined","path":"_id"}

The strange thing is that this seems to have emptied the stream and stream history and rendered the stream inaccesible to all other user, except the original stream owner. On the original machine, the stream is still accesible and visible.

@didimitrie
Copy link
Member

could you send me a screenshot of the accounts popup? though i'm quite sure the problem is not there necessarily. If on the second computer you create a receiver in a separate gh file and try and get that stream, does it work?

@didimitrie didimitrie self-assigned this May 20, 2019
@PHMRHDHV
Copy link
Author

image

In principle that works, but the receiver returns a 404 error when linking it to the stream ID.

@didimitrie
Copy link
Member

this might mean the stream got flagged as deleted? damn this is difficult to debug remotely. does it show up in the admin interface in the "archive" section? On hestia it's https://hestia.speckle.works/#/trash.

@didimitrie
Copy link
Member

Streams get deleted (or used to get deleted) if you delete the sender component. This might also be getting some sort of confusion when copy pasting grasshopper sender components - though in theory i remember looking at this edge case some time ago and sorting it...

@PHMRHDHV
Copy link
Author

No, I think I didn't. It doesn't appear in the Trash and is still visible in the original location. It just gave me an empty admin interface, without any source or receivers. Although now, after rerunning the script from the original computer and definition a couple of times, the stream seems to be available again, although with out history and reference to the old data.

@PHMRHDHV
Copy link
Author

Sorry, forget that last comment, I was logged in to the admin with the account that originally created the stream, there it is properly visible. With the other account it is still inaccesible.

image

image

And, although it says that there are three items in the history, nothing is actually there...

@didimitrie
Copy link
Member

you might try and refresh the admin ui in "trash" view. Gotcha. This is weird. Side note: I also suspect - had a poke at your server url - that the admin ui is out of date, so you might want to update it.

Last call: if you go to your server_url/api/streams/your stream id, can you send me a screenshot of the result? (or could you make the stream public?)

Another thought: if you create a new stream, with some test data, share it with me and send me that grasshopper definition so i can debug properly? (i've created an account on your server, i should be found if you search for dimitrie).

@PHMRHDHV
Copy link
Author

{"success":false,"message":"Cannot read property 'toString' of null"}

@didimitrie
Copy link
Member

pfff, that stream somehow got corrupted and would be quite keen to understand why. Theoretically you can restore it from the admin ui; does that change anything?

@PHMRHDHV
Copy link
Author

I'll give it a try...

@PHMRHDHV
Copy link
Author

Won't work unfortunately, there is no history or clones anymore...

@PHMRHDHV
Copy link
Author

Ah, somehow there are no accounts anymore in the pop-up when I insert a new sender component. This might be the source of the issue on the Grasshopper side.

@didimitrie
Copy link
Member

how did those disappear though!!! there's literally no delete button for them anywhere (besides the rhino client).

You can check in %localappdata%/SpeckleSettings/ there should be a sqlite database in there that holds the info on the accounts too (as well as the object caches).

@PHMRHDHV
Copy link
Author

That seems fine, contents are correct, it has all the accounts...

@didimitrie
Copy link
Member

is this happening using the plugins that came with the installer, or did you build the plugins yourselves by any chance?

this is super weird; the accounts should still show up then!

@PHMRHDHV
Copy link
Author

These are the plugins that came with the installer, i used the url from the server to install them and I'm also using the updater...

@PHMRHDHV
Copy link
Author

I just re-entered the account and now it appears properly...

@didimitrie
Copy link
Member

Ok, with your test definition i could partly reproduce this. Main issues I see:

  • core & popup allows you to login to the same server, but with different urls (ie, /api, /api/, /api/v1 - which are equivalent).
  • core, in the client deserialisation, looks for an account matching that exact url, and fails if it doesn't, even if the user does have a valid account on that server.

These, nevertheless, don't amount to the total clusterfuck that happened earlier; ie somehow the stream got flagged as deleted without user input (am i correct in assuming this?). So the quest continues...

@didimitrie didimitrie transferred this issue from speckleworks/SpeckleAdmin May 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants