logfire icon indicating copy to clipboard operation
logfire copied to clipboard

WSL logfire auth

Open ScrimForever opened this issue 11 months ago • 3 comments

Description

Im trying to use logfire auth, but my wsl did not open any browser to make login.

Image

Python, Logfire & OS Versions, related packages (not required)

Windows 11 - OS

ScrimForever avatar Jan 29 '25 01:01 ScrimForever

@davidhewitt I think you have WSL, could you take a look?

samuelcolvin avatar Jan 29 '25 11:01 samuelcolvin

@samuelcolvin ,

I solved it with some caveats. Apparently, it looks like WSL tries to use the Linux text browser. I had to press "c" to continue, but luckily, the URL appeared, and I was able to proceed in my default browser. However, I think this could be improved.

ScrimForever avatar Jan 29 '25 16:01 ScrimForever

It looks like we just use the webbrowser package from the standard library to do this, which will respect the default browser set inside of WSL. Upstream issue is at https://github.com/python/cpython/issues/89752

We could potentially patch around this inside logfire, let's see what upstream say.

I think configuring your WSL browser to be wslview seems to be the recommended solution for now while upstream does not handle. Seems like might be installed by default on some distros?

github version https://github.com/wslutilities/wslu looks like ubuntu maintains a fork in https://launchpad.net/ubuntu/+source/wslu

I found the version on my WSL installation to be broken so I installed the github version using the instructions at https://wslutiliti.es/wslu/install.html and now logfire auth works fine for me inside WSL.

davidhewitt avatar Jan 30 '25 13:01 davidhewitt