speckleworks / SpeckleCore

Check a brand new Speckle at: https://github.com/specklesystems
https://speckle.systems
MIT License
38 stars 17 forks source link

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

Open PHMRHDHV opened 5 years ago

PHMRHDHV commented 5 years ago

EDIT: See https://github.com/speckleworks/SpeckleCore/issues/123#issuecomment-494064530 for the actual problem

Step 0:

Actual Behaviour

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 commented 5 years ago

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 commented 5 years ago

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?

PHMRHDHV commented 5 years ago

image

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

didimitrie commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

~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 commented 5 years ago

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

didimitrie commented 5 years ago

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 commented 5 years ago

I'll give it a try...

PHMRHDHV commented 5 years ago

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

PHMRHDHV commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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

didimitrie commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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

didimitrie commented 5 years ago

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

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...