-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[BUG][JAVA SDK]subnet's method "listNetworkInterfaceIPConfigurations" throws an exception in case of Bastion's subnet but it works for normal subnet. #43070
Comments
@weidongxu-microsoft , Could you Please look into this Urgently? |
Would you let me know about the detail of the bastion? (I'd need to be sure I am doing the correct thing to reproduce) azure.networks().manager().serviceClient().getBastionHosts()
.createOrUpdate(rgName, "bastion1weidxu",
new BastionHostInner()
.withLocation(region.toString())
.withIpConfigurations(Collections.singletonList(
new BastionHostIpConfiguration()
.withName("ipconfig1")
.withSubnet(network.subnets().get("AzureBastionSubnet").innerModel())
.withPrivateIpAllocationMethod(IpAllocationMethod.DYNAMIC)
.withPublicIpAddress(new SubResource().withId(publicIpBastion.id()))))); (if you create it via Portal or CLI, also let me know the page or command) Then we call |
PR #43082 |
This is not only happening for Bastion I just saw it failed for one of my normal Vnet, but when I checked the connected device of this Vnet it showed that NIC but when I clicked on that it showed resource not found Exception in thread "main" com.azure.core.management.exception.ManagementException: Status code 404, "{"error":{"code":"ResourceNotFound","message":"The Resource 'Microsoft.Network/networkInterfaces/ENV1913AZ-NIC' under resource group 'ENV1913AZ-RESOURCEGROUP' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix"}}": The Resource 'Microsoft.Network/networkInterfaces/ENV1913AZ-NIC' under resource group 'ENV1913AZ-RESOURCEGROUP' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix |
@weidongxu-microsoft , When are you going to release this fix? ETA and Version, please. This is very critical for us as many customers are impacted due to this. |
The next release would be 2.45.0 this week. I am still thinking what happens to the case that the NIC could not be find. And what SDK should do in such case (throw, or log error). |
@abhishekpankaj54 Is this 404 NIC deleted? Maybe this is a bug for Or maybe you don't have permission to view this NIC? Though I assume it should show 403 instead of 404.. |
@XiaofeiCao , @weidongxu-microsoft , It looks like there are two bugs for me: 1)The UI shows the deleted NIC. "Exception in thread "main" com.azure.core.management.exception.ManagementException: Status code 404, "{"error":{"code":"ResourceNotFound","message":"The Resource 'Microsoft.Network/networkInterfaces/ENV1913AZ-NIC' under resource group 'ENV1913AZ-RESOURCEGROUP' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix"}}": The Resource 'Microsoft.Network/networkInterfaces/ENV1913AZ-NIC' under resource group 'ENV1913AZ-RESOURCEGROUP' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix" @XiaofeiCao , I have the necessary permissions, and if it is a permission issue, then why listNetworkInterfaceIPConfigurations is also throwing the same error 404. |
@weidongxu-microsoft , Are we going to handle both(bastion and normal subnet(deleted NIC)) the cases in the fix? |
Yes, I am also ignoring the 404 on NIC in the fix (log a warning instead). |
@weidongxu-microsoft , Thanks for the Update, please update me once it is released. |
Describe the bug
We use the method listNetworkInterfaceIPConfigurations to list the network interface IP configuration of the subnet but it throws an exception for bastion's subnet. I observed below:
Bastion's Subnet: It does not have an interface and it throws an exception like the below:
Got exception
com.azure.core.management.exception.ManagementException: Status code 404, "{"error":{"code":"ResourceNotFound","message":"The Resource 'Microsoft.Network/networkInterfaces/TESTBASTION' under resource group 'TESTBASTION' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix"}}"
at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:732)
at com.azure.core.implementation.MethodHandleReflectiveInvoker.invokeWithArguments(MethodHandleReflectiveInvoker.java:35)
at com.azure.core.implementation.http.rest.ResponseExceptionConstructorCache.invoke(ResponseExceptionConstructorCache.java:51)
at com.azure.core.implementation.http.rest.RestProxyBase.instantiateUnexpectedException(RestProxyBase.java:356)
at com.azure.core.implementation.http.rest.AsyncRestProxy.lambda$ensureExpectedStatus$1(AsyncRestProxy.java:128)
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:113)
at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2400)
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.request(FluxMapFuseable.java:171)
at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.set(Operators.java:2196)
at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onSubscribe(Operators.java:2070)
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onSubscribe(FluxMapFuseable.java:96)
at reactor.core.publisher.MonoJust.subscribe(MonoJust.java:55)
at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64)
at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:157)
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:129)
at reactor.core.publisher.FluxHide$SuppressFuseableSubscriber.onNext(FluxHide.java:137)
at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:122)
at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79)
at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1839)
at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:151)
at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1839)
at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:151)
Other subnet: Even if we do not have an interface too it does not throw any exception. it simple return an response as null/blank like below:
DEBUG_LOG after listNetworkInterfaceIPConfigurations[]
Exception or Stack Trace
Got exception
com.azure.core.management.exception.ManagementException: Status code 404, "{"error":{"code":"ResourceNotFound","message":"The Resource 'Microsoft.Network/networkInterfaces/TESTBASTION' under resource group 'TESTBASTION' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix"}}"
at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:732)
at com.azure.core.implementation.MethodHandleReflectiveInvoker.invokeWithArguments(MethodHandleReflectiveInvoker.java:35)
at com.azure.core.implementation.http.rest.ResponseExceptionConstructorCache.invoke(ResponseExceptionConstructorCache.java:51)
at com.azure.core.implementation.http.rest.RestProxyBase.instantiateUnexpectedException(RestProxyBase.java:356)
at com.azure.core.implementation.http.rest.AsyncRestProxy.lambda$ensureExpectedStatus$1(AsyncRestProxy.java:128)
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:113)
at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2400)
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.request(FluxMapFuseable.java:171)
at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.set(Operators.java:2196)
at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onSubscribe(Operators.java:2070)
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onSubscribe(FluxMapFuseable.java:96)
at reactor.core.publisher.MonoJust.subscribe(MonoJust.java:55)
at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64)
at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:157)
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:129)
at reactor.core.publisher.FluxHide$SuppressFuseableSubscriber.onNext(FluxHide.java:137)
at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:122)
at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79)
at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1839)
at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:151)
at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1839)
at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:151)
To Reproduce
Just create the bastion and its Vnet and subnet newly write a sample program and use below method
Collection nicIPConfigurations = subnet.listNetworkInterfaceIPConfigurations();
Code Snippet
Collection nicIPConfigurations = subnet.listNetworkInterfaceIPConfigurations();
Expected behavior
it should return null or value but not exception.
Screenshots
If applicable, add screenshots to help explain your problem.
Setup (please complete the following information):
OS: [e.g. iOS]
IDE: [e.g. IntelliJ]
Library/Libraries: [e.g. com.azure:azure-core:1.16.0 (groupId:artifactId:version)] package com.azure.resourcemanager.network.models;
class name:
public interface Subnet extends HasInnerModel, ChildResource {
/**
*/
Collection listNetworkInterfaceIPConfigurations();
Java version: [e.g. 8] java 17
App Server/Environment: [e.g. Tomcat, WildFly, Azure Function, Apache Spark, Databricks, IDE plugin or anything special]
Frameworks: [e.g. Spring Boot, Micronaut, Quarkus, etc]
If you suspect a dependency version mismatch (e.g. you see
NoClassDefFoundError
,NoSuchMethodError
or similar), please check out Troubleshoot dependency version conflict article first. If it doesn't provide solution for the problem, please provide:mvn dependency:tree -Dverbose
)Additional context
Add any other context about the problem here.
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
The text was updated successfully, but these errors were encountered: