quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.41k stars 2.57k forks source link

Azure-functions-http never returning (even for quickstarter) #37315

Open jelmew opened 8 months ago

jelmew commented 8 months ago

Describe the bug

Following https://quarkus.io/guides/azure-functions-http I expect an api to respond on https://{appname}.azurewebsites.net/api/hello after deploying to Azure.

What happens is that the azure function is deployed. In the azure logging the http invocation is visible, but the api never returns. No additional logging is shown. Function works locally

Only found azure logging

Executing 'Functions.QuarkusHttp' (Reason='This function was programmatically called via the host APIs.', Id=82ac3607-0791-446c-8c6c-d589f9ab905f)

2023-11-25T06:54:26Z [Verbose] Handling WorkerErrorEvent for runtime:java, workerId:java. Failed with: System.TimeoutException: The operation has timed out. at Microsoft.Azure.WebJobs.Script.Grpc.GrpcWorkerChannel.PendingItem.OnTimeout() in /src/azure-functions-host/src/WebJobs.Script.Grpc/Channel/GrpcWorkerChannel.cs:line 1578

Expected behavior

Functional hello-world api

Actual behavior

API never returning with hello

How to Reproduce?

Follow https://quarkus.io/guides/azure-functions-http

Call deployed api on Azure.

Output of uname -a or ver

Linux pop-os 6.5.6-76060506-generic #202310061235~1697396945~22.04~9283e32 SMP PREEMPT_DYNAMIC Sun O x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

openjdk version "17.0.7" 2023-04-18 OpenJDK Runtime Environment Temurin-17.0.7+7 (build 17.0.7+7) OpenJDK 64-Bit Server VM Temurin-17.0.7+7 (build 17.0.7+7, mixed mode, sharing)

Quarkus version or git rev

3.5.3

Build tool (ie. output of mvnw --version or gradlew --version)

3.9.5

Additional information

No response

gsmet commented 8 months ago

/cc @patriot1burke

jelmew commented 7 months ago

Still broken in quarkus 3.6.1

danieloh30 commented 7 months ago

@jelmew which does the Java version use in the function? You can find it in the resource JSON in the Azure portal

image

If it shows "value": "java|11" but you built the app with Java 17, you hit the issue. Can you retry to build and deploy it using JDK 11?

jelmew commented 7 months ago

Good catch, that was the issue.

Shouldn't we update the deploy plugin to take the local Java version by default? Or atleast update the documentation indicating that it is broken on java 17? Java 11 is EOL, azure functions support 17 just fine.

Furthermore, once deployed there is no option to change the java version. image

danieloh30 commented 7 months ago

IIRC, this is a known issue. I'd defer @patriot1burke to shed some lights on this.

cesarfactoware commented 2 months ago

I think you could use the property quarkus.azure-functions.runtime.java-version=17 on the application.properties file, that worked for me