Skip to content

How to restore IoTEdge gateway after changing the hostname #7500

@rcharalambous

Description

@rcharalambous

Hi,

After successfully deploying my custom modules on a gateway, I changed the hostname and started getting:

configuration has correct URIs for daemon mgmt endpoint - Error SocketError - SocketErrorCode (TimedOut) : Connection timed out One or more errors occurred. (Got bad response: ) caused by: docker returned exit code: 1, stderr = SocketError - SocketErrorCode (TimedOut) : Connection timed out One or more errors occurred. (Got bad response: )

  • The gateway is DPS-provisioned using TPM attestation.
  • I updated /etc/hosts to point to the correct hostname
  • I deleted the contents of the "/var/lib/aziot" directory in hopes that "iotedge config apply" would recreate them, but it didn't pan out the way I hoped
  • gateway runs debian 11
  • iotedge 1.2.10

Running iotedge check --verbose returns:

` Configuration checks (aziot-identity-service)

√ keyd configuration is well-formed - OK
√ certd configuration is well-formed - OK
√ tpmd configuration is well-formed - OK
√ identityd configuration is well-formed - OK
√ daemon configurations up-to-date with config.toml - OK
√ identityd config toml file specifies a valid hostname - OK
‼ aziot-identity-service package is up-to-date - Warning
Installed aziot-identity-service package has version 1.2.6 but 1.4.9 is the latest stable version available.
Please see https://aka.ms/aziot-update-runtime for update instructions.
√ host time is close to reference time - OK
√ preloaded certificates are valid - OK
√ keyd is running - OK
√ certd is running - OK
√ tpmd is running - OK
√ identityd is running - OK
× read all preloaded certificates from the Certificates Service - Error
could not load cert with ID "aziot-edged-trust-bundle"

Caused by:
    parameter "id" has an invalid value
    caused by: not found

√ read all preloaded key pairs from the Keys Service - OK
√ ensure all preloaded certificates match preloaded private keys with the same ID - OK

Connectivity checks (aziot-identity-service)

√ host can connect to and perform TLS handshake with iothub AMQP port - OK
√ host can connect to and perform TLS handshake with iothub HTTPS / WebSockets port - OK
√ host can connect to and perform TLS handshake with iothub MQTT port - OK
√ host can connect to and perform TLS handshake with DPS endpoint - OK

Configuration checks

√ aziot-edged configuration is well-formed - OK
√ configuration up-to-date with config.toml - OK
√ container engine is installed and functional - OK
× configuration has correct URIs for daemon mgmt endpoint - Error
SocketError - SocketErrorCode (ConnectionReset) : Connection reset by peer
One or more errors occurred. (Got bad response: )
caused by: docker returned exit code: 1, stderr = SocketError - SocketErrorCode (ConnectionReset) : Connection reset by peer
One or more errors occurred. (Got bad response: )
‼ aziot-edge package is up-to-date - Warning
Installed IoT Edge daemon has version 1.2.10 but 1.4.41 is the latest stable version available.
Please see https://aka.ms/iotedge-update-runtime for update instructions.
√ container time is close to host time - OK
√ DNS server - OK
√ production readiness: logs policy - OK
√ production readiness: Edge Agent's storage directory is persisted on the host filesystem - OK
√ production readiness: Edge Hub's storage directory is persisted on the host filesystem - OK
√ Agent image is valid and can be pulled from upstream - OK
√ proxy settings are consistent in aziot-edged, aziot-identityd, moby daemon and config.toml - OK

Connectivity checks

√ container on the default network can connect to upstream AMQP port - OK
√ container on the default network can connect to upstream HTTPS / WebSockets port - OK
√ container on the default network can connect to upstream MQTT port - OK
√ container on the IoT Edge module network can connect to upstream AMQP port - OK
√ container on the IoT Edge module network can connect to upstream HTTPS / WebSockets port - OK
√ container on the IoT Edge module network can connect to upstream MQTT port - OK
34 check(s) succeeded.
2 check(s) raised warnings.
2 check(s) raised errors.
`

Reprovisioning the gateway using iotedge system reprovision does not work:

Failed to reprovision: HTTP request error
Error running system command

What is the proper way to restore it to working order under the correct hostname?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions