Azure / iotedgehubdev

IoT Edge Hub Dev Tool
Other
87 stars 30 forks source link

Assuemd proxy setting issue when running iotedgehubdev #151

Closed Chubacca73 closed 4 years ago

Chubacca73 commented 5 years ago

Following the guide "debug-in-attach-mode-with-iot-edge-simulator-c-nodejs-java-azure-functions" to setup a development encironemnt for IotEdge devices in Visual Studio Code the following error occures after clicking on deployment.debugtemplate.json and select "Build and Run IoTEdge in Simulator.

 Successfully built d9070d03a2a4
Successfully tagged localhost:5000/testmodule:0.0.11-amd64.debug
SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.

Welcome to iotedgehubdev!
-------------------------
Telemetry
---------
The iotedgehubdev collects usage data in order to improve your experience.
The data is anonymous and does not include commandline argument values.
The data is collected by Microsoft.

You can change your telemetry settings by updating 'collect_telemetry' to 'no' in C:\ProgramData\iotedgehubdev\config\setting.ini

ERROR: Error: HTTPSConnectionPool(host='oss-metco-connected-factory-poc89261.azure-devices.net', port=443): Max retries exceeded with url: /devices/DebugSimulator/modules/$edgeHub?api-version=2018-06-30 (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])")))

As the development environment is behind a corporate proxy we assume that the issue is related. For other tools such as docker or nuget, pip or similar we can set a proxy environement variable but we do not konw if this is possible for the iotedgehubdev as well.

adashen commented 5 years ago

Hi @Chubacca73 do you setup iotedgehubdev before running it? Please try command "Azure IoT Edge: Setup IoT Edge Simulator" in vscode first. And then "Build and Run IoT Edge in Simulator" again?

dieterdp commented 5 years ago

I have the same problem, i installed the lateste VSCode update and this problem started ERROR: for edgeHubDev Cannot start service edgeHubDev: driver failed programming external connectivity on endpoint edgeHubDev (ddbfab2553be625cb5cd58314367b7bdb5cb7ac407fbd66a4eff9fb006af88a2): Error starting userland proxy: mkdir /port/tcp:0.0.0.0:8883:tcp:172.21.0.2:8883: input/output error ERROR: Encountered errors while bringing up the project. ERROR: Error: Error while executing command: docker-compose -f C:\ProgramData\iotedgehubdev\data\data\docker-compose.yml up. Command '['docker-compose', '-f', 'C:\ProgramData\iotedgehubdev\data\data\docker-compose.yml', 'up']' returned non-zero exit status 1.

dieterdp commented 5 years ago

I have the same problem, i installed the lateste VSCode update and this problem started ERROR: for edgeHubDev Cannot start service edgeHubDev: driver failed programming external connectivity on endpoint edgeHubDev (ddbfab2553be625cb5cd58314367b7bdb5cb7ac407fbd66a4eff9fb006af88a2): Error starting userland proxy: mkdir /port/tcp:0.0.0.0:8883:tcp:172.21.0.2:8883: input/output error ERROR: Encountered errors while bringing up the project. ERROR: Error: Error while executing command: docker-compose -f C:\ProgramData\iotedgehubdev\data\data\docker-compose.yml up. Command '['docker-compose', '-f', 'C:\ProgramData\iotedgehubdev\data\data\docker-compose.yml', 'up']' returned non-zero exit status 1.

i did a restart of docker and everyhing was ok again.

Chubacca73 commented 5 years ago

Hi. Thank you for your feedback. Followed your advice. The behaviour remains similar as initially reported. Following for further suggestions. best regards!

adashen commented 5 years ago

@Chubacca73 can you give more info about the language used in your solution and also the container os type? Currently there is an issue in edgeHub realted to proxy. https://github.com/Azure/iotedge/issues/688 and it may related to your scenario.

Besides, to configure the proxy. You need add http_proxy env for edgeHub in deployment manifest "edgeHub": { "type": "docker", "settings": { "image": "mcr.microsoft.com/azureiotedge-hub:1.0", "createOptions": "" }, "env": { "https_proxy": { "value": "https://proxy.example.com:3128" } }, "status": "running", "restartPolicy": "always" }

The reference to config proxy for edge runtime could be found at https://docs.microsoft.com/en-us/azure/iot-edge/how-to-configure-proxy-support

alaendle commented 5 years ago

Well as far as I get it the deplyoment manifest for the edgeHub is only used if the project is started via "Build and Run IoT Edge Solution in Simulator" where everything works as expected; but if the edgeHub is started via "Start IoT Edge Hub Simulator for Single Module" there is no way to inject the environment variables for https_proxy & upstreamprotocol!?

LazarusX commented 5 years ago

@alaendle thanks for the suggestion. Customizing edgeHub options when starting in single module is in our plan (https://github.com/Azure/iotedgehubdev/issues/105). Please stay tuned.

SLdragon commented 4 years ago

Already added this feature