Closed Eric-fc closed 3 years ago
Thanks for the detailed github issue, @Eric-fc. @anuchandy can you please help @Eric-fc resolve this dependency mismatch?
/cc @stliu as fyi
@Eric-fc, This seems due to the dependency conflict resulting from function loading the worker Jar then App Jar; this is the default behavior; to reverse the loading order you'll need to define and set the application variable FUNCTIONS_WORKER_JAVA_LOAD_APP_LIBS to 1.
How do you set FUNCTIONS_WORKER_JAVA_LOAD_APP_LIBS for local run of functions??
I tried this in local settings json but still have same error
{ "IsEncrypted": false, "Values": { "AzureWebJobsStorage": "", "FUNCTIONS_WORKER_RUNTIME": "java", "AzureWebJobsDashboard": "", "FUNCTIONS_WORKER_JAVA_LOAD_APP_LIBS": 1 }, "Host": { "LocalHttpPort": 7072 } }
The env variable FUNCTIONS_WORKER_JAVA_LOAD_APP_LIBS
seems no effect on local run but only on real azure functions.
Created an issue in Function-Worker repo to triage this: https://github.com/Azure/azure-functions-java-worker/issues/425
\cc @amamounelsayed
Hi @saikirangit could you try the resolution that Ahmed mentioned in the functions-java-worker ticket? If you still run into conflict issue, lets follow up in the same functions-java-worker ticket.
Closing this issue, like the function team suggested, upgrading the core tool unblocked local run. the FUNCTIONS_WORKER_JAVA_LOAD_APP_LIBS is confirmed to work both locally and in functions.
Describe the bug Getting NoSuchMethodError for (io.netty.handler.ssl.SslProvider.isAlpnSupported) when getting secret from key vault, same code working as expected when running as standalone spring boot application.
Exception or Stack Trace [2021-03-10T22:31:21.012Z] Manifest-Version: 1.0 [2021-03-10T22:31:21.012Z] Implementation-Title: Azure Functions Java Worker [2021-03-10T22:31:21.012Z] Implementation-Version: 1.8.1 [2021-03-10T22:31:21.012Z] Built-By: appveyor [2021-03-10T22:31:21.012Z] Created-By: Apache Maven 3.6.0 [2021-03-10T22:31:21.012Z] Build-Jdk: 1.8.0162 [2021-03-10T22:31:21.012Z] Main-Class: com.microsoft.azure.functions.worker.Application [2021-03-10T22:31:21.012Z] Implementation-Vendor: Microsoft Azure [2021-03-10T22:31:21.020Z] 16:31:21.020 [pool-2-thread-1] INFO org.springframework.cloud.function.utils.FunctionClassUtils - Searching for start class in manifest: jar:file:/C:/work/Repositories/personal.eric.li/acord-feed-processor/target/azure-functions/FC-AZ-FA-USC-Dev-acord1/acord-feed-processor-0.0.1-SNAPSHOT.jar!/META-INF/MANIFEST.MF [2021-03-10T22:31:21.021Z] Manifest-Version: 1.0 [2021-03-10T22:31:21.021Z] Implementation-Title: acord-feed-processor [2021-03-10T22:31:21.021Z] Implementation-Version: 0.0.1-SNAPSHOT [2021-03-10T22:31:21.021Z] Build-Jdk-Spec: 1.8 [2021-03-10T22:31:21.021Z] Created-By: Maven Jar Plugin 3.2.0 [2021-03-10T22:31:21.021Z] Main-Class: com.fc.acordfeedprocessor.AcordFeedProcessorApplication [2021-03-10T22:31:21.024Z] 16:31:21.023 [pool-2-thread-1] INFO org.springframework.cloud.function.utils.FunctionClassUtils - Loaded Start Class: class com.fc.acordfeedprocessor.AcordFeedProcessorApplication [2021-03-10T22:31:21.024Z] 16:31:21.024 [pool-2-thread-1] INFO org.springframework.cloud.function.utils.FunctionClassUtils - Main class: class com.fc.acordfeedprocessor.AcordFeedProcessorApplication [2021-03-10T22:31:21.025Z] 16:31:21.024 [pool-2-thread-1] INFO org.springframework.cloud.function.context.AbstractSpringFunctionAdapterInitializer - Initializing: class com.fc.acordfeedprocessor.AcordFeedProcessorApplication [2021-03-10T22:31:21.025Z] Java HTTP trigger processed a request. [2021-03-10T22:31:21.026Z] Handler processing a request for: uppercase [2021-03-10T22:31:21.553Z] . ____ [2021-03-10T22:31:21.554Z] /\ / __' () _ \ \ \ \ [2021-03-10T22:31:21.554Z] ( ( )__ | ' | '| | ' \/ _` | \ \ \ \ [2021-03-10T22:31:21.554Z] \/ _)| |)| | | | | || (| | ) ) ) ) [2021-03-10T22:31:21.554Z] ' |__| .|| ||| |\, | / / / / [2021-03-10T22:31:21.554Z] =========|_|==============|__/=//// [2021-03-10T22:31:21.554Z] :: Spring Boot :: (v2.4.3) [2021-03-10T22:31:21.761Z] 2021-03-10 16:31:21.759 INFO 27124 --- [pool-2-thread-1] o.s.boot.SpringApplication : Starting application using Java 1.8.0_261 on FC-877T433 with PID 27124 (C:\work\Repositories\personal.eric.li\acord-feed-processor\target\azure-functions\FC-AZ-FA-USC-Dev-acord1\lib\spring-cloud-function-web-3.1.0.BUILD-SNAPSHOT.jar started by xiang.li in C:\work\Repositories\personal.eric.li\acord-feed-processor\target\azure-functions\FC-AZ-FA-USC-Dev-acord1) [2021-03-10T22:31:21.762Z] 2021-03-10 16:31:21.760 INFO 27124 --- [pool-2-thread-1] o.s.boot.SpringApplication : No active profile set, falling back to default profiles: default [2021-03-10T22:31:22.373Z] 2021-03-10 16:31:22.372 INFO 27124 --- [pool-2-thread-1] o.s.boot.SpringApplication : Started application in 1.076 seconds (JVM running for 13.572) [2021-03-10T22:31:22.377Z] 2021-03-10 16:31:22.376 INFO 27124 --- [pool-2-thread-1] o.s.c.f.c.c.SimpleFunctionRegistry : Looking up function 'function' with acceptedOutputTypes: [] [2021-03-10T22:31:22.380Z] 2021-03-10 16:31:22.379 INFO 27124 --- [pool-2-thread-1] o.s.c.f.c.c.SimpleFunctionRegistry : Looking up function 'consumer' with acceptedOutputTypes: [] [2021-03-10T22:31:22.380Z] 2021-03-10 16:31:22.380 INFO 27124 --- [pool-2-thread-1] o.s.c.f.c.c.SimpleFunctionRegistry : Looking up function 'supplier' with acceptedOutputTypes: [] [2021-03-10T22:31:22.381Z] 2021-03-10 16:31:22.381 INFO 27124 --- [pool-2-thread-1] o.s.c.f.c.c.SimpleFunctionRegistry : Looking up function 'uppercase' with acceptedOutputTypes: [] [2021-03-10T22:31:22.391Z] Handler processing a request for: uppercase [2021-03-10T22:31:22.578Z] com.azure.identity.ClientSecretCredential@47b77d27 [2021-03-10T22:31:22.608Z] 2021-03-10 16:31:22.607 INFO 27124 --- [pool-2-thread-1] c.a.s.k.secrets.SecretAsyncClient : Retrieving secret - connectionpass [2021-03-10T22:31:22.716Z] Executed 'Functions.uppercase' (Failed, Id=92ab19be-8afb-409b-ba1d-6ed563d44c01, Duration=1800ms) [2021-03-10T22:31:22.716Z] System.Private.CoreLib: Exception while executing function: Functions.uppercase. System.Private.CoreLib: Result: Failure Exception: NoSuchMethodError: io.netty.handler.ssl.SslProvider.isAlpnSupported(Lio/netty/handler/ssl/SslProvider;)Z Stack: java.lang.reflect.InvocationTargetException [2021-03-10T22:31:22.716Z] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [2021-03-10T22:31:22.716Z] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [2021-03-10T22:31:22.716Z] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [2021-03-10T22:31:22.716Z] at java.lang.reflect.Method.invoke(Method.java:498) [2021-03-10T22:31:22.716Z] at com.microsoft.azure.functions.worker.broker.JavaMethodInvokeInfo.invoke(JavaMethodInvokeInfo.java:22) [2021-03-10T22:31:22.716Z] at com.microsoft.azure.functions.worker.broker.JavaMethodExecutorImpl.execute(JavaMethodExecutorImpl.java:54) [2021-03-10T22:31:22.716Z] at com.microsoft.azure.functions.worker.broker.JavaFunctionBroker.invokeMethod(JavaFunctionBroker.java:57) [2021-03-10T22:31:22.716Z] at com.microsoft.azure.functions.worker.handler.InvocationRequestHandler.execute(InvocationRequestHandler.java:33) [2021-03-10T22:31:22.716Z] at com.microsoft.azure.functions.worker.handler.InvocationRequestHandler.execute(InvocationRequestHandler.java:10) [2021-03-10T22:31:22.717Z] at com.microsoft.azure.functions.worker.handler.MessageHandler.handle(MessageHandler.java:45) [2021-03-10T22:31:22.717Z] at com.microsoft.azure.functions.worker.JavaWorkerClient$StreamingMessagePeer.lambda$onNext$0(JavaWorkerClient.java:92) [2021-03-10T22:31:22.717Z] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [2021-03-10T22:31:22.717Z] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [2021-03-10T22:31:22.717Z] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [2021-03-10T22:31:22.717Z] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [2021-03-10T22:31:22.717Z] at java.lang.Thread.run(Thread.java:748) [2021-03-10T22:31:22.717Z] Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NoSuchMethodError: io.netty.handler.ssl.SslProvider.isAlpnSupported(Lio/netty/handler/ssl/SslProvider;)Z [2021-03-10T22:31:22.717Z] at org.springframework.cloud.function.adapter.azure.AzureSpringBootRequestHandler.handleRequest(AzureSpringBootRequestHandler.java:99) [2021-03-10T22:31:22.717Z] at com.fc.acordfeedprocessor.function.AcordFeedProcessorHandler.execute(AcordFeedProcessorHandler.java:30) [2021-03-10T22:31:22.717Z] ... 16 more [2021-03-10T22:31:22.717Z] Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodError: io.netty.handler.ssl.SslProvider.isAlpnSupported(Lio/netty/handler/ssl/SslProvider;)Z [2021-03-10T22:31:22.717Z] at org.springframework.cloud.function.adapter.azure.AzureSpringBootRequestHandler.handleRequest(AzureSpringBootRequestHandler.java:99) [2021-03-10T22:31:22.717Z] at org.springframework.cloud.function.adapter.azure.AzureSpringBootRequestHandler.handleRequest(AzureSpringBootRequestHandler.java:83) [2021-03-10T22:31:22.717Z] ... 17 more [2021-03-10T22:31:22.717Z] Caused by: java.lang.NoSuchMethodError: io.netty.handler.ssl.SslProvider.isAlpnSupported(Lio/netty/handler/ssl/SslProvider;)Z [2021-03-10T22:31:22.717Z] at reactor.netty.http.client.HttpClientSecure.(HttpClientSecure.java:72)
[2021-03-10T22:31:22.717Z] at reactor.netty.http.client.HttpClientConnect$MonoHttpConnect.lambda$subscribe$0(HttpClientConnect.java:217)
[2021-03-10T22:31:22.718Z] at reactor.core.publisher.MonoCreate.subscribe(MonoCreate.java:57)
[2021-03-10T22:31:22.718Z] at reactor.core.publisher.FluxRetryWhen.subscribe(FluxRetryWhen.java:76)
[2021-03-10T22:31:22.718Z] at reactor.core.publisher.MonoRetryWhen.subscribeOrReturn(MonoRetryWhen.java:46)
[2021-03-10T22:31:22.718Z] at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:57)
[2021-03-10T22:31:22.718Z] at reactor.netty.http.client.HttpClientConnect$MonoHttpConnect.subscribe(HttpClientConnect.java:269)
[2021-03-10T22:31:22.718Z] at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64)
[2021-03-10T22:31:22.718Z] at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52)
[2021-03-10T22:31:22.718Z] at reactor.core.publisher.Mono.subscribe(Mono.java:4046)
[2021-03-10T22:31:22.718Z] at reactor.core.publisher.Mono.block(Mono.java:1702)
[2021-03-10T22:31:22.718Z] at com.azure.security.keyvault.secrets.SecretClient.getSecretWithResponse(SecretClient.java:173)
[2021-03-10T22:31:22.718Z] at com.azure.security.keyvault.secrets.SecretClient.getSecret(SecretClient.java:152)
[2021-03-10T22:31:22.718Z] at com.fc.acordfeedprocessor.AcordFeedProcessorApplication.getKVSecret(AcordFeedProcessorApplication.java:128)
[2021-03-10T22:31:22.718Z] at com.fc.acordfeedprocessor.AcordFeedProcessorApplication.lambda$uppercase$1(AcordFeedProcessorApplication.java:64)
[2021-03-10T22:31:22.718Z] at org.springframework.cloud.function.context.catalog.SimpleFunctionRegistry$FunctionInvocationWrapper.invokeFunction(SimpleFunctionRegistry.java:503)
[2021-03-10T22:31:22.718Z] at org.springframework.cloud.function.context.catalog.SimpleFunctionRegistry$FunctionInvocationWrapper.lambda$doApply$3(SimpleFunctionRegistry.java:570)
[2021-03-10T22:31:22.718Z] at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:113)
[2021-03-10T22:31:22.718Z] at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:127)
[2021-03-10T22:31:22.718Z] at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2397)
[2021-03-10T22:31:22.718Z] at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.request(FluxMapFuseable.java:169)
[2021-03-10T22:31:22.718Z] at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.request(FluxMapFuseable.java:169)
[2021-03-10T22:31:22.718Z] at reactor.core.publisher.BlockingIterable$SubscriberIterator.onSubscribe(BlockingIterable.java:225)
[2021-03-10T22:31:22.719Z] at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onSubscribe(FluxMapFuseable.java:96)
[2021-03-10T22:31:22.719Z] at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onSubscribe(FluxMapFuseable.java:96)
[2021-03-10T22:31:22.719Z] at reactor.core.publisher.FluxJust.subscribe(FluxJust.java:68)
[2021-03-10T22:31:22.719Z] at reactor.core.publisher.InternalFluxOperator.subscribe(InternalFluxOperator.java:62)
[2021-03-10T22:31:22.719Z] at reactor.core.publisher.BlockingIterable.iterator(BlockingIterable.java:82)
[2021-03-10T22:31:22.719Z] at org.springframework.cloud.function.context.AbstractSpringFunctionAdapterInitializer.result(AbstractSpringFunctionAdapterInitializer.java:209)
[2021-03-10T22:31:22.719Z] at org.springframework.cloud.function.adapter.azure.AzureSpringBootRequestHandler.handleRequest(AzureSpringBootRequestHandler.java:88)
[2021-03-10T22:31:22.719Z] ... 18 more
[2021-03-10T22:31:22.719Z] .
To Reproduce Create spring cloud function and add below dependencies, run the code snippets below as azure function.
POM:
<?xml version="1.0" encoding="UTF-8"?>
Code Snippet Add the code snippet that causes the issue. ClientSecretCredential clientSecretCredential = new ClientSecretCredentialBuilder() .clientId("") .clientSecret("") .tenantId("") .build();
Expected behavior A clear and concise description of what you expected to happen. Secret being retrieved as expected
Screenshots If applicable, add screenshots to help explain your problem.
Setup (please complete the following information):
Additional context Same code works properly when run applicaiton as standalone spring boot app, once it's being run as azure function, getting this exception.
Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report