QGIS GraphQL error: Transport is already connected

Hi there,

I am new to Speckle and currently following one of the tutorials :

…to create a 3d terrain model (with buildings) from QGIS > Speckle > Rhino

I have the building info from osm and other data from council files I received.

The issue is that when I try to send my first terrain through Speckle as per the tutorial I get the following error codes:

2023-06-27T16:53:16 CRITICAL :exclamation: SpeckleException: Failed to execute the GraphQL active_user request. Inner exception: Transport is already connected::onAccountSelected
2023-06-27T16:53:25 CRITICAL :exclamation: SpeckleException: Failed to execute the GraphQL active_user request. Inner exception: Transport is already connected::handleStreamCreate

I have used the speckle server also.

Any help would be great!

2 Likes

Hi @hgibson ! The errors seem to originate from a different function then sending a terrain, could you pls describe the exact actions that led to these errors? E.g. You clicked “Create New Stream”, entered a name, clicked “Ok”. You can also add screenshots :upside_down_face:

Also it would help to know what OS you are using (Windows/ Mac), QGIS version, Speckle connector version, server (e.g. speckle.xyz) and whether you have your Speckle accounts added to Speckle Desktop Manager.

Thanks!

Thanks for getting back to me so fast!

Click Create a new stream > put in name of stream > ticked public (have also tried without tick) > error code arises. See attached screen shots.

Im using:

Windows: 11 Home 22H2
Processor: 11th Gen Intel(R) Core™ i7-11800H @ 2.30GHz 2.30 GHz

Speckle for QGIS 2.14.1
QGIS Desktop 3.30.3
Server speckle.xyz
Goal to have model in Rhino 7
I have clicked the add account on Speckle manager already as well and it says it should be connected?




Speckle error - speckle manager

2 Likes

Thank you for the details!
This is unusual behavior that we haven’t seen yet, but @gjedlicska made a fix that will likely resolve it in the next release (somewhere next week)

2 Likes

Hi there,
Any update on when the latest version will be available to re-install? @gjedlicska
I currently have the latest version that I can find online at the moment.

Thanks

1 Like

Version 2.15.0-rc gives the same error? :slightly_frowning_face: It is the latest QGIS install using the latest Specklepy package.

Hi,
I am getting the same error and I’m using the lastest package.
image

Thank you in advance!

2 Likes

Hi Sebastien!
This doesn’t look good :slightly_frowning_face: Can I ask you to specify the OS you are using, QGIS version, and also run the following script from QGIS → Plugins → Python Console (if the entire script doesn’t run, try pasting line-by-line):

import gql, requests, urllib3, specklepy 
from importlib.metadata import version
version('gql')
version('requests')
version('urllib3')
version('specklepy')
from specklepy.core.api.client import SpeckleClient
from specklepy.core.api.credentials import get_local_accounts
account = get_local_accounts()[0]
print(account)
new_client = SpeckleClient(
    account.serverInfo.url,
    account.serverInfo.url.startswith("https")
)
print(new_client)
new_client.authenticate_with_token(token=account.token)
print(new_client)

You can cover your data (like email) before pasting the results here.

@Sebastien_Van_Eupen you might need to upgrade urllib3 module to version 1.26.16 in QGIS Python installation. Example how to do it on Windows:

  1. Close QGIS. Manually delete 2 folders with “urllib3” module from QGIS Python installation folder:

  2. Windows → cmd → run as administrator →

cd "C:\Program Files\QGIS 3.32.0\apps\Python39"

python -m pip install -t "C:\Program Files\QGIS 3.32.0\apps\Python39\Lib\site-packages" urllib3==1.26.16

(don’t forget to edit the path if you have a different version of QGIS installed)

Done!

2 Likes

Hi,
I have the same issue.
My OS: Microsoft Windows [Version 10.0.19045.3448]
My QGIS: 3.32.3-Lima 67d46100b5
Speckle QGIS Connector 2.14.1 but exactly the same behavior with 2.15.1
QGIS plugin speckle-qgis 2.16.0-rc

import gql, requests, urllib3, specklepy 
from importlib.metadata import version
version('gql')
'3.4.1'
version('requests')
'2.31.0'
version('urllib3')
'1.26.16'
version('specklepy')
'2.17.0'
from specklepy.core.api.client import SpeckleClient
from specklepy.core.api.credentials import get_local_accounts
account = get_local_accounts()[0]
print(account)
Account(email: my@addres.com, server: https://speckle.xyz, isDefault: True)
new_client = SpeckleClient(
    account.serverInfo.url,
    account.serverInfo.url.startswith("https")
)
print(new_client)
SpeckleClient( server: https://speckle.xyz, authenticated: False )
new_client.authenticate_with_token(token=account.token)
Traceback (most recent call last):
  File "C:\PROGRA~1\QGIS33~1.3\apps\Python39\lib\code.py", line 90, in runcode
    exec(code, self.locals)
  File "<input>", line 1, in <module>
  File "C:\Users\ermsk\AppData\Roaming\Speckle\connector_installations\QGIS\specklepy\core\api\client.py", line 131, in authenticate_with_token
    self._set_up_client()
  File "C:\Users\ermsk\AppData\Roaming\Speckle\connector_installations\QGIS\specklepy\core\api\client.py", line 170, in _set_up_client
    raise user_or_error
specklepy.logging.exceptions.SpeckleException: SpeckleException: Failed to execute the GraphQL active_user request. Inner exception: Transport is already connected
print(new_client)
SpeckleClient( server: https://speckle.xyz, authenticated: True )

Falied with reinstalling urllib3 - no sll module in phyton
image

This worked for me:

1_Download manually (leave in some easily accessible path.) > urllib3-1.26.16-py2.py3-none-any.whl > urllib3 · PyPI

2_Open CMD

3_Go to the directory. (replace path where you have downloaded the file). > cd C:\Users\abcd

4_Install (replace qgis version if necessary) > “C:\Program Files\QGIS 3.30.1\apps\Python39\python.exe” -m pip install urllib3-1.26.16-py2.py3-none-any.whl -t “C:\Program Files\QGIS 3.30.1\apps\Python39\Lib\site-packages”

1 Like

15 posts were split to a new topic: QGIS: SSLError, A failure in the SSL library occured