Getting "invalid token" in operations.py / receive(obj_id, remote_transport, local_transport)

Hi,

I’m trying to explore this public notebook/stream here. I’ve actually run it successfully before. As far as I know, I didn’t do spesific things to run it. But now I’m getting this error :

“”“SpeckleException: SpeckleException: Can’t get object 729cb7c74b/3df068d055faeb0109de6b0ee85b426a: HTTP error 403 ({“error”:“Your token is not valid.”}). “””

Before I got this error, I had reinstalled Speckle Manager for a reason and logged in again. (Before installing the manager again, I had to manually remove the files because Objects.db was open in the db editor.) I’m not sure if it affects anything related this issue.

What am I missing:')? Thank you for support.

Hey @Elif_Sinem_Aktas did you try requesting a new token from the web interface?

1 Like

Hi @teocomi, thank you for your answer :blush: Yes I created a new token and delete the old one as well. I also deleted my venv and created new one and installed specklepy again just in case.

When I use SpeckleClient I still authenticate successfully with the new token and list my streams and use other methods:

But I have still problem with StreamWrapper. I think the main error is this:

Is your notebook running on a Jupyter Server or within the VS Code Jupyter environment?

1 Like

This post might help with “no local account find” error.

2 Likes

Hi @jonathon :blush:,

I’m running jupyterlab in browser using my local venv (with the version jupyterlab==4.0.11). Same error in my streamlit app as well.

Hi @gokermu :blush:,

I’ll check the solution you provided

Thank you all for your support.

1 Like

Hi @gokermu, unfortunately it didn’t work, I’ll try again later. :smiling_face_with_tear: Btw, how does it verify whether the local account exists or not?

Merhaba Sinem,

If you have installed Manager for Speckle, StreamWrapper utilizes it to create transports and clients. If you can share the Jupyter Notebook, I can attempt to replicate the issue on my end. You may send me a direct message if you prefer not to share it publicly.

@Elif_Sinem_Aktas is just trying to get one our example notebooks running.

My hunch is it is because the Jupyter server is unaware of the local accounts on whatever machine it runs its sandbox with. Though given that, I’m surprised the authenticate with token failed.

We can check if we can mock a local account JSON in the venv that jupyterlab is running on to circumvent that requirement.

Elif can you describe the machine OS you are using and how the venv is running?

Is it Windows? (or Windows with WSL2?)
Is it linux?
Is it osx?

I think some assumptions we have made in the SDK of what environment it runs in maybe askew.

Hi @jonathon :blush:,

I have Windows(11) with WSL

(venv) PS C:\........\speckle> wsl -l -v
  NAME                   STATE           VERSION
* Ubuntu                 Running         2
  docker-desktop         Running         2
  docker-desktop-data    Running         2

I created the venv on my Windows(11) with python3.8.

  • In the windows terminal I’m running:

    (venv) PS C:\.......\speckle> jupyter lab --ip 0.0.0.0 --port 8888
    
  • I attached the requirements below:
    requirements.txt (5.2 KB)

And Let me explain what I did so far.

  • I created Speckle account of course:)

  • I installed Speckle Manager, Blender Connector, and pushed a model to Speckle-Server to understand how the things works. (I’m not sure if I did this step before the next step or not)

  • Then I worked with example notebooks in speckle-data-pack repo, specklepy tutorials etc. Everything was working great. (I created my first token somewhere here)

  • I was also exploring Objects.db to understand how the data is stored and to understand the structure of data.

  • Since I new in Speckle and I pushed something/receive something etc. randomly, I couldn’t follow the records in Objects.db. Then I decided to remove Speckle Manager and clear everything for a fresh start (I wish I didn’t :sweat_smile:)

  • I reinstalled it, logged again, created new token etc.

  • After that the problem started. I got the errors I shared. As I mentioned before, I suspected token and created new one again, recreated the venv, deleted jupyter kernel etc. I also shut down the computer as the best solution :joy:

The only thing I changed was Speckle Manager and my tokens. I would like to share Speckle Manager ui here, because my account was displayed twice (I don’t know why) before, it displays once now. When I click “View Server”, it directs me to “https://app.speckle.systems/” and “https://app.speckle.systems/profile” returns 404 (Idk if it is normal or not).

image
image

Hi all,

The problem is solved when I add my account using website.

Sorry, for taking your time. Is it necessary to add accounts on both sides (desktop & web)?

1 Like

Interesting, usually when you login from Manager, it is automatically detected by the web app too.

1 Like