Skip to content

External API invocation is failing with 502 error #1595

Open
@suneelkandali

Description

I wrote a Java function with below http client code snippet and deployed to my local Fn then function invocation failed with 502 error

I have Rancher Desktop on my local

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("http://webcode.me"))
.GET() // GET is default
.build();

HttpResponse response = client.send(request,
HttpResponse.BodyHandlers.discarding());

System.out.println(response.statusCode());
Error message in log

time="2022-11-02T21:37:59Z" level=debug msg="Inside Java Hello World function suneel
n" action="server.handleFnInvokeCall)-fm" app_id=01GGVTFKZYNG8G00GZJ0000001 call_id=01GGX4F2ESNG8G00GZJ000000W fn_id=01GGWWQSQGNG8G00GZJ0000006 image="sunkandalidocker/fn-process-aggregator-stream-consumer:0.0.18" user_log=true

time="2022-11-02T21:38:00Z" level=info msg="hot function terminating" app_id=01GGVTFKZYNG8G00GZJ0000001 container_id=01GGX4F2ETNG8G00GZJ000000X cpus= error="Post http://localhost/call: EOF" fn_id=01GGWWQSQGNG8G00GZJ0000006 idle_timeout=30 image="sunkandalidocker/fn-process-aggregator-stream-consumer:0.0.18" memory=128

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions