Skip to content
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

EdgeAgent does not report environment vars (Proxy Settings, create options) back to IoT hub on first connect #5421

Open
derSchtefan opened this issue Aug 26, 2021 · 3 comments
Labels

Comments

@derSchtefan
Copy link

Background

In an environment with a proxy required to gain outside access, the config.yaml (IoT 1.1) is modified by the person installing the edge device so that the initial edgeAgent docker module creation sets the environment variables https_proxy and UpstreamProtocol: AmqpWs.

This allows the edgeAgent to connect to IoT Hub initially, and report a 417 - Configuration not set.
Any subsequent deployment will need to specify these settings from the cloud side again, making it required to also store the device's proxy settings there.

Expected Behavior

After the initial connection, we expect that the edge agent reports the http_proxy / https_proxy variables that have been set to him in the "reported properties". This way the settings can be retained or honoured when deploying a solution.

Current Behavior

The edge agent logs that it detected the proxy setting, uses the proxy, but does not report those environment variables to the cloud. Any deployment performed subsequently without those exact proxy settings will brick the device, because the edge agent will be overwritten with missing/wrong proxy settings.

Steps to Reproduce

Provide a detailed set of steps to reproduce the bug.

  1. Setup an edge device in a network configuration that requires a proxy
  2. Setup the proxy like specified here https://docs.microsoft.com/en-us/azure/iot-edge/how-to-configure-proxy-support?view=iotedge-2018-06&preserve-view=true
  3. Let the edge Agent connect to IoT hub
  4. Observe that the edge agent logs the proxy to the log file, but does not report the environment variable as being set

Context (Environment)

Device Information

  • Ubuntu 18.04
  • amd64

Runtime Versions

  • iotedge 1.1.1
  • Agent 1.1
@ZacMelendez
Copy link

I have the same error, running IoTEdge 1.0.9, edgeAgent 1.0 & edgeHub 1.0.

edgeAgent does not report any proxy values (https or http), but edgeHub does report them in the IoT Hub.

@micahl micahl added the enhancement New feature or request label Sep 9, 2021
@micahl
Copy link
Contributor

micahl commented Sep 9, 2021

@derSchtefan thank you for the feedback. Restating your expectation to confirm my understanding... proxy settings specified in the config file should always apply to the running edgeAgent. I.e. setting the proxy environment variables in every subsequent deployment manifest shouldn't be necessary. And, those persistent proxy settings should be reported in the portal. Is that correct?

@derSchtefan
Copy link
Author

Yes, that would be perfect. But already simply reporting the value back to the iot hub at the initial startup (when the system enters a 417 - deployment not set) would be an advantage.

Of course, in general, the person installing the edge device will have had to set the proxy in the config files anyway, and unless it is overridden from the cloud, this should always be the proxy used.

Currently it is easy to brick an edge device by deploying an iot solution that has not had the edgeagent properties correctly individualized. The edge agent will lose connection, and will never be able to get the correct manifest.

@pmzara pmzara added 1.1.1 Targeted for 1.1.1 release area:host_configuration labels Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants