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

No logs in Azure Application Insights if Azure Functions start fails #44197

Open
franden opened this issue Oct 30, 2024 · 0 comments
Open

No logs in Azure Application Insights if Azure Functions start fails #44197

franden opened this issue Oct 30, 2024 · 0 comments
Labels
area/azure-functions kind/bug Something isn't working

Comments

@franden
Copy link

franden commented Oct 30, 2024

Describe the bug

If Quarkus Azure Function start fails, because of e.g. missing configuration property, there is no logs available in application insights.

Please fix the issue to ensure that such configuration issues can be fixed easily

Expected behavior

The same error output which is visible on local environment must also be available in application insights if quarkus azure function.

Example of the output of started application with java -jar target/aap-name-runner.jar is OK. The reason is clear:

Exception in thread "main" java.lang.ExceptionInInitializerError
        at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized0(Native Method)
        at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized(Unsafe.java:1160)
        at java.base/jdk.internal.reflect.MethodHandleAccessorFactory.ensureClassInitialized(MethodHandleAccessorFactory.java:300)
        at java.base/jdk.internal.reflect.MethodHandleAccessorFactory.newConstructorAccessor(MethodHandleAccessorFactory.java:103)
        at java.base/jdk.internal.reflect.ReflectionFactory.newConstructorAccessor(ReflectionFactory.java:200)
        at java.base/java.lang.reflect.Constructor.acquireConstructorAccessor(Constructor.java:549)
        at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:70)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:44)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:124)
        at io.quarkus.runner.GeneratedMain.main(Unknown Source)
Caused by: java.lang.RuntimeException: Failed to start quarkus
        at io.quarkus.runner.ApplicationImpl.<clinit>(Unknown Source)
        ... 12 more
Caused by: java.lang.RuntimeException: Error injecting java.lang.String org.company.AuthenticationFilter.myCoolProperty      
        at io.quarkus.arc.impl.AbstractSharedContext.createInstanceHandle(AbstractSharedContext.java:119)
        at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:38)
        at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:35)
        at io.quarkus.arc.impl.LazyValue.get(LazyValue.java:32)
        at io.quarkus.arc.impl.ComputingCache.computeIfAbsent(ComputingCache.java:69)
        at io.quarkus.arc.impl.ComputingCacheContextInstances.computeIfAbsent(ComputingCacheContextInstances.java:19)
        at io.quarkus.arc.impl.AbstractSharedContext.get(AbstractSharedContext.java:35)
        at io.quarkus.arc.impl.ArcContainerImpl.beanInstanceHandle(ArcContainerImpl.java:559)
        at io.quarkus.arc.impl.ArcContainerImpl.beanInstanceHandle(ArcContainerImpl.java:539)
        at io.quarkus.arc.impl.ArcContainerImpl.beanInstanceHandle(ArcContainerImpl.java:572)
        at io.quarkus.arc.impl.ArcContainerImpl$3.get(ArcContainerImpl.java:331)
        at io.quarkus.arc.impl.ArcContainerImpl$3.get(ArcContainerImpl.java:328)
        at io.quarkus.arc.runtime.BeanContainerImpl$1.create(BeanContainerImpl.java:58)
        at io.quarkus.resteasy.reactive.common.runtime.ArcBeanFactory.createInstance(ArcBeanFactory.java:27)
        at org.jboss.resteasy.reactive.server.core.startup.RuntimeInterceptorDeployment.createInterceptorInstances(RuntimeInterceptorDeployment.java:159)
        at org.jboss.resteasy.reactive.server.core.startup.RuntimeInterceptorDeployment.<init>(RuntimeInterceptorDeployment.java:65)
        at org.jboss.resteasy.reactive.server.core.startup.RuntimeDeploymentManager.deploy(RuntimeDeploymentManager.java:98)
        at io.quarkus.resteasy.reactive.server.runtime.ResteasyReactiveRecorder.createDeployment(ResteasyReactiveRecorder.java:154)
        at io.quarkus.deployment.steps.ResteasyReactiveProcessor$setupDeployment713137389.deploy_1(Unknown Source)
        at io.quarkus.deployment.steps.ResteasyReactiveProcessor$setupDeployment713137389.deploy(Unknown Source)
        ... 13 more
Caused by: java.util.NoSuchElementException: SRCFG00014: The config property com.company.cool-property is required but it could not be found in any config source
        at io.smallrye.config.SmallRyeConfig.convertValue(SmallRyeConfig.java:436)
        at io.smallrye.config.inject.ConfigProducerUtil.getValue(ConfigProducerUtil.java:100)
        at io.smallrye.config.inject.ConfigProducerUtil.getValue(ConfigProducerUtil.java:60)
        at io.smallrye.config.inject.ConfigProducer.produceStringConfigProperty(ConfigProducer.java:52)
        at io.smallrye.config.inject.ConfigProducer_Subclass.produceStringConfigProperty$$superforward(Unknown Source)
        at io.smallrye.config.inject.ConfigProducer_Subclass$$function$$10.apply(Unknown Source)
        at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:73)
        at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:62)
        at io.quarkus.arc.runtime.ConfigStaticInitCheckInterceptor.aroundInvoke(ConfigStaticInitCheckInterceptor.java:47)
        at io.quarkus.arc.runtime.ConfigStaticInitCheckInterceptor_Bean.intercept(Unknown Source)
        at io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:42)
        at io.quarkus.arc.impl.AroundInvokeInvocationContext.perform(AroundInvokeInvocationContext.java:30)
        at io.quarkus.arc.impl.InvocationContexts.performAroundInvoke(InvocationContexts.java:27)
        at io.smallrye.config.inject.ConfigProducer_Subclass.produceStringConfigProperty(Unknown Source)
        at io.smallrye.config.inject.ConfigProducer_ProducerMethod_produceStringConfigProperty_Slb1-DO4BbQxgDjjOw2BuNv12-I_Bean.doCreate(Unknown Source)
        at io.smallrye.config.inject.ConfigProducer_ProducerMethod_produceStringConfigProperty_Slb1-DO4BbQxgDjjOw2BuNv12-I_Bean.create(Unknown Source)
        at io.smallrye.config.inject.ConfigProducer_ProducerMethod_produceStringConfigProperty_Slb1-DO4BbQxgDjjOw2BuNv12-I_Bean.get(Unknown Source)
        at io.smallrye.config.inject.ConfigProducer_ProducerMethod_produceStringConfigProperty_Slb1-DO4BbQxgDjjOw2BuNv12-I_Bean.get(Unknown Source)
        at io.quarkus.arc.impl.CurrentInjectionPointProvider.get(CurrentInjectionPointProvider.java:48)
        ... 38 more

Actual behavior

In Azure Application Insights log there is no hint why the application is not started. All HTTP Requests will be terminated with a timeout after 5 Minutes. Application insights ends with a message "INFO: HV000001: Hibernate Validator 8.0.1.Final":
Image

How to Reproduce?

  1. create a class with injection of a property
  2. deploy application to Azure as Azure function without setting value for this property
  3. execute a http call to the function
  4. observe the application insights

Output of uname -a or ver

Azure Function with Java 21

Output of java -version

openjdk version "21.0.1" 2023-10-17 LTS OpenJDK Runtime Environment Temurin-21.0.1+12 (build 21.0.1+12-LTS) OpenJDK 64-Bit Server VM Temurin-21.0.1+12 (build 21.0.1+12-LTS, mixed mode, sharing)

Quarkus version or git rev

3.15.1

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

No response

Additional information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/azure-functions kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants