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

Support request: Help wanted for custom Spring function #1790

Closed
4 of 5 tasks
Marx2 opened this issue Apr 23, 2023 · 5 comments
Closed
4 of 5 tasks

Support request: Help wanted for custom Spring function #1790

Marx2 opened this issue Apr 23, 2023 · 5 comments

Comments

@Marx2
Copy link

Marx2 commented Apr 23, 2023

My actions before raising this issue

I'm trying to call java function and it doesn't work

Who is this for?

personal project

When Function is called, exception happens. Possible fix, described in documentation, has no description, how to apply

Current Behaviour

I'm calling function https://hub.docker.com/r/marx2/spring-cloud-fn/tags (source code: https://github.com/Marx2/spring-cloud-function-openfaas)
Instead of output I'm receiving:
2023/04/23 22:07:47 Upstream HTTP request error: Post "http://127.0.0.1:8082/": net/http: HTTP/1.x transport connection broken: too many transfer encodings: ["chunked" "chunked"]
It should simply call a function and give back a reversed string

Are you a GitHub Sponsor (Yes/No?)

Check at: https://github.com/sponsors/openfaas

  • Yes
  • No

List All Possible Solutions and Workarounds

  1. It's said that problem can be fixed by setting:
    http_buffer_req_body: true
    but there's no mention, how to do that.
    Solution would be to update documentation with clear description, where and how to set this value.
    https://docs.openfaas.com/deployment/troubleshooting/#my-function-gets-a-nil-or-empty-body
  2. Second possible solution is to upgrade/reconfigure Go library, to accept duplicated headers

Which Solution Do You Recommend?

Steps to Reproduce (for bugs)

  1. Deploy given function: https://hub.docker.com/r/marx2/spring-cloud-fn/tags
  2. Call it and watch function container logs
  3. Function returns error 500
  4. In logs there's an error:
    2023/04/23 22:39:19 Upstream HTTP request error: Post "http://127.0.0.1:8082/": net/http: HTTP/1.x transport connection broken: too many transfer encodings: ["chunked" "chunked"]

Context

I've read that this error is caused by new Go library, which has implemented strict checking of duplicated headers.

Your Environment

  • FaaS-CLI version ( Full output from: faas-cli version ):
    CLI:
    commit: 0b1e92baf1377cc64c89b131fb3b227105f115da
    version: 0.16.3

Gateway
uri: https://openfaas.k.marx.katowice.pl
version: 0.26.3
sha: a128df4

Provider
name: faas-netes-ce
orchestration: kubernetes
version: 0.16.7
sha: e53a5fffb5d96d6e657ad4ff50c1b8bd009fab67

  • Docker version docker version (e.g. Docker 17.0.05 ):
    Client:
    Version: 20.10.21-rd
    API version: 1.41
    Go version: go1.18.7
    Git commit: ac29474
    Built: Tue Nov 22 22:21:43 2022
    OS/Arch: darwin/arm64
    Context: default
    Experimental: true

Server: Docker Desktop 4.15.0 (93002)
Engine:
Version: 20.10.21
API version: 1.41 (minimum version 1.12)
Go version: go1.18.7
Git commit: 3056208
Built: Tue Oct 25 17:59:41 2022
OS/Arch: linux/arm64
Experimental: true
containerd:
Version: 1.6.10
GitCommit: 770bd0108c32f3fb5c73ae1264f7e503fe7b2661
runc:
Version: 1.1.4
GitCommit: v1.1.4-0-g5fd4c4d
docker-init:
Version: 0.19.0
GitCommit: de40ad0

@PySualk
Copy link

PySualk commented Apr 26, 2023

Would be interested in a solution as well.

@alexellis
Copy link
Member

Hi @Marx2 & @PySualk - I assume you both work together then?

This isn't an error that we've found with any of our supported templates or even heard of before from other users.

I can see that you've built a Dockerfile-based function, I would recommend creating your own template and then using that for your function instead.

The chances are that you have a bug in your custom Spring template or have misconfigured it.

transport connection broken: too many transfer encodings: ["chunked" "chunked"]

Do you know why is your function returning the same header twice? Is this a bug in Spring?

We have a template for Vert.x that also uses Gradle, perhaps you'd prefer that?

https://www.openfaas.com/blog/get-started-with-java-openjdk11/

Alex

@alexellis
Copy link
Member

/set title: Support request: Help wanted for custom Spring function

@derek derek bot changed the title too many transfer encodings: ["chunked" "chunked"] - poor documentation of possible solution Support request: Help wanted for custom Spring function Apr 28, 2023
@alexellis
Copy link
Member

alexellis commented Apr 28, 2023

@alexellis
Copy link
Member

Hi @Marx2 I commented and gave you direction two weeks ago.

Since I haven't heard from you I'm going to close this issue and assume you found a way forward.

Feel free to keep the discussion going if you need to.

Alex

This issue was closed.
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

3 participants