grpc / grpc-swift

The Swift language implementation of gRPC.
Apache License 2.0
2.01k stars 413 forks source link

deadlineExceeded (UnableToParseFrame(file: "NIOHTTP2/HTTP2ChannelHandler.swift", line: 490)) #1962

Open furuyan opened 2 months ago

furuyan commented 2 months ago

What are you trying to achieve?

I want to get data using UnaryCall.But it returns this error. deadlineExceeded (UnableToParseFrame(file: "NIOHTTP2/HTTP2ChannelHandler.swift", line: 490)) This error is occured in HTTP2FrameDecoder.process(maxFrameSize:, maxHeaderListSize:) Line: 91 It's because the header.length is too large, but I have no idea why.

I used Charles, but could not find the target network log.

    func getData() async throws {
        let group = MultiThreadedEventLoopGroup(numberOfThreads: 1)
        let channel = try GRPCChannelPool.with(
            target: .host("myhost.com", port: 443),
            transportSecurity: .tls(.makeClientDefault(for: .best)),
            eventLoopGroup: group
        )

        let client = MyClient(channel: channel)

        let request = SomeRequest.with {
            $0.condition = "hoge"
        }

        try await client.hogeData(request)
    }

Environment Apple Swift version 5.9.2

    dependencies: [
        .package(url: "https://github.com/apple/swift-protobuf", from: "1.25.2"),
        .package(url: "https://github.com/grpc/grpc-swift.git", from: "1.23.0"),

What have you tried so far?

It works fine in grpcurl. grpcurl ’ -d ‘{ “param”: “hoge”, }’ myhost.com:443 hoge/Data

glbrntt commented 2 months ago

This appears to be a protocol violation: the error indicates that the server is sending a headers frame which is larger than the client allows.

Do you own the server here too?

furuyan commented 2 months ago

Yes, i own the server.

glbrntt commented 2 months ago

Is it possible for you to reproduce this locally then, ideally without TLS, so that we can get a packet capture?

I'd like to be able to understand why we're hitting this error: either the server is sending a frame which is too large or there's a bug in our http/2 code.