Skip to content

Fatal Error: NIOAny.swift, line 101 #138

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

Closed
weissi opened this issue Nov 26, 2019 · 9 comments
Closed

Fatal Error: NIOAny.swift, line 101 #138

weissi opened this issue Nov 26, 2019 · 9 comments
Assignees
Labels
kind/bug Feature doesn't work as expected.

Comments

@weissi
Copy link
Contributor

weissi commented Nov 26, 2019

!!! this is a transferred, original issue: apple/swift-nio#1270, original reporter @StrangeDays !!!

Expected behavior

  • Work like developed and running on OSX
  • All requests work

Actual behavior

  • Fatal error: tried to decode as type Request but found Request with contents other(AsyncHTTPClient.HTTPClient.Request(method:

  • Fatal error: tried to decode as type ByteBuffer but found IOData with contents other(IOData

Steps to reproduce

Run your Server on Linux via Docker (swift:latest, ...)

If possible, minimal yet complete reproducer code (or URL to code)

Pretty simple RestRequest (SwiftyRequest) with responseObject and responseData

!!! issue transferred from apple/swift-nio#1270, original reporter @StrangeDays !!!

SwiftNIO version/commit hash

2.10.1

Swift & OS version (output of swift --version && uname -a)

Swift version 5.1 (swift-5.1.2-RELEASE)
Target: x86_64-unknown-linux-gnu
Linux e965e14a2285 4.9.184-linuxkit #1 SMP Tue Jul 2 22:58:16 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

@weissi weissi added the kind/bug Feature doesn't work as expected. label Nov 26, 2019
@StrangeDays
Copy link
Contributor

StrangeDays commented Nov 30, 2019

I was able to make my Code work with following steps for a workaround -- if somebody needs a quick solution

  • Rewrite vom SwiftyRequest to 'classic' HTTP.request
  • Use docker swift:xenial as libcurl3 is used instead of libcurl4

BTW: compiling the newest libcurl4 with swift:latest didn't work with SwiftyRequest as well

@weissi
Copy link
Contributor Author

weissi commented Dec 2, 2019

ping @artemredkin

@artemredkin artemredkin self-assigned this Dec 5, 2019
@artemredkin
Copy link
Collaborator

@StrangeDays hi, I'm having difficulties reproducing the crash, here is what I was trying to run:

import SwiftyRequest
import Dispatch

let request = RestRequest(method: .get, url: "http://google.com/")
let semaphore = DispatchSemaphore(value: 0)
request.responseData { result in
    switch result {
    case .success(let response):
        print(response.status)
    case .failure(let error):
        print(error)
    }
    semaphore.signal()
}
semaphore.wait()

running on:

$ uname -a
Linux swift-server-builder 4.15.0-70-generic #79-Ubuntu SMP Tue Nov 12 10:36:11 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
$ swift --version
Swift version 5.1 (swift-5.1.2-RELEASE)
Target: x86_64-unknown-linux-gnu
$ dpkg -l | grep libcurl
ii  libcurl4:amd64                             7.58.0-2ubuntu3.8                               amd64        easy-to-use client-side URL transfer library (OpenSSL flavour)

Does this issue reproduce always or intermittenly? Can you show me what your workaround was about? It strange that using libcurl3 helped, we are not relying on it at all.

@StrangeDays
Copy link
Contributor

@artemredkin sry 4 responding so l8.
I need some notification strategy from regarding github ;-)

The first thing i notice is the using of DispatchSemaphore, which I don't use.
So I will check the usage of DispatchSemaphore in my code and respond asap.

@StrangeDays
Copy link
Contributor

@artemredkin -- finally i got time ;-)
1st : The Bug is fixed in 1.0.1
2nd: I thing the issue is with connecting to an IP (eg. 127.0.0.1)
If you connect to an IP you should get crash with 1.0.0

@artemredkin
Copy link
Collaborator

@StrangeDays glad to hear that. But I would prefer to reproduce this this crash so we can add a test to prevent this from happening. Should it be the same example as earlier but with an IP address? Is it just local host or any IP? Does it have to be https? Thank you!

@weissi
Copy link
Contributor Author

weissi commented Feb 26, 2020

@StrangeDays / @artemredkin any updates here or can this be closed?

@artemredkin
Copy link
Collaborator

I was unable to reproduce the issue unfortunately

@weissi
Copy link
Contributor Author

weissi commented Feb 26, 2020

happy to close because @StrangeDays says it's fixed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Feature doesn't work as expected.
Projects
None yet
Development

No branches or pull requests

3 participants