question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Listing of CDN profiles using Java SDK fails when a certain rule in configured via the "Rules Engine"

See original GitHub issue

Here is the code which I am testing with: https://github.com/gkgaurav31/cdn-java-test/blob/master/src/main/java/com/gauk/HelloController.java#L38

It works for a Microsoft CDN - Standard Microsoft.

It throws the following exception after adding any condition/rule for any of the endpoints.

Example:

image

2020-05-25 14:45:42.397 INFO 7152 — [nio-8080-exec-1] c.m.a.m.cdn.Endpoints listByProfile : <-- 200 OK https://management.azure.com/subscriptions/a946fed2-3fea-452e-b222-783faf4eaed9/resourceGroups/EXTRA/providers/Microsoft.Cdn/profiles/gaukcdn/endpoints?api-version=2017-10-12 (1444 ms, unknown-length body) com.fasterxml.jackson.databind.exc.InvalidTypeIdException: Could not resolve type id ‘RequestScheme’ as a subtype of com.microsoft.azure.management.cdn.DeliveryRuleCondition: known type ids = [DeliveryRuleCondition, UrlFileExtension, UrlPath] (for POJO property ‘conditions’) at [Source: (String)“{ “value”:[ { “name”:“thoughts”,“id”:”/subscriptions/a946fed2-3fea-452e-b222-783faf4eaed9/resourcegroups/EXTRA/providers/Microsoft.Cdn/profiles/gaukcdn/endpoints/thoughts",“type”:“Microsoft.Cdn/profiles/endpoints”,“tags”:{

  },"location":"Global","properties":{
    "hostName":"thoughts.azureedge.net","originHostHeader":"thoughts.azurewebsites.net","provisioningState":"Succeeded","resourceState":"Running","isHttpAllowed":true,"isHttpsAllowed":true,"queryStringCa"[truncated 1783 chars]; line: 41, column: 1] (through reference chain: com.microsoft.azure.management.cdn.implementation.PageImpl["value"]->java.util.ArrayList[0]->com.microsoft.azure.management.cdn.implementation.EndpointInner["properties.deliveryPolicy"]->com.microsoft.azure.management.cdn.EndpointPropertiesUpdateParametersDeliveryPolicy["rules"]->java.util.ArrayList[0]->com.microsoft.azure.management.cdn.DeliveryRule["conditions"]->java.util.ArrayList[0])

java.lang.RuntimeException: com.fasterxml.jackson.databind.exc.InvalidTypeIdException: Could not resolve type id ‘RequestScheme’ as a subtype of com.microsoft.azure.management.cdn.DeliveryRuleCondition: known type ids = [DeliveryRuleCondition, UrlFileExtension, UrlPath] (for POJO property ‘conditions’) at [Source: (String)“{ “value”:[ { “name”:“thoughts”,“id”:”/subscriptions/a946fed2-3fea-452e-b222-783faf4eaed9/resourcegroups/EXTRA/providers/Microsoft.Cdn/profiles/gaukcdn/endpoints/thoughts",“type”:“Microsoft.Cdn/profiles/endpoints”,“tags”:{

  },"location":"Global","properties":{
    "hostName":"thoughts.azureedge.net","originHostHeader":"thoughts.azurewebsites.net","provisioningState":"Succeeded","resourceState":"Running","isHttpAllowed":true,"isHttpsAllowed":true,"queryStringCa"[truncated 1783 chars]; line: 41, column: 1] (through reference chain: com.microsoft.azure.management.cdn.implementation.PageImpl["value"]->java.util.ArrayList[0]->com.microsoft.azure.management.cdn.implementation.EndpointInner["properties.deliveryPolicy"]->com.microsoft.azure.management.cdn.EndpointPropertiesUpdateParametersDeliveryPolicy["rules"]->java.util.ArrayList[0]->com.microsoft.azure.management.cdn.DeliveryRule["conditions"]->java.util.ArrayList[0])
    at rx.exceptions.Exceptions.propagate(Exceptions.java:57)
    at rx.observables.BlockingObservable.blockForSingle(BlockingObservable.java:463)
    at rx.observables.BlockingObservable.single(BlockingObservable.java:340)
    at com.microsoft.azure.management.cdn.implementation.EndpointsInner.listByProfile(EndpointsInner.java:162)
    at com.microsoft.azure.management.cdn.implementation.CdnEndpointsImpl.listChildResources(CdnEndpointsImpl.java:75)
    at com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.ExternalChildResourcesCachedImpl.cacheCollection(ExternalChildResourcesCachedImpl.java:180)
    at com.microsoft.azure.management.cdn.implementation.CdnEndpointsImpl.<init>(CdnEndpointsImpl.java:37)
    at com.microsoft.azure.management.cdn.implementation.CdnProfileImpl.<init>(CdnProfileImpl.java:50)
    at com.microsoft.azure.management.cdn.implementation.CdnProfilesImpl.wrapModel(CdnProfilesImpl.java:53)
    at com.microsoft.azure.management.cdn.implementation.CdnProfilesImpl.wrapModel(CdnProfilesImpl.java:29)
    at com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.ReadableWrappersImpl$1.typeConvertAsync(ReadableWrappersImpl.java:35)
    at com.microsoft.azure.management.resources.fluentcore.utils.PagedListConverter$4.call(PagedListConverter.java:91)
    at com.microsoft.azure.management.resources.fluentcore.utils.PagedListConverter$4.call(PagedListConverter.java:88)
    at rx.internal.operators.OnSubscribeMap$MapSubscriber.onNext(OnSubscribeMap.java:69)
    at rx.internal.operators.OnSubscribeFilter$FilterSubscriber.onNext(OnSubscribeFilter.java:76)
    at rx.internal.operators.OnSubscribeFromIterable$IterableProducer.fastPath(OnSubscribeFromIterable.java:173)
    at rx.internal.operators.OnSubscribeFromIterable$IterableProducer.request(OnSubscribeFromIterable.java:86)
    at rx.Subscriber.setProducer(Subscriber.java:211)
    at rx.internal.operators.OnSubscribeMap$MapSubscriber.setProducer(OnSubscribeMap.java:102)
    at rx.internal.operators.OnSubscribeFilter$FilterSubscriber.setProducer(OnSubscribeFilter.java:104)
    at rx.internal.operators.OnSubscribeFromIterable.call(OnSubscribeFromIterable.java:63)
    at rx.internal.operators.OnSubscribeFromIterable.call(OnSubscribeFromIterable.java:34)
    at rx.Observable.unsafeSubscribe(Observable.java:10327)
    at rx.internal.operators.OnSubscribeFilter.call(OnSubscribeFilter.java:45)
    at rx.internal.operators.OnSubscribeFilter.call(OnSubscribeFilter.java:30)
    at rx.Observable.unsafeSubscribe(Observable.java:10327)
    at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:48)
    at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:33)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
    at rx.Observable.unsafeSubscribe(Observable.java:10327)
    at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:48)
    at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:33)
    at rx.Observable.subscribe(Observable.java:10423)
    at rx.Observable.subscribe(Observable.java:10390)
    at rx.observables.BlockingObservable.subscribe(BlockingObservable.java:477)
    at com.microsoft.azure.management.resources.fluentcore.utils.PagedListConverter.loadConvertedList(PagedListConverter.java:100)
    at com.microsoft.azure.management.resources.fluentcore.utils.PagedListConverter.convert(PagedListConverter.java:66)
    at com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.ReadableWrappersImpl.wrapList(ReadableWrappersImpl.java:43)
    at com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.TopLevelModifiableResourcesImpl.list(TopLevelModifiableResourcesImpl.java:118)
    at com.gauk.HelloController.test(HelloController.java:42)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:879)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793)
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:373)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:748)

