Fatal error: seekInputStream(to:) is not yet implemented in URLSession

Hello, sorry, my english is very bad...
I use URLSession just inside my own library written in pure swift with Foundation for Linux(Debian) without any frameworks. And sometimes I have this error

Fatal error: seekInputStream(to:) is not yet implemented: 
file Foundation/URLSession/NativeProtocol.swift, line 264

Illegal instruction

Please, help me :upside_down_face:

1 Like

Don’t worry, your English is just fine!

You are seeing this problem because the seekInputStream function is not implemented on Linux yet.
@IanPartridge do you know if there’s an issue implementing it or should it be quite straightforward?

2 Likes

The good news is that there is a PR to implement this here: https://github.com/apple/swift-corelibs-foundation/pull/1629

I have just kicked off the CI tests it. Hopefully we can merge soon and get a release out, as quite a few people have hit this problem.

7 Likes

@IanPartridge @johannesweiss
Guys, thanks for your answers, I appreciate it! I’m really-really can’t wait for this fix cause my app always crashing on seekInputStream(to:) :crazy_face:

Great to see it's being implemented! In my current Vapor 3 server, when I do a post request it seems to get to this error 1 out of 5 times or so - do you guys have insight why it happens randomly rather than all the time?

Found an explanation from Vapor community a year ago for anyone interested: