Azure / azure-sdk-for-java

This repository is for active development of the Azure SDK for Java. For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/java/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-java.
MIT License
2.3k stars 1.96k forks source link

[BUG] Batch: Can not create pool with AAD authentification #35291

Closed maroony closed 1 week ago

maroony commented 1 year ago

Describe the bug I want to create a pool with a network configuration. Because of this, I have to authenticate through AAD. When I try to create the batch pool I got an NoClassDefFoundError: com/nimbusds/oauth2/sdk/http/CommonContentTypes .

Exception or Stack Trace

Caused by: java.lang.RuntimeException: java.io.IOException: java.lang.NoClassDefFoundError: com/nimbusds/oauth2/sdk/http/CommonContentTypes
 at rx.exceptions.Exceptions.propagate([Exceptions.java:57](vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html))
 at rx.observables.BlockingObservable.blockForSingle([BlockingObservable.java:463](vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html))
 at rx.observables.BlockingObservable.single([BlockingObservable.java:340](vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html))

 at com.microsoft.azure.batch.protocol.implementation.PoolsImpl.add([PoolsImpl.java:758](vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html))
 at com.microsoft.azure.batch.PoolOperations.createPool([PoolOperations.java:461](vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html))
 at com.microsoft.azure.batch.PoolOperations.createPool([PoolOperations.java:436](vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html))

Code Snippet

NetworkConfiguration networkConfiguration = new NetworkConfiguration()
          .withSubnetId(...);

PoolAddParameter poolAddParameter = new PoolAddParameter()
          .withId(...)
          .withNetworkConfiguration(networkConfiguration)...

BatchApplicationTokenCredentials batchApplicationTokenCredentials =
        new BatchApplicationTokenCredentials(endpoint, spId, spSecret, tenantId, null, null);

batchClient = BatchClient.open(batchApplicationTokenCredentials);

batchClient.poolOperations().createPool(poolAddParameter);

Setup:

