stormpath / Turnstile

An authentication framework for Swift.
Apache License 2.0
165 stars 29 forks source link

fatal error: Transfer completed, but there's no current request. NSURLSession #31

Open andrew804 opened 7 years ago

andrew804 commented 7 years ago

When running in Linux with Swift version 3.0.2 after receiving a few requests to my Vapor server (perhaps in quick succession) I get the following fatal error:

fatal error: Transfer completed, but there's no current request.: file Foundation/NSURLSession/NSURLSessionTask.swift, line 794

Thanks to @LoganWright I narrowed the problem down to authenticating the incoming request with Turnstile Web. The issue only happens on Linux not macOS but is quite sporadic. The error occurs when Turnstile makes the request to Facebook.

edjiang commented 7 years ago

This sounds like a Foundation bug... might want to report it at bugs.swift.org if you can find a way to reproduce it.

Try making requests with this HTTP Client: https://github.com/stormpath/Turnstile/blob/master/Sources/TurnstileWeb/URLSession+Turnstile.swift#L16 and see if you can reproduce the bug independent of Vapor/Turnstile.

hayesbiz1 commented 7 years ago

Seeing this as well.