Caused by: com.fasterxml.jackson.databind.exc.InvalidTypeIdException: Could not resolve type id ‘RequestScheme’ as a subtype of com.microsoft.azure.management.cdn.DeliveryRuleCondition: known type ids = [DeliveryRuleCondition, UrlFileExtension, UrlPath] (for POJO property ‘conditions’) at [Source: (String)“{ “value”:[ { “name”:“thoughts”,“id”:”/subscriptions/a946fed2-3fea-452e-b222-783faf4eaed9/resourcegroups/EXTRA/providers/Microsoft.Cdn/profiles/gaukcdn/endpoints/thoughts",“type”:“Microsoft.Cdn/profiles/endpoints”,“tags”:{

  },"location":"Global","properties":{
    "hostName":"thoughts.azureedge.net","originHostHeader":"thoughts.azurewebsites.net","provisioningState":"Succeeded","resourceState":"Running","isHttpAllowed":true,"isHttpsAllowed":true,"queryStringCa"[truncated 1783 chars]; line: 41, column: 1] (through reference chain: com.microsoft.azure.management.cdn.implementation.PageImpl["value"]->java.util.ArrayList[0]->com.microsoft.azure.management.cdn.implementation.EndpointInner["properties.deliveryPolicy"]->com.microsoft.azure.management.cdn.EndpointPropertiesUpdateParametersDeliveryPolicy["rules"]->java.util.ArrayList[0]->com.microsoft.azure.management.cdn.DeliveryRule["conditions"]->java.util.ArrayList[0])
    at com.fasterxml.jackson.databind.exc.InvalidTypeIdException.from(InvalidTypeIdException.java:43)
    at com.fasterxml.jackson.databind.DeserializationContext.invalidTypeIdException(DeserializationContext.java:1761)
    at com.fasterxml.jackson.databind.DeserializationContext.handleUnknownTypeId(DeserializationContext.java:1268)
    at com.fasterxml.jackson.databind.jsontype.impl.TypeDeserializerBase._handleUnknownTypeId(TypeDeserializerBase.java:290)
    at com.fasterxml.jackson.databind.jsontype.impl.TypeDeserializerBase._findDeserializer(TypeDeserializerBase.java:162)
    at com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer._deserializeTypedForId(AsPropertyTypeDeserializer.java:113)
    at com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer.deserializeTypedFromObject(AsPropertyTypeDeserializer.java:97)
    at com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer.deserializeTypedFromAny(AsPropertyTypeDeserializer.java:193)
    at com.microsoft.rest.serializer.FlatteningDeserializer.deserializeWithType(FlatteningDeserializer.java:110)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:288)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:245)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27)
    at com.fasterxml.jackson.databind.deser.impl.FieldProperty.deserializeAndSet(FieldProperty.java:138)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151)
    at com.microsoft.rest.serializer.FlatteningDeserializer.deserialize(FlatteningDeserializer.java:134)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:286)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:245)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27)
    at com.fasterxml.jackson.databind.deser.impl.FieldProperty.deserializeAndSet(FieldProperty.java:138)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151)
    at com.microsoft.rest.serializer.FlatteningDeserializer.deserialize(FlatteningDeserializer.java:134)
    at com.fasterxml.jackson.databind.deser.impl.FieldProperty.deserializeAndSet(FieldProperty.java:138)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151)
    at com.microsoft.rest.serializer.FlatteningDeserializer.deserialize(FlatteningDeserializer.java:134)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:286)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:245)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27)
    at com.fasterxml.jackson.databind.deser.impl.FieldProperty.deserializeAndSet(FieldProperty.java:138)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151)
    at com.microsoft.rest.serializer.FlatteningDeserializer.deserialize(FlatteningDeserializer.java:134)
    at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4218)
    at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3214)
    at com.microsoft.rest.serializer.JacksonAdapter.deserialize(JacksonAdapter.java:137)
    at com.microsoft.rest.ServiceResponseBuilder.buildBody(ServiceResponseBuilder.java:216)
    at com.microsoft.rest.ServiceResponseBuilder.build(ServiceResponseBuilder.java:110)
    at com.microsoft.azure.AzureResponseBuilder.build(AzureResponseBuilder.java:56)
    at com.microsoft.azure.management.cdn.implementation.EndpointsInner.listByProfileDelegate(EndpointsInner.java:271)
    at com.microsoft.azure.management.cdn.implementation.EndpointsInner.access$000(EndpointsInner.java:47)
    at com.microsoft.azure.management.cdn.implementation.EndpointsInner$5.call(EndpointsInner.java:258)
    at com.microsoft.azure.management.cdn.implementation.EndpointsInner$5.call(EndpointsInner.java:254)
    at rx.internal.operators.OnSubscribeMap$MapSubscriber.onNext(OnSubscribeMap.java:69)
    at retrofit2.adapter.rxjava.CallArbiter.deliverResponse(CallArbiter.java:120)
    at retrofit2.adapter.rxjava.CallArbiter.emitResponse(CallArbiter.java:102)
    at retrofit2.adapter.rxjava.CallExecuteOnSubscribe.call(CallExecuteOnSubscribe.java:46)
    at retrofit2.adapter.rxjava.CallExecuteOnSubscribe.call(CallExecuteOnSubscribe.java:24)
    at rx.Observable.unsafeSubscribe(Observable.java:10327)
    at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:48)
    at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:33)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
    at rx.Observable.subscribe(Observable.java:10423)
    at rx.Observable.subscribe(Observable.java:10390)
    at rx.observables.BlockingObservable.blockForSingle(BlockingObservable.java:443)
    ... 89 more

Caused by: rx.exceptions.OnErrorThrowable$OnNextValue: OnError while emitting onNext value: com.microsoft.azure.management.cdn.implementation.ProfileInner.class at rx.exceptions.OnErrorThrowable.addValueAsLastCause(OnErrorThrowable.java:118) at rx.internal.operators.OnSubscribeMap$MapSubscriber.onNext(OnSubscribeMap.java:73) … 77 more

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
xseeseeseecommented, May 27, 2020

@gkgaurav31 Thanks for clarifying this. It seems some of the Cdn profiles were created from portal/Azure CLI/other SDKs. The RequestScheme is supported in newer API version than our current version. We will plan to upgrade Cdn profile.

cc: @yungezz @weidongxu-microsoft

0reactions
weidongxu-microsoftcommented, Aug 19, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

Securing Azure CDN assets with token authentication
This quickstart shows how to enable Azure CDN by creating a new CDN profile and CDN endpoint. The rules engine allows you to...
Read more >
Configuring Azure CDN HTTP-HTTPS redirection - Medium
By default, CDN will not automatically redirect HTTP requests to HTTPS. However, this can easily be configured using CDN's built-in rules engine.
Read more >
Cisco Firepower Release Notes, Version 6.6 - Security
Bug lists are auto-generated once and are not subsequently updated. Depending on how and when a bug was categorized or updated in our...
Read more >
Configuring Ingress features | Google Kubernetes Engine (GKE)
This page provides a comprehensive overview of what's supported and configurable through Kubernetes Ingress on Google Cloud. Ingress for Google Kubernetes ...
Read more >
Configure service failure detection | Dynatrace Docs
Programming exceptions (Java, . · Error pages provided by many web containers for the handled exceptions. · HTTP 500 – 599 error codes...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found