SpecklePy get_default_account() error

Just trying the example script from https://speckle.guide/dev/py-examples.html#sending-receiving, and receiving an error on running account = get_default_account():

Error queueing metrics request: [Errno 8] nodename nor servname provided, or not known

Seems to be from: specklepy/logging/metrics.py, line 117, in __init__ self.user_ip = socket.gethostbyname(socket.gethostname())
socket.gaierror: [Errno 8] nodename nor servname provided, or not known

Any ideas?

Have you installed accounts on your machine with Speckle Manager?

Yep, at https://speckle.xyz

hey @daniel-fink!

thanks a lot for reporting - and welcome to the forum! feel free to Introduce yourself :person_gesturing_ok: if you’d like.

this is unexpected behaviour as metrics shouldn’t be throwing errors - may I ask what OS / environment you’re using as I haven’t encountered this before?

either way, that attribute throwing the error isn’t used by our metrics anymore so I’ve dropped it and released v2.7.1 of specklepy which should resolve this issue for you! let me know if you run into any other issues getting started.

BTW I am on macOS 11.6.6 (20G624), if that has any bearing? Some of my minor internet sleuthing turns up a few issues re: socket and /etc/hosts, but I can’t seem to fix it via those suggestions.

I’m also using poetry for package management & venv

interesting! i haven’t done a lot of testing on mac yet (new mac user here!) but will have a look as well.

upgrading to specklepy 2.7.1 should resolve this issue, but please feel free to report back if anything else crops up

to clarify, were you still able to run the script or did the script actually throw and stop execution at this point? in theory, errors in metrics should only be logging warnings / errors to the console but shouldn’t actually be throwing and halting execution. if it is throwing though, I’ll have to investigate to find a fix here…

1 Like

Thanks. This all works.
Re: errors, I believe it raised an Exception and stopped execution