LightRun Python Agent Error : TypeError: can only concatenate str (not “NoneType”) to str

When I try to run the Lightrun python agent, I get this error :

$ python3 main.py

Traceback (most recent call last):
File "main.py", line 4, in <module>
lightrun.enable(com_lightrun_server="https://app.lightrun.com/soumibardhan",
File "<frozen lightrun>", line 142, in enable
File "<frozen lightrun>", line 73, in _StartDebugger
File "<frozen lightrun.hub_client>", line 89, in __init__
TypeError: can only concatenate str (not "NoneType") to str  

Reproduce :

https://app.lightrun.com:8443/auth/realms/lightrun/protocol/openid-connect/registrations?client_id=web_app&response_type=code&redirect_uri=https://app.lightrun.com

I selected pycharm and python in the second step. the next step, login, worked. But trying to run the agent gives this error.

This is my main.py :

if __name__ == '__main__':
    try:
        import lightrun
        lightrun.enable(com_lightrun_server="https://app.lightrun.com/soumibardhan",
                        com_lightrun_secret="<your personal token>")
    except ImportError as e:
        print("Error importing Lightrun: ", e)
    print('PyCharm')

Just replace your token here or follow the lightrun installation steps.

I am stuck at this step. Please help.

Answer

Please notice that the URL you should use is:

lightrun.enable(com_lightrun_server='https://app.lightrun.com/company/soumibardhan', com_lightrun_secret='XXXX')

(notice the added /company/ ).