+- com.fasterxml.jackson.core:jackson-databind:jar:2.13.5:compile
|  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.13.5:compile
|  \- com.fasterxml.jackson.core:jackson-core:jar:2.13.5:compile
+- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.13.5:compile
|  +- (com.fasterxml.jackson.core:jackson-annotations:jar:2.13.5:compile - omitted for duplicate)
|  +- (com.fasterxml.jackson.core:jackson-core:jar:2.13.5:compile - omitted for duplicate)
|  \- (com.fasterxml.jackson.core:jackson-databind:jar:2.13.5:compile - omitted for duplicate)
+- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.13.5:compile
|  +- (com.fasterxml.jackson.core:jackson-core:jar:2.13.5:compile - omitted for duplicate)
|  \- (com.fasterxml.jackson.core:jackson-databind:jar:2.13.5:compile - omitted for duplicate)
+- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.13.5:compile
|  +- (com.fasterxml.jackson.core:jackson-databind:jar:2.13.5:compile - omitted for duplicate)
|  +- org.yaml:snakeyaml:jar:1.31:compile
|  \- (com.fasterxml.jackson.core:jackson-core:jar:2.13.5:compile - omitted for duplicate)
+- org.apache.commons:commons-text:jar:1.10.0:compile
|  \- org.apache.commons:commons-lang3:jar:3.12.0:compile
+- com.azure:azure-identity:jar:1.9.1:compile
|  +- com.azure:azure-core:jar:1.40.0:compile
|  |  +- com.azure:azure-json:jar:1.0.1:compile
|  |  +- (com.fasterxml.jackson.core:jackson-annotations:jar:2.13.5:compile - omitted for duplicate)
|  |  +- (com.fasterxml.jackson.core:jackson-core:jar:2.13.5:compile - omitted for duplicate)
|  |  +- (com.fasterxml.jackson.core:jackson-databind:jar:2.13.5:compile - omitted for duplicate)
|  |  +- (com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.13.5:compile - omitted for duplicate)
|  |  +- (org.slf4j:slf4j-api:jar:2.0.7:compile - version managed from 1.7.36; omitted for duplicate)
|  |  +- (com.google.code.findbugs:jsr305:jar:3.0.2:provided - omitted for duplicate)
|  |  \- io.projectreactor:reactor-core:jar:3.4.29:compile
|  |     \- org.reactivestreams:reactive-streams:jar:1.0.4:compile
|  +- com.azure:azure-core-http-netty:jar:1.13.4:compile
|  |  +- (com.azure:azure-core:jar:1.40.0:compile - omitted for duplicate)
|  |  +- io.netty:netty-handler:jar:4.1.91.Final:compile
|  |  |  +- (io.netty:netty-common:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  +- io.netty:netty-resolver:jar:4.1.91.Final:compile
|  |  |  |  \- (io.netty:netty-common:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  +- (io.netty:netty-buffer:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  +- io.netty:netty-transport:jar:4.1.91.Final:compile
|  |  |  |  +- (io.netty:netty-common:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  |  +- (io.netty:netty-buffer:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  |  \- (io.netty:netty-resolver:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  +- (io.netty:netty-transport-native-unix-common:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  \- (io.netty:netty-codec:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  +- io.netty:netty-handler-proxy:jar:4.1.91.Final:compile
|  |  |  +- (io.netty:netty-common:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  +- (io.netty:netty-buffer:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  +- (io.netty:netty-transport:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  +- (io.netty:netty-codec:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  +- io.netty:netty-codec-socks:jar:4.1.91.Final:compile
|  |  |  |  +- (io.netty:netty-common:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  |  +- (io.netty:netty-buffer:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  |  +- (io.netty:netty-transport:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  |  \- (io.netty:netty-codec:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  \- (io.netty:netty-codec-http:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  +- io.netty:netty-buffer:jar:4.1.91.Final:compile
|  |  |  \- (io.netty:netty-common:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  +- io.netty:netty-codec:jar:4.1.91.Final:compile
|  |  |  +- (io.netty:netty-common:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  +- (io.netty:netty-buffer:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  \- (io.netty:netty-transport:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  +- io.netty:netty-codec-http:jar:4.1.91.Final:compile
|  |  |  +- (io.netty:netty-common:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  +- (io.netty:netty-buffer:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  +- (io.netty:netty-transport:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  +- (io.netty:netty-codec:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  \- (io.netty:netty-handler:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  +- io.netty:netty-codec-http2:jar:4.1.91.Final:compile
|  |  |  +- (io.netty:netty-common:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  +- (io.netty:netty-buffer:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  +- (io.netty:netty-transport:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  +- (io.netty:netty-codec:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  +- (io.netty:netty-handler:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  \- (io.netty:netty-codec-http:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  +- io.netty:netty-transport-native-unix-common:jar:4.1.91.Final:compile
|  |  |  +- (io.netty:netty-common:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  +- (io.netty:netty-buffer:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  \- (io.netty:netty-transport:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  +- io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.91.Final:compile
|  |  |  +- (io.netty:netty-common:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  +- (io.netty:netty-buffer:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  +- (io.netty:netty-transport:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  +- (io.netty:netty-transport-native-unix-common:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  \- io.netty:netty-transport-classes-epoll:jar:4.1.91.Final:compile
|  |  |     +- (io.netty:netty-common:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |     +- (io.netty:netty-buffer:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |     +- (io.netty:netty-transport:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |     \- (io.netty:netty-transport-native-unix-common:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  +- io.netty:netty-transport-native-kqueue:jar:osx-x86_64:4.1.91.Final:compile
|  |  |  +- (io.netty:netty-common:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  +- (io.netty:netty-buffer:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  +- (io.netty:netty-transport:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  +- (io.netty:netty-transport-native-unix-common:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  \- io.netty:netty-transport-classes-kqueue:jar:4.1.91.Final:compile
|  |  |     +- (io.netty:netty-common:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |     +- (io.netty:netty-buffer:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |     +- (io.netty:netty-transport:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |     \- (io.netty:netty-transport-native-unix-common:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  +- io.netty:netty-tcnative-boringssl-static:jar:2.0.59.Final:compile
|  |  |  +- io.netty:netty-tcnative-classes:jar:2.0.59.Final:compile
|  |  |  +- io.netty:netty-tcnative-boringssl-static:jar:linux-x86_64:2.0.59.Final:compile
|  |  |  |  +- (io.netty:netty-tcnative-boringssl-static:jar:linux-aarch_64:2.0.59.Final:compile - omitted for duplicate)
|  |  |  |  +- (io.netty:netty-tcnative-boringssl-static:jar:osx-x86_64:2.0.59.Final:compile - omitted for duplicate)
|  |  |  |  +- (io.netty:netty-tcnative-boringssl-static:jar:osx-aarch_64:2.0.59.Final:compile - omitted for duplicate)
|  |  |  |  \- (io.netty:netty-tcnative-boringssl-static:jar:windows-x86_64:2.0.59.Final:compile - omitted for duplicate)
|  |  |  +- io.netty:netty-tcnative-boringssl-static:jar:linux-aarch_64:2.0.59.Final:compile
|  |  |  |  +- (io.netty:netty-tcnative-boringssl-static:jar:linux-x86_64:2.0.59.Final:compile - omitted for duplicate)
|  |  |  |  +- (io.netty:netty-tcnative-boringssl-static:jar:osx-x86_64:2.0.59.Final:compile - omitted for duplicate)
|  |  |  |  +- (io.netty:netty-tcnative-boringssl-static:jar:osx-aarch_64:2.0.59.Final:compile - omitted for duplicate)
|  |  |  |  \- (io.netty:netty-tcnative-boringssl-static:jar:windows-x86_64:2.0.59.Final:compile - omitted for duplicate)
|  |  |  +- io.netty:netty-tcnative-boringssl-static:jar:osx-x86_64:2.0.59.Final:compile
|  |  |  |  +- (io.netty:netty-tcnative-boringssl-static:jar:linux-x86_64:2.0.59.Final:compile - omitted for duplicate)
|  |  |  |  +- (io.netty:netty-tcnative-boringssl-static:jar:linux-aarch_64:2.0.59.Final:compile - omitted for duplicate)
|  |  |  |  +- (io.netty:netty-tcnative-boringssl-static:jar:osx-aarch_64:2.0.59.Final:compile - omitted for duplicate)
|  |  |  |  \- (io.netty:netty-tcnative-boringssl-static:jar:windows-x86_64:2.0.59.Final:compile - omitted for duplicate)
|  |  |  +- io.netty:netty-tcnative-boringssl-static:jar:osx-aarch_64:2.0.59.Final:compile
|  |  |  |  +- (io.netty:netty-tcnative-boringssl-static:jar:linux-x86_64:2.0.59.Final:compile - omitted for duplicate)
|  |  |  |  +- (io.netty:netty-tcnative-boringssl-static:jar:linux-aarch_64:2.0.59.Final:compile - omitted for duplicate)
|  |  |  |  +- (io.netty:netty-tcnative-boringssl-static:jar:osx-x86_64:2.0.59.Final:compile - omitted for duplicate)
|  |  |  |  \- (io.netty:netty-tcnative-boringssl-static:jar:windows-x86_64:2.0.59.Final:compile - omitted for duplicate)
|  |  |  \- io.netty:netty-tcnative-boringssl-static:jar:windows-x86_64:2.0.59.Final:compile
|  |  |     +- (io.netty:netty-tcnative-boringssl-static:jar:linux-x86_64:2.0.59.Final:compile - omitted for duplicate)
|  |  |     +- (io.netty:netty-tcnative-boringssl-static:jar:linux-aarch_64:2.0.59.Final:compile - omitted for duplicate)
|  |  |     +- (io.netty:netty-tcnative-boringssl-static:jar:osx-x86_64:2.0.59.Final:compile - omitted for duplicate)
|  |  |     \- (io.netty:netty-tcnative-boringssl-static:jar:osx-aarch_64:2.0.59.Final:compile - omitted for duplicate)
|  |  +- io.projectreactor.netty:reactor-netty-http:jar:1.0.31:compile
|  |  |  +- (io.netty:netty-codec-http:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  +- (io.netty:netty-codec-http2:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  +- io.netty:netty-resolver-dns:jar:4.1.91.Final:compile
|  |  |  |  +- (io.netty:netty-common:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  |  +- (io.netty:netty-buffer:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  |  +- (io.netty:netty-resolver:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  |  +- (io.netty:netty-transport:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  |  +- (io.netty:netty-codec:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  |  +- io.netty:netty-codec-dns:jar:4.1.91.Final:compile
|  |  |  |  |  +- (io.netty:netty-common:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  |  |  +- (io.netty:netty-buffer:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  |  |  +- (io.netty:netty-transport:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  |  |  \- (io.netty:netty-codec:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  |  \- (io.netty:netty-handler:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  +- io.netty:netty-resolver-dns-native-macos:jar:osx-x86_64:4.1.91.Final:compile
|  |  |  |  \- io.netty:netty-resolver-dns-classes-macos:jar:4.1.91.Final:compile
|  |  |  |     +- (io.netty:netty-common:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  |     +- (io.netty:netty-resolver-dns:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  |     \- (io.netty:netty-transport-native-unix-common:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  +- (io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.91.Final:compile - omitted for duplicate)
|  |  |  +- io.projectreactor.netty:reactor-netty-core:jar:1.0.31:compile
|  |  |  |  +- (io.netty:netty-handler:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  |  +- (io.netty:netty-handler-proxy:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  |  +- (io.netty:netty-resolver-dns:jar:4.1.91.Final:compile - omitted for duplicate)
|  |  |  |  +- (io.netty:netty-resolver-dns-native-macos:jar:osx-x86_64:4.1.91.Final:compile - omitted for duplicate)
|  |  |  |  +- (io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.91.Final:compile - omitted for duplicate)
|  |  |  |  \- (io.projectreactor:reactor-core:jar:3.4.29:compile - omitted for duplicate)
|  |  |  \- (io.projectreactor:reactor-core:jar:3.4.29:compile - omitted for duplicate)
|  |  \- io.netty:netty-common:jar:4.1.91.Final:compile
|  |     +- org.graalvm.nativeimage:svm:jar:19.3.6:provided
|  |     \- org.jetbrains:annotations-java5:jar:23.0.0:provided
|  +- com.microsoft.azure:msal4j:jar:1.13.8:compile
|  |  +- com.nimbusds:oauth2-oidc-sdk:jar:10.7.1:compile
|  |  |  +- com.github.stephenc.jcip:jcip-annotations:jar:1.0-1:compile
|  |  |  +- com.nimbusds:content-type:jar:2.2:compile
|  |  |  +- (net.minidev:json-smart:jar:1.3.3:compile - omitted for conflict with 2.4.10)
|  |  |  +- com.nimbusds:lang-tag:jar:1.7:compile
|  |  |  \- com.nimbusds:nimbus-jose-jwt:jar:9.30.2:compile
|  |  |     \- (com.github.stephenc.jcip:jcip-annotations:jar:1.0-1:compile - omitted for duplicate)
|  |  +- net.minidev:json-smart:jar:2.4.10:compile
|  |  |  \- net.minidev:accessors-smart:jar:2.4.9:compile
|  |  |     \- (org.ow2.asm:asm:jar:9.3:compile - omitted for conflict with 9.5)
|  |  +- (org.slf4j:slf4j-api:jar:2.0.7:compile - version managed from 1.7.36; omitted for duplicate)
|  |  +- org.projectlombok:lombok:jar:1.18.6:provided
|  |  \- (com.fasterxml.jackson.core:jackson-databind:jar:2.13.4.2:compile - omitted for conflict with 2.13.5)
|  +- com.microsoft.azure:msal4j-persistence-extension:jar:1.2.0:compile
|  |  +- (com.microsoft.azure:msal4j:jar:1.4.0:compile - omitted for conflict with 1.13.8)
|  |  +- net.java.dev.jna:jna:jar:5.13.0:compile
|  |  +- (net.java.dev.jna:jna-platform:jar:5.13.0:compile - omitted for conflict with 5.6.0)
|  |  \- (org.slf4j:slf4j-api:jar:2.0.7:compile - version managed from 1.7.7; omitted for duplicate)
|  \- net.java.dev.jna:jna-platform:jar:5.6.0:compile
|     \- (net.java.dev.jna:jna:jar:5.6.0:compile - omitted for conflict with 5.13.0)
+- com.azure.resourcemanager:azure-resourcemanager:jar:2.27.0:compile
|  +- com.azure.resourcemanager:azure-resourcemanager-resources:jar:2.27.0:compile
|  |  +- (com.azure:azure-core:jar:1.39.0:compile - omitted for conflict with 1.40.0)
|  |  \- com.azure:azure-core-management:jar:1.11.1:compile
|  |     \- (com.azure:azure-core:jar:1.39.0:compile - omitted for conflict with 1.40.0)
|  +- com.azure.resourcemanager:azure-resourcemanager-storage:jar:2.27.0:compile
|  |  \- (com.azure.resourcemanager:azure-resourcemanager-resources:jar:2.27.0:compile - omitted for duplicate)
|  +- com.azure.resourcemanager:azure-resourcemanager-compute:jar:2.27.0:compile
|  |  +- (com.azure.resourcemanager:azure-resourcemanager-resources:jar:2.27.0:compile - omitted for duplicate)
|  |  +- (com.azure.resourcemanager:azure-resourcemanager-storage:jar:2.27.0:compile - omitted for duplicate)
|  |  +- (com.azure.resourcemanager:azure-resourcemanager-network:jar:2.27.0:compile - omitted for duplicate)
|  |  +- (com.azure.resourcemanager:azure-resourcemanager-msi:jar:2.27.0:compile - omitted for duplicate)
|  |  \- (com.azure.resourcemanager:azure-resourcemanager-authorization:jar:2.27.0:compile - omitted for duplicate)
|  +- com.azure.resourcemanager:azure-resourcemanager-network:jar:2.27.0:compile
|  |  \- (com.azure.resourcemanager:azure-resourcemanager-resources:jar:2.27.0:compile - omitted for duplicate)
|  +- com.azure.resourcemanager:azure-resourcemanager-keyvault:jar:2.27.0:compile
|  |  +- (com.azure.resourcemanager:azure-resourcemanager-resources:jar:2.27.0:compile - omitted for duplicate)
|  |  +- (com.azure.resourcemanager:azure-resourcemanager-authorization:jar:2.27.0:compile - omitted for duplicate)
|  |  +- com.azure:azure-security-keyvault-keys:jar:4.6.2:compile
|  |  |  \- (com.azure:azure-core:jar:1.39.0:compile - omitted for conflict with 1.40.0)
|  |  \- com.azure:azure-security-keyvault-secrets:jar:4.6.2:compile
|  |     \- (com.azure:azure-core:jar:1.39.0:compile - omitted for conflict with 1.40.0)
|  +- com.azure.resourcemanager:azure-resourcemanager-msi:jar:2.27.0:compile
|  |  +- (com.azure.resourcemanager:azure-resourcemanager-resources:jar:2.27.0:compile - omitted for duplicate)
|  |  \- (com.azure.resourcemanager:azure-resourcemanager-authorization:jar:2.27.0:compile - omitted for duplicate)
|  +- com.azure.resourcemanager:azure-resourcemanager-sql:jar:2.27.0:compile
|  |  +- (com.azure.resourcemanager:azure-resourcemanager-resources:jar:2.27.0:compile - omitted for duplicate)
|  |  \- (com.azure.resourcemanager:azure-resourcemanager-storage:jar:2.27.0:compile - omitted for duplicate)
|  +- com.azure.resourcemanager:azure-resourcemanager-authorization:jar:2.27.0:compile
|  |  \- (com.azure.resourcemanager:azure-resourcemanager-resources:jar:2.27.0:compile - omitted for duplicate)
|  +- com.azure.resourcemanager:azure-resourcemanager-appservice:jar:2.27.0:compile
|  |  +- (com.azure.resourcemanager:azure-resourcemanager-resources:jar:2.27.0:compile - omitted for duplicate)
|  |  +- (com.azure.resourcemanager:azure-resourcemanager-storage:jar:2.27.0:compile - omitted for duplicate)
|  |  +- (com.azure.resourcemanager:azure-resourcemanager-msi:jar:2.27.0:compile - omitted for duplicate)
|  |  +- (com.azure.resourcemanager:azure-resourcemanager-keyvault:jar:2.27.0:compile - omitted for duplicate)
|  |  \- (com.azure.resourcemanager:azure-resourcemanager-dns:jar:2.27.0:compile - omitted for duplicate)
|  +- com.azure.resourcemanager:azure-resourcemanager-cosmos:jar:2.27.0:compile
|  |  \- (com.azure.resourcemanager:azure-resourcemanager-resources:jar:2.27.0:compile - omitted for duplicate)
|  +- com.azure.resourcemanager:azure-resourcemanager-containerservice:jar:2.27.0:compile
|  |  \- (com.azure.resourcemanager:azure-resourcemanager-resources:jar:2.27.0:compile - omitted for duplicate)
|  +- com.azure.resourcemanager:azure-resourcemanager-monitor:jar:2.27.0:compile
|  |  \- (com.azure.resourcemanager:azure-resourcemanager-resources:jar:2.27.0:compile - omitted for duplicate)
|  +- com.azure.resourcemanager:azure-resourcemanager-containerregistry:jar:2.27.0:compile
|  |  \- (com.azure.resourcemanager:azure-resourcemanager-resources:jar:2.27.0:compile - omitted for duplicate)
|  +- com.azure.resourcemanager:azure-resourcemanager-dns:jar:2.27.0:compile
|  |  \- (com.azure.resourcemanager:azure-resourcemanager-resources:jar:2.27.0:compile - omitted for duplicate)
|  +- com.azure.resourcemanager:azure-resourcemanager-appplatform:jar:2.27.0:compile
|  |  +- (com.azure.resourcemanager:azure-resourcemanager-resources:jar:2.27.0:compile - omitted for duplicate)
|  |  \- com.azure:azure-storage-file-share:jar:12.18.1:compile
|  |     +- (com.azure:azure-core:jar:1.39.0:compile - omitted for conflict with 1.40.0)
|  |     +- (com.azure:azure-storage-common:jar:12.21.1:compile - omitted for duplicate)
|  |     +- (com.fasterxml.jackson.dataformat:jackson-dataformat-xml:jar:2.13.5:compile - omitted for duplicate)
|  |     \- (com.google.code.findbugs:jsr305:jar:3.0.2:provided - omitted for duplicate)
|  +- com.azure.resourcemanager:azure-resourcemanager-containerinstance:jar:2.27.0:compile
|  |  +- (com.azure.resourcemanager:azure-resourcemanager-resources:jar:2.27.0:compile - omitted for duplicate)
|  |  +- (com.azure.resourcemanager:azure-resourcemanager-storage:jar:2.27.0:compile - omitted for duplicate)
|  |  +- (com.azure.resourcemanager:azure-resourcemanager-authorization:jar:2.27.0:compile - omitted for duplicate)
|  |  +- (com.azure.resourcemanager:azure-resourcemanager-msi:jar:2.27.0:compile - omitted for duplicate)
|  |  +- (com.azure.resourcemanager:azure-resourcemanager-network:jar:2.27.0:compile - omitted for duplicate)
|  |  \- (com.azure:azure-storage-file-share:jar:12.18.1:compile - omitted for duplicate)
|  +- com.azure.resourcemanager:azure-resourcemanager-privatedns:jar:2.27.0:compile
|  |  \- (com.azure.resourcemanager:azure-resourcemanager-resources:jar:2.27.0:compile - omitted for duplicate)
|  +- com.azure.resourcemanager:azure-resourcemanager-redis:jar:2.27.0:compile
|  |  \- (com.azure.resourcemanager:azure-resourcemanager-resources:jar:2.27.0:compile - omitted for duplicate)
|  +- com.azure.resourcemanager:azure-resourcemanager-eventhubs:jar:2.27.0:compile
|  |  +- (com.azure.resourcemanager:azure-resourcemanager-resources:jar:2.27.0:compile - omitted for duplicate)
|  |  \- (com.azure.resourcemanager:azure-resourcemanager-storage:jar:2.27.0:compile - omitted for duplicate)
|  +- com.azure.resourcemanager:azure-resourcemanager-trafficmanager:jar:2.27.0:compile
|  |  \- (com.azure.resourcemanager:azure-resourcemanager-resources:jar:2.27.0:compile - omitted for duplicate)
|  +- com.azure.resourcemanager:azure-resourcemanager-servicebus:jar:2.27.0:compile
|  |  \- (com.azure.resourcemanager:azure-resourcemanager-resources:jar:2.27.0:compile - omitted for duplicate)
|  +- com.azure.resourcemanager:azure-resourcemanager-cdn:jar:2.27.0:compile
|  |  \- (com.azure.resourcemanager:azure-resourcemanager-resources:jar:2.27.0:compile - omitted for duplicate)
|  \- com.azure.resourcemanager:azure-resourcemanager-search:jar:2.27.0:compile
|     \- (com.azure.resourcemanager:azure-resourcemanager-resources:jar:2.27.0:compile - omitted for duplicate)
+- com.azure:azure-storage-blob:jar:12.22.2:compile
|  +- (com.azure:azure-core:jar:1.39.0:compile - omitted for conflict with 1.40.0)
|  +- (com.azure:azure-core-http-netty:jar:1.13.3:compile - omitted for conflict with 1.13.4)
|  +- com.azure:azure-storage-common:jar:12.21.1:compile
|  |  +- (com.azure:azure-core:jar:1.39.0:compile - omitted for conflict with 1.40.0)
|  |  +- (com.azure:azure-core-http-netty:jar:1.13.3:compile - omitted for conflict with 1.13.4)
|  |  +- (com.fasterxml.jackson.dataformat:jackson-dataformat-xml:jar:2.13.5:compile - omitted for duplicate)
|  |  \- (com.google.code.findbugs:jsr305:jar:3.0.2:provided - omitted for duplicate)
|  +- com.azure:azure-storage-internal-avro:jar:12.7.1:compile
|  |  +- (com.azure:azure-core:jar:1.39.0:compile - omitted for conflict with 1.40.0)
|  |  +- (com.azure:azure-core-http-netty:jar:1.13.3:compile - omitted for conflict with 1.13.4)
|  |  +- (com.azure:azure-storage-common:jar:12.21.1:compile - omitted for duplicate)
|  |  \- (com.fasterxml.jackson.dataformat:jackson-dataformat-xml:jar:2.13.5:compile - omitted for duplicate)
|  +- com.fasterxml.jackson.dataformat:jackson-dataformat-xml:jar:2.13.5:compile
|  |  +- (com.fasterxml.jackson.core:jackson-core:jar:2.13.5:compile - omitted for duplicate)
|  |  +- (com.fasterxml.jackson.core:jackson-annotations:jar:2.13.5:compile - omitted for duplicate)
|  |  +- (com.fasterxml.jackson.core:jackson-databind:jar:2.13.5:compile - omitted for duplicate)
|  |  +- org.codehaus.woodstox:stax2-api:jar:4.2.1:compile
|  |  \- com.fasterxml.woodstox:woodstox-core:jar:6.4.0:compile
|  |     \- (org.codehaus.woodstox:stax2-api:jar:4.2.1:compile - omitted for duplicate)
|  \- com.google.code.findbugs:jsr305:jar:3.0.2:compile
+- com.microsoft.azure:azure-batch:jar:10.1.0:compile
|  +- com.microsoft.azure:azure-client-runtime:jar:1.7.14:compile
|  |  \- com.microsoft.rest:client-runtime:jar:1.7.14:compile
|  |     +- (com.google.guava:guava:jar:20.0:compile - omitted for conflict with 31.1-jre)
|  |     +- com.squareup.retrofit2:retrofit:jar:2.6.4:compile
|  |     |  +- (com.squareup.okhttp3:okhttp:jar:3.12.0:compile - omitted for conflict with 3.12.12)
|  |     |  \- (com.google.code.findbugs:jsr305:jar:3.0.2:provided - omitted for duplicate)
|  |     +- com.squareup.okhttp3:okhttp:jar:3.12.12:compile
|  |     |  +- com.squareup.okio:okio:jar:1.15.0:compile
|  |     |  |  \- (com.google.code.findbugs:jsr305:jar:3.0.2:provided - omitted for duplicate)
|  |     |  +- org.conscrypt:conscrypt-openjdk-uber:jar:1.4.0:provided
|  |     |  +- org.robolectric:android-all:jar:10-robolectric-5803371:provided
|  |     |  +- (com.google.code.findbugs:jsr305:jar:3.0.2:provided - omitted for duplicate)
|  |     |  \- org.codehaus.mojo:animal-sniffer-annotations:jar:1.17:provided
|  |     +- com.squareup.okhttp3:logging-interceptor:jar:3.12.12:compile
|  |     |  +- (com.squareup.okhttp3:okhttp:jar:3.12.12:compile - omitted for duplicate)
|  |     |  \- (com.google.code.findbugs:jsr305:jar:3.0.2:provided - omitted for duplicate)
|  |     +- com.squareup.okhttp3:okhttp-urlconnection:jar:3.12.12:compile
|  |     |  +- (com.google.code.findbugs:jsr305:jar:3.0.2:provided - omitted for duplicate)
|  |     |  \- (com.squareup.okhttp3:okhttp:jar:3.12.12:compile - omitted for duplicate)
|  |     +- com.squareup.retrofit2:converter-jackson:jar:2.6.4:compile
|  |     |  +- (com.squareup.retrofit2:retrofit:jar:2.6.4:compile - omitted for duplicate)
|  |     |  +- (com.fasterxml.jackson.core:jackson-databind:jar:2.9.8:compile - omitted for conflict with 2.13.5)
|  |     |  \- (com.google.code.findbugs:jsr305:jar:3.0.2:provided - omitted for duplicate)
|  |     +- com.fasterxml.jackson.datatype:jackson-datatype-joda:jar:2.10.5:compile
|  |     |  +- (com.fasterxml.jackson.core:jackson-annotations:jar:2.10.5:compile - omitted for conflict with 2.13.5)
|  |     |  +- (com.fasterxml.jackson.core:jackson-core:jar:2.10.5:compile - omitted for conflict with 2.13.5)
|  |     |  +- (com.fasterxml.jackson.core:jackson-databind:jar:2.10.5:compile - omitted for conflict with 2.13.5)
|  |     |  \- joda-time:joda-time:jar:2.9.9:compile
|  |     +- (org.apache.commons:commons-lang3:jar:3.4:compile - omitted for conflict with 3.12.0)
|  |     +- io.reactivex:rxjava:jar:1.3.8:compile
|  |     +- com.squareup.retrofit2:adapter-rxjava:jar:2.6.4:compile
|  |     |  +- (com.squareup.retrofit2:retrofit:jar:2.6.4:compile - omitted for duplicate)
|  |     |  +- (io.reactivex:rxjava:jar:1.3.0:compile - omitted for conflict with 1.3.8)
|  |     |  \- (com.google.code.findbugs:jsr305:jar:3.0.2:provided - omitted for duplicate)
|  |     +- (org.slf4j:slf4j-api:jar:2.0.7:compile - version managed from 1.7.22; omitted for duplicate)
|  |     \- com.microsoft.azure:azure-annotations:jar:1.10.0:compile
|  +- com.microsoft.azure:adal4j:jar:1.6.5:compile
|  |  +- javax.servlet:javax.servlet-api:jar:4.0.1:provided
|  |  +- (com.nimbusds:oauth2-oidc-sdk:jar:6.5:compile - omitted for conflict with 10.7.1)
|  |  +- com.google.code.gson:gson:jar:2.8.0:compile
|  |  +- (org.slf4j:slf4j-api:jar:2.0.7:compile - version managed from 1.7.21; omitted for duplicate)
|  |  +- (commons-codec:commons-codec:jar:1.14:compile - omitted for conflict with 1.15)
|  |  \- (org.apache.commons:commons-lang3:jar:3.5:compile - omitted for conflict with 3.12.0)
|  \- commons-codec:commons-codec:jar:1.15:compile
+- org.apache.commons:commons-compress:jar:1.23.0:compile
|  \- org.osgi:org.osgi.core:jar:6.0.0:provided
+- com.google.cloud.tools:jib-core:jar:0.24.0:compile
|  +- com.google.cloud.tools:jib-build-plan:jar:0.4.0:compile
|  +- com.google.http-client:google-http-client:jar:1.42.2:runtime
|  |  +- org.apache.httpcomponents:httpclient:jar:4.5.13:runtime
|  |  |  +- (org.apache.httpcomponents:httpcore:jar:4.4.13:runtime - omitted for conflict with 4.4.15)
|  |  |  +- commons-logging:commons-logging:jar:1.2:runtime
|  |  |  \- (commons-codec:commons-codec:jar:1.11:runtime - omitted for conflict with 1.15)
|  |  +- org.apache.httpcomponents:httpcore:jar:4.4.15:runtime
|  |  +- (com.google.code.findbugs:jsr305:jar:3.0.2:runtime - omitted for duplicate)
|  |  +- (com.google.guava:guava:jar:30.1.1-android:runtime - omitted for conflict with 31.1-jre)
|  |  +- com.google.j2objc:j2objc-annotations:jar:1.3:compile
|  |  +- io.opencensus:opencensus-api:jar:0.31.1:runtime
|  |  |  \- io.grpc:grpc-context:jar:1.27.2:runtime
|  |  \- io.opencensus:opencensus-contrib-http-util:jar:0.31.1:runtime
|  |     +- (io.opencensus:opencensus-api:jar:0.31.1:runtime - omitted for duplicate)
|  |     \- (com.google.guava:guava:jar:29.0-android:runtime - omitted for conflict with 31.1-jre)
|  +- com.google.http-client:google-http-client-apache-v2:jar:1.42.2:runtime
|  |  +- (com.google.http-client:google-http-client:jar:1.42.2:runtime - omitted for duplicate)
|  |  +- (org.apache.httpcomponents:httpclient:jar:4.5.13:runtime - omitted for duplicate)
|  |  \- (org.apache.httpcomponents:httpcore:jar:4.4.15:runtime - omitted for duplicate)
|  +- com.google.auth:google-auth-library-oauth2-http:jar:1.10.0:runtime
|  |  +- com.google.auto.value:auto-value-annotations:jar:1.9:runtime
|  |  +- (com.google.code.findbugs:jsr305:jar:3.0.2:runtime - omitted for duplicate)
|  |  +- com.google.auth:google-auth-library-credentials:jar:1.10.0:runtime
|  |  +- (com.google.http-client:google-http-client:jar:1.42.2:runtime - omitted for duplicate)
|  |  +- com.google.http-client:google-http-client-gson:jar:1.42.2:runtime
|  |  |  +- (com.google.http-client:google-http-client:jar:1.42.2:runtime - omitted for duplicate)
|  |  |  \- (com.google.code.gson:gson:jar:2.9.0:runtime - omitted for conflict with 2.8.0)
|  |  \- (com.google.guava:guava:jar:31.0.1-android:runtime - omitted for conflict with 31.1-jre)
|  +- (org.apache.commons:commons-compress:jar:1.21:runtime - omitted for conflict with 1.23.0)
|  +- com.google.guava:guava:jar:31.1-jre:compile
|  |  +- com.google.guava:failureaccess:jar:1.0.1:compile
|  |  +- com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:compile
|  |  +- (com.google.code.findbugs:jsr305:jar:3.0.2:compile - omitted for duplicate)
|  |  +- org.checkerframework:checker-qual:jar:3.12.0:compile
|  |  +- com.google.errorprone:error_prone_annotations:jar:2.11.0:compile
|  |  \- (com.google.j2objc:j2objc-annotations:jar:1.3:compile - omitted for duplicate)
|  +- (com.fasterxml.jackson.core:jackson-databind:jar:2.15.0:runtime - omitted for conflict with 2.13.5)
|  +- (com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.15.0:runtime - omitted for conflict with 2.13.5)
|  \- org.ow2.asm:asm:jar:9.5:compile
+- org.apache.logging.log4j:log4j-core:jar:2.20.0:compile
|  +- (org.osgi:org.osgi.core:jar:6.0.0:provided - omitted for duplicate)
|  \- (org.apache.logging.log4j:log4j-api:jar:2.20.0:compile - version managed from 2.20.0; omitted for duplicate)
+- org.apache.logging.log4j:log4j-api:jar:2.20.0:compile
|  \- (org.osgi:org.osgi.core:jar:6.0.0:provided - omitted for duplicate)
+- org.apache.logging.log4j:log4j-slf4j2-impl:jar:2.20.0:compile
|  +- (org.apache.logging.log4j:log4j-api:jar:2.20.0:compile - version managed from 2.20.0; omitted for duplicate)
|  +- (org.slf4j:slf4j-api:jar:2.0.7:compile - version managed from 2.0.6; omitted for duplicate)
|  \- (org.apache.logging.log4j:log4j-core:jar:2.20.0:runtime - version managed from 2.20.0; omitted for duplicate)
+- org.slf4j:slf4j-api:jar:2.0.7:compile
\- org.junit.jupiter:junit-jupiter-engine:jar:5.9.2:test
   +- org.junit.platform:junit-platform-engine:jar:1.9.2:test (version managed from 1.9.2)
   |  +- org.opentest4j:opentest4j:jar:1.2.0:test
   |  +- org.junit.platform:junit-platform-commons:jar:1.9.2:test (version managed from 1.9.2)
   |  |  \- (org.apiguardian:apiguardian-api:jar:1.1.2:test - omitted for duplicate)
   |  \- (org.apiguardian:apiguardian-api:jar:1.1.2:test - omitted for duplicate)
   +- org.junit.jupiter:junit-jupiter-api:jar:5.9.2:test (version managed from 5.9.2)
   |  +- (org.opentest4j:opentest4j:jar:1.2.0:test - omitted for duplicate)
   |  +- (org.junit.platform:junit-platform-commons:jar:1.9.2:test - version managed from 1.9.2; omitted for duplicate)
   |  \- (org.apiguardian:apiguardian-api:jar:1.1.2:test - omitted for duplicate)
   \- org.apiguardian:apiguardian-api:jar:1.1.2:test
joshfree commented 1 year ago

Hi @maroony, this sounds like 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:

verbose dependency tree (mvn dependency:tree -Dverbose)

Thanks!

github-actions[bot] commented 1 year ago

Hi @maroony. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

maroony commented 1 year ago

@joshfree I update my initial post with the dependency tree. I already read the troubleshooting guide and checked some things afterwards.

maroony commented 1 year ago

I think the root cause of the problem is the usage of

    <dependency>
      <groupId>com.microsoft.azure</groupId>
      <artifactId>adal4j</artifactId>
      <version>1.6.5</version>
    </dependency>

in sdk

   <dependency>
      <groupId>com.microsoft.azure</groupId>
      <artifactId>azure-batch</artifactId>
      <version>11.0.0</version>
    </dependency>

The adal4j artifact is no longer maintained and should be replaced by

<dependency>
    <groupId>com.microsoft.azure</groupId>
    <artifactId>msal4j</artifactId>
    <version>1.13.8</version>
</dependency>
g2vinay commented 1 year ago

@maroony

It appears you're trying to use track 1 azure-batch together with track 2 azure-resourcemanager and azure-identity They bring in different sets of dependencies into the application for oauth2 sdk resulting in a conflict.

azure-identity uses msal4j while azure-batch uses adal4j.

Potential mitigation routes can be:

  1. If you're not using azure-resourcemanager and azure-identity sdks in your code, you can drop them.
  2. Shade the usage of oauth2 sdk in azure-batch sdk and then use it in your application.
  3. Try pining the oauth2 sdk to use v6.5 in your pom file: com.nimbusds:oauth2-oidc-sdk:jar:6.5

Looking at your use case 2 might be the best possible solution. If you need assistance with following route 2, let me know, I can try to help.

maroony commented 1 year ago

@g2vinay Thanks for your response! I could not drop the library azure-resourcemanager and azure-identity because I need them to create different objects before using azure batch.

I could try proposal 2 and 3. But this is not what I expected as a user of the SDK's. If shading is working right now, there is now assurance that this will work in the future. We need something reliable because this program will be used in an production environment in order to run important recurring work loads.

The azure batch client sdk is using the deprecated library adal4j. Will this library be replaced in the future? Is there a roadmap or something?

g2vinay commented 1 year ago

@maroony

Thank you for the feedback. The ideal solution to this would be to have a T2 azure-batch sdk that works with azure-identity SDK (msal4j underneath). I am looping in Azure Batch SDK owners @jingjlii @ljiaqi1998 @JJJessieWang @dpwatrous @NickKouds to comment on the roadmap for that.

On my end, I can provide full assistance to help you get unblocked with options 2 or 3. You can first try out option 3, if that doesn't work out, then I can help you create a shaded version of azure-batch sdk that is reliable for your production environment.

maroony commented 1 year ago

@g2vinay

At the moment, I'm trying option 3, pinning "com.nimbusds:oauth2-oidc-sdk:jar:6.5. It seems to work to a specific point. But I'm not able to startup up a node with mounted blob storage data:

storageAccount = azureResourceManager.storageAccounts()
        .define(...)
        .withRegion(...)
        .withExistingResourceGroup(.)
        .withBlockBlobStorageAccountKind()
        .withSku(StorageAccountSkuType.PREMIUM_LRS)
        .withAccessFromNetworkSubnet(...)
        .withAccessFromIpAddressRange(...)
        .create();

blobContainer = azureResourceManager.storageBlobContainers()
        .defineContainer(...)
        .withExistingStorageAccount(storageAccount)
        .withPublicAccess(PublicAccess.NONE)
        .create();

  NetworkConfiguration networkConfiguration = new NetworkConfiguration()
      .withSubnetId(...);

  AzureBlobFileSystemConfiguration azureBlobFileSystemConfiguration = new AzureBlobFileSystemConfiguration()
      .withAccountName(...)
      .withAccountKey(...)
      .withContainerName(...)
      .withRelativeMountPath("foo");

  MountConfiguration mountConfiguration = new MountConfiguration()
      .withAzureBlobFileSystemConfiguration(azureBlobFileSystemConfiguration);

  PoolAddParameter poolAddParameter = new PoolAddParameter()
      .withId(...)
      .withVmSize(...)
      .withNetworkConfiguration(networkConfiguration)
      .withTaskSlotsPerNode(...)
      .withVirtualMachineConfiguration(virtualMachineConfiguration)
      .withMountConfiguration(List.of(mountConfiguration))
      .withEnableAutoScale(true)
      .withAutoScaleFormula(autoScaleFormula)
      .withAutoScaleEvaluationInterval(new Period(0, 5, 0, 0));

  batchClient.poolOperations().createPool(poolAddParameter);

With this approach, the node stucks in state "starting" forever - no error log or something. When I remove the networkconfiguration, the node starts but my data was not mounted, because of an access error as expected. So whats going on here? When I check the pool's mount configuration in the azure portal, the column "Account key" is empty. I don't know if this could be the problem. As you can see, I configured the account key.

weidongxu-microsoft commented 1 year ago

For mgmt, you may want to enable logging. And check the log, see whether the JSON request/response is expected.

maroony commented 1 year ago

This is not helpful for my problem, because the pool stucks in starting state and my other objects (storage account, container registry) were created as expected.

weidongxu-microsoft commented 1 year ago

Sorry, I see. So code hangs on line batchClient.poolOperations().createPool(poolAddParameter);, which is the track1 batch data-plane code.

maroony commented 1 year ago

To be precise, my java program stucks in state "waiting for tasks to be finished". So the line batchClient.poolOperations().createPool(poolAddParameter); is executed. After that I'm adding a job with tasks. And yes, all this uses the batch client sdk (track 1 code).

However, my program will never finish because it never gets a single usable node to run the tasks.

weidongxu-microsoft commented 1 year ago

What I am thinking is: the batchClient basically send and receive REST API calls. If your code is executed and control returned to your app, it would mean REST API call is completed successfully, hence backend should have received and acknowledged your "create pool" request.

Logging from the client should help you find whether there is problem with the JSON of the request (it can be compared with your working full track1 app). If there is problem, there maybe caused by Jackson (the one does the serialization of JSON, and track1 / track2 depends on different version of it) when preparing your REST call. If there is no problem in JSON, client likely be good.

However, currently I didn't find where to enable logging in track1 batch client (sorry, not familiar with that client).

One alternative, is call client.poolOperations().getPool(...) (when you done the configure, but not yet wait for the job/tasks that ever get started) to see whether you've created the pool, and whether the data in the response is expected. Or you can use Portal or Azure CLI to inspect the pool (if applicable).

loop in @NickKouds, who be more familiar with batch client https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/batch/microsoft-azure-batch

maroony commented 1 year ago

Actually, this is exactly what do after creating the pool:

pool = batchClient.poolOperations().getPool(...);

Because of this and because I also checked the pool in the portal, the pool creation itself is working fine so far. I checked the pool configuration in the portal and see that autoscaling is working and so on. In the portal I can also see, that a created node never leaves the starting state.

github-actions[bot] commented 1 year ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @mksuni @bgklein @mscurrell @cRui861 @paterasMSFT @gingi @dpwatrous.

weidongxu-microsoft commented 1 year ago

That is strange. Seems client has done everything correct, if portal and client API both gives good result. But the node does not start.

I am looping the backend as well.

weidongxu-microsoft commented 1 year ago

Clarification for backend eng: the current problem is about batch data-plane.

maroony commented 1 year ago

A short summary: In the meantime, I found the root cause of this problem: In order to mount the blob storage on the compute node, a software for this operation is necessary. Because this software is not part of the vm image ubuntu-server-container, the batch service is trying to download it on the node. However, my nodes aren't allowed to connect to the internet. So the download failed. @ Karl Tietze (MS Support): Thanks for looking into this!

It takes a few hours for the batch service in order to recognising this and throw an error! I think this should be improved in the future. Because I need the storage mount, I'll build a custom image for the vm's including the software.

billwert commented 1 week ago

Closing this as it sounds like you have found a workaround, and the root issue for the dependency issue (adal4j and the mixture of microsoft- and azure- packages) is understood.