Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Either the application has not called WSAStartup, or WSAStartup failed. (os error 10093) #56

Closed
Geobert opened this issue Oct 8, 2020 · 8 comments

Comments

@Geobert
Copy link

Geobert commented Oct 8, 2020

Hi,

A user of my app using ldap3 just send me logs containing:

LDAP connection error: I/O error: Either the application has not called
WSAStartup, or WSAStartup failed. (os error 10093)

What does it mean?

@inejge
Copy link
Owner

inejge commented Oct 9, 2020

That's the Winsock DLL initialization function, deep below the level on which ldap3 operates. There's a mention of it in tokio-rs/tokio-core#242, aloong with some speculation about thread shutdown order. That's old code, but maybe it can help you track down the issue.

I'll keep this open for a couple of days, but I'd prefer to close it later, resolved or not, since I don't think there's anything that can be done about it in this crate; it exposes the issue, but doesn't cause it.

@Geobert
Copy link
Author

Geobert commented Oct 9, 2020

Thanks for your answer!

But ldap3 doesn't use tokio-core, does it?

@inejge
Copy link
Owner

inejge commented Oct 9, 2020

It doesn't, but the linked issue is the closest analogue I can find. Look at Cargo.lock of the application: there is still the chain tokio -> mio -> net2 described in the issue, which calls WSAStartup during socket creation. You could try building the application with the modified net2, where the error result of UdpSocket::bind would be logged.

@Geobert
Copy link
Author

Geobert commented Oct 9, 2020

True, and I found this: tokio-rs/mio#1046
EDIT: and the issue was fixed by tokio-rs/mio#1029

which removes net2

@inejge
Copy link
Owner

inejge commented Oct 9, 2020

The dummy UDP socket creation has just moved to mio: here it is.

@Geobert
Copy link
Author

Geobert commented Oct 9, 2020

I see, so what's happening is something bad in mio? I've seen the error message only once for the moment, and using ldap3 in conjunction with deadpool. And it was reported to me, I've never experienced it myself. Maybe rare.

@inejge
Copy link
Owner

inejge commented Oct 9, 2020

It's probably some strange interaction of the user's environment with Winsock. Windows has gotten better in the past decade, but there are still problems which are best "solved" with one of three R's (restart/reboot/reinstall). Perhaps this is one of them. If it's reproducible, a low-level call trace ought to help.

@Geobert
Copy link
Author

Geobert commented Oct 9, 2020

Let's close this then, nothing you can do about it anyway, thank you very much for your expertise!

@Geobert Geobert closed this as completed Oct 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants