AWS IoT Device Tester for AWS IoT Greengrass V2 Proxy Configuration

0

I am using IDT v4.5.3 with Greengrass nucleus v2.5.5. Both of the device running IDT and device under test is behind a network proxy. Now my test suite failed at mqttpubsub test case. How can I apply proxy config ?

I am getting the following error log from mqttpubsub/greengrass-test-run.log

ConnectException: "java.net.ConnectException" ModuleProvisionException: "com.aws.greengrass.testing.modules.exception.ModuleProvisionException" RegistrationContextModule: "com.aws.greengrass.testing.modules.RegistrationContextModule" RegistrationSteps: "com.aws.greengrass.testing.features.RegistrationSteps"

Caused by: com.aws.greengrass.testing.modules.exception.ModuleProvisionException: java.net.ConnectException: Connection timed out (Connection timed out) at com.aws.greengrass.testing.modules.RegistrationContextModule.providesRegistrationContext(RegistrationContextModule.java:39) ~[AWSGreengrassV2TestingIDT-1.0.jar:?] at com.aws.greengrass.testing.modules.RegistrationContextModule$$FastClassByGuice$$12589744.GUICE$TRAMPOLINE(<generated>) ~[?:?] at com.aws.greengrass.testing.modules.RegistrationContextModule$$FastClassByGuice$$12589744.apply(<generated>) ~[?:?] at com.google.inject.internal.ProviderMethod$FastClassProviderMethod.doProvision(ProviderMethod.java:260) ~[AWSGreengrassV2TestingIDT-1.0.jar:?] at com.google.inject.internal.ProviderMethod.doProvision(ProviderMethod.java:171) ~[AWSGreengrassV2TestingIDT-1.0.jar:?] at com.google.inject.internal.InternalProviderInstanceBindingImpl$CyclicFactory.provision(InternalProviderInstanceBindingImpl.java:185) ~[AWSGreengrassV2TestingIDT-1.0.jar:?] at com.google.inject.internal.InternalProviderInstanceBindingImpl$CyclicFactory.access$300(InternalProviderInstanceBindingImpl.java:139) ~[AWSGreengrassV2TestingIDT-1.0.jar:?] at com.google.inject.internal.InternalProviderInstanceBindingImpl$CyclicFactory$1.call(InternalProviderInstanceBindingImpl.java:169) ~[AWSGreengrassV2TestingIDT-1.0.jar:?] at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:109) ~[AWSGreengrassV2TestingIDT-1.0.jar:?] at com.aws.greengrass.testing.modules.AWSResourcesCleanupModule$CleanupProvisioner.onProvision(AWSResourcesCleanupModule.java:69) ~[AWSGreengrassV2TestingIDT-1.0.jar:?] at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:117) ~[AWSGreengrassV2TestingIDT-1.0.jar:?] at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:66) ~[AWSGreengrassV2TestingIDT-1.0.jar:?] at com.google.inject.internal.InternalProviderInstanceBindingImpl$CyclicFactory.get(InternalProviderInstanceBindingImpl.java:164) ~[AWSGreengrassV2TestingIDT-1.0.jar:?] at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40) ~[AWSGreengrassV2TestingIDT-1.0.jar:?] at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:169) ~[AWSGreengrassV2TestingIDT-1.0.jar:?] at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:45) ~[AWSGreengrassV2TestingIDT-1.0.jar:?] at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:40) ~[AWSGreengrassV2TestingIDT-1.0.jar:?] at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:60) ~[AWSGreengrassV2TestingIDT-1.0.jar:?] at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:113) ~[AWSGreengrassV2TestingIDT-1.0.jar:?] at com.google.inject.internal.ConstructorInjector.access$000(ConstructorInjector.java:33) ~[AWSGreengrassV2TestingIDT-1.0.jar:?] at com.google.inject.internal.ConstructorInjector$1.call(ConstructorInjector.java:98) ~[AWSGreengrassV2TestingIDT-1.0.jar:?] at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:109) ~[AWSGreengrassV2TestingIDT-1.0.jar:?] at com.aws.greengrass.testing.modules.AWSResourcesCleanupModule$CleanupProvisioner.onProvision(AWSResourcesCleanupModule.java:69) ~[AWSGreengrassV2TestingIDT-1.0.jar:?] at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:117) ~[AWSGreengrassV2TestingIDT-1.0.jar:?] at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:66) ~[AWSGreengrassV2TestingIDT-1.0.jar:?] at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:93) ~[AWSGreengrassV2TestingIDT-1.0.jar:?] at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:296) ~[AWSGreengrassV2TestingIDT-1.0.jar:?] at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40) ~[AWSGreengrassV2TestingIDT-1.0.jar:?] at io.cucumber.guice.SequentialScenarioScope.lambda$scope$0(SequentialScenarioScope.java:38) ~[AWSGreengrassV2TestingIDT-1.0.jar:?] at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:45) ~[AWSGreengrassV2TestingIDT-1.0.jar:?] at com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1100) ~[AWSGreengrassV2TestingIDT-1.0.jar:?]

已提問 2 年前檢視次數 368 次
3 個答案
1

Thanks for answering. Greengrass have no problem running on the device using manual installation with proper proxy configuration. The problem we are having here is AWS IoT Device Tester (IDT) for Greengrass V2 doesn't provide any arguments for us to set proxy config and caused IDT to failed the test suite.

已回答 2 年前
0

Hi, I have the same problem here, trying to run the IDT on a Ubuntu PC which is behind a company proxy. Here is the log

time="2022-10-27T12:23:27+08:00" level=info msg=12:23:27.479 [mqtt] [idt-4421ce1fdfb724ac475d] [ERROR] greengrass/features/mqtt.feature - Failed at step: 'my device is registered as a Thing' time="2022-10-27T12:23:27+08:00" level=info msg=com.google.inject.ProvisionException: Unable to provision, see the following errors: time="2022-10-27T12:23:27+08:00" level=info msg= time="2022-10-27T12:23:27+08:00" level=info msg=1) [Guice/ErrorInCustomProvider]: ModuleProvisionException: UnknownHostException: www.amazontrust.com

Adding the proxy as parameters inputs (-Dhttp.proxyHost=xxxxx -Dhttp.proxyPort=yyyy) in ./tests/GGV2Q_2.4.0/suite/mqtt/mqttpubsub/test.json did not help.

Disassembling RegistrationContextModule.class where the access to www.amazontrust.com seems to happen, I saw this line: L9: getstatic Field java/net/Proxy NO_PROXY Ljava/net/Proxy; I have no knowledge about Java but is seems that the proxy is hard coded to NO_PROXY.

So: do you confirm my understanding that there is no way to configure the proxy through the JAVA flags, and if so, do you have any plan to add the proxy setting support to the IDT?

Thanks!

已回答 2 年前
  • Hi, in the end I give up try to configure IDT to work through proxy and use a proxy redirector to enforce all outbound connection to go through proxy.

    From last time I checked, the latest IDT still doesn't provide arguments to configure proxy. However, it does allow user to run test on a pre-installed Greengrass device. That means you can install Greengrass with proper proxy configuration and perform test through IDT. You can refer to https://docs.aws.amazon.com/greengrass/v2/developerguide/configure-greengrass-core-v2.html#configure-network-proxy on network proxy configuration for Greengrass.

    Btw, if your device running IDT is also behind your company proxy, then you will need a third-party network intercept service to redirect your outbound connection as there is no way to configure the IDT to work through proxy. You can explore on redsocks(https://github.com/darkk/redsocks) if you are running on a Linux system.

0

Hi,

Thanks for reaching out. From the provided logs, it looks like the root cause was a connection timeout so it is likely that there was an endpoint that the device was unable to reach.

You can follow this page on our documentation to configure the network proxy for your Greengrass device. This page contains some additional information regarding the endpoints that the Greengrass device will need to reach in order to perform as expected.

Please follow the above documentation to apply proxy config. Let us know if you may have any other queries.

AWS
支援工程師
Ryan_A
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南