Can't acces speckle stream in qgis

1 Like

Hey @fff

If you clear the text box with contours in it, and click search, do all your Project Streams appear in a list below?

Is the one you want one of them?

Hej,
No Project Streams appear in the list.
Thank you

1 Like

Just to make sure, do you have any streams in speckle.xyz?

yes, I have one stream

Hi @fff ! From what I can see, you are getting a yellow label with a warning when you click “Search”. It means the query sent to the server returned an exception.
We can try to figure out the root of the issue by calling the same query manually. Try opening Plugins-> Python Console, and paste the code below (preserving all the line breaks) and see whether it returns the list of the Streams that you are looking for, or gives an exception.

import specklepy
from specklepy.api.client import SpeckleClient
from specklepy.api.credentials import get_local_accounts

query = ""
speckle_accounts = get_local_accounts()
for i, acc in enumerate(speckle_accounts):
    try:
        speckle_client = SpeckleClient(acc.serverInfo.url, acc.serverInfo.url.startswith("https"))
        speckle_client.authenticate_with_token(token=acc.token)
        results = speckle_client.stream.search(query)
        print(results)
    except: 
        pass

print("done")

1 Like

Ciao,

I have the same issue in Windows with QGIS 3.22.16 LTR and connector version 2.12.0. I do have the Speckle manager which i use with a few other connectors. I can’t see any stream in the list to send my graphics. If i press on the search button to open the search windows ans i paste down my stream name or url and then press the search button, i don’t get any result either.

If I try to create a new stream i get these errors:
In messages panel:

2023-02-20T17:03:02     INFO    Extension ré-installée avec succès
2023-02-20T17:03:38     WARNING    Speckle : Some streams cannot be accessed
2023-02-20T17:18:36     INFO    Aucune entité sélectionnée : La couche active n'a pas d'entité sélectionnée
2023-02-20T17:19:47     WARNING    Erreur Python : Une erreur est survenue lors de l'éxécution du code Python: Voir le journal des erreurs Python pour plus de détails

in python errors panel:

2023-02-20T17:19:47     WARNING    Traceback (most recent call last):
              File "C:\Users\enric\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\speckle-qgis\speckle_qgis.py", line 512, in handleStreamCreate
              sw = StreamWrapper(account.serverInfo.url + "/streams/" + str_id)
             TypeError: can only concatenate str (not "SpeckleException") to str
             

@Kateryna
Your script

import specklepy
from specklepy.api.client import SpeckleClient
from specklepy.api.credentials import get_local_accounts

query = ""
speckle_accounts = get_local_accounts()
for i, acc in enumerate(speckle_accounts):
    try:
        speckle_client = SpeckleClient(acc.serverInfo.url, acc.serverInfo.url.startswith("https"))
        speckle_client.authenticate_with_token(token=acc.token)
        results = speckle_client.stream.search(query)
        print(results)
    except: 
        pass

print("done")

gives this result:

exec(open('C:/Users/enric/AppData/Local/Temp/tmpj9m8m6lz.py'.encode('utf-8')).read())
SpeckleException: Failed to execute the GraphQL stream request. Inner exception: 'latin-1' codec can't encode character '\u0142' in position 16: ordinal not in range(256)
done

Thank you in advance for jour help,
Enrico

1 Like

Hi Enrico!
I’m puzzled :thinking:

Theoretically it shouldn’t affect the process, but do you have any special characters in the names/descriptions of the stream, or your account/email (e.g. like this Ł)? Could you make any of your streams public and share a link?

Also could you run the slightly modified code from Python console and share the full screenshot, starting from your input (like I shared above)? You can paint over the sensitive info.

import specklepy
from specklepy.api.client import SpeckleClient
from specklepy.api.credentials import get_local_accounts

query = ""
speckle_accounts = get_local_accounts()
print(speckle_accounts )
for i, acc in enumerate(speckle_accounts):
    try:
        speckle_client = SpeckleClient(acc.serverInfo.url, acc.serverInfo.url.startswith("https"))
        print(speckle_client)
        speckle_client.authenticate_with_token(token=acc.token)
        print(speckle_client)
        results = speckle_client.stream.search(query)
        print(results)
    except Exception as e: 
        print(str(e))

print("done")

Hi!

This is the output of your script:

I have a sream which name is 2023-02 IT-VE-Venezia - Biennale Sant’Elena - QGIS, it contains a '

1 Like

It is curious because i never used a unicode character u0142, which is not used in any of my languages!

Unable to replicate the issue :smiling_face_with_tear: PMed you with some more questions

Solution found:) QGIS 3.22.16 ‘Białowieża’ has \u0142 symbol in the version name and was causing uncaught exception, will be fixed next week in 2.13.0 connector version :white_check_mark:

4 Likes

A post was split to a new topic: QGIS Inner exception: Transport is already connected