IoT-Edge EdgeHub模块退避状态

时间:2018-08-31 11:25:44

标签: docker azure-iot-hub azure-iot-edge

我正在尝试将模块部署到物联网边缘设备中,因为我正在遵循这些Official Documentation

  • 已安装IoTHub预订已创建边缘设备 我的本地计算机上的IoTEdge Runtime(以模拟方式运行) 设备)
  • 适用于Windows的Docker已安装,启动并正在运行 (直到这里,一切正常,因为我检查了Get-Service iotedge命令的状态)
  • 设置设备模块,并将此mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:1.0用作图像

在Microsoft Azure门户上设置模块后,edgeHub模块进入退避状态。我已经看到此问题IOT-Edge Hub back-off state,并尝试按照某些建议的建议重新启动docker,但全部徒劳。 我还运行了docker logs edgeAgent命令,向您显示了一些日志,这些日志随此附在一起。

logs.txt

编辑: 附件是Azure的状态

enter image description here

enter image description here

这是iotedgeruntime的状态

enter image description here

编辑2

我已经在azure上重新创建了iotedge设备,然后在Windows计算机上重新安装了iotedgeruntime。无需创建模块。以下是日志

> iotedge logs edgeAgent

[09/03/2018 10:22:32.855 AM] Edge Agent Main()
2018-09-03 15:22:33.043 +05:00 [INF] - Starting module management agent.
2018-09-03 15:22:33.182 +05:00 [INF] - Version - 1.0.1.15962126 (6e5e86dcf0c9a3732fc72a64d9ec9b0fcb2d6fad)

2018-09-03 15:22:33.298 +05:00 [INF] - Edge agent attempting to connect to IoT Hub via Amqp_Tcp_Only...
2018-09-03 15:22:34.360 +05:00 [INF] - Created persistent store at C:\Users\ContainerAdministrator\AppData\Local\Temp\edgeAgent
2018-09-03 15:22:39.749 +05:00 [WRN] - Empty edge agent config was received. Attempting to read config from backup file (backup.json) instead
2018-09-03 15:22:39.751 +05:00 [INF] - Edge agent config backup file does not exist - backup.json
2018-09-03 15:22:43.239 +05:00 [INF] - Edge agent connected to IoT Hub via Amqp_Tcp_Only.
2018-09-03 15:22:46.031 +05:00 [INF] - Deployment config in edge agent's desired properties is empty.
2018-09-03 15:22:46.050 +05:00 [ERR] - Error refreshing edge agent configuration from twin.
Microsoft.Azure.Devices.Edge.Agent.Core.ConfigSources.ConfigEmptyException: This device has an empty configuration for the edge agent. Please set a deployment manifest.
   at Microsoft.Azure.Devices.Edge.Agent.IoTHub.EdgeAgentConnection.UpdateDeploymentConfig() in C:\agent\_work\1\s\edge-agent\src\Microsoft.Azure.Devices.Edge.Agent.IoTHub\EdgeAgentConnection.cs:line 187
   at Microsoft.Azure.Devices.Edge.Agent.IoTHub.EdgeAgentConnection.RefreshTwinAsync() in C:\agent\_work\1\s\edge-agent\src\Microsoft.Azure.Devices.Edge.Agent.IoTHub\EdgeAgentConnection.cs:line 148

此日志显示EdgeAgent已启动,但是在使用空部署配置时存在问题。所以我创建了一个空的配置。 https://github.com/Azure/iot-edge-v1/issues/441#issuecomment-350824433中提到。然后出现了同样的问题。显示以下命令的日志。

> Get-WinEvent -ea SilentlyContinue `-FilterHashtable @{ProviderName="iotedged";  LogName = "application"; StartTime = [datetime]::Today} |select TimeCreated, Message |sort-object @{Expression="TimeCreated";Descending=$false} |format-table -autosize -wrap

日志文件

 TimeCreated         Message                                                                                                                                                                                                                                      
    -----------         -------                                                                                                                                                                                                                                      
    9/3/2018 3:22:07 PM info: iotedged::app -- Starting Azure IoT Edge Security Daemon                                                                                                                                                                               
    9/3/2018 3:22:07 PM info: iotedged -- Initializing the module runtime...                                                                                                                                                                                         
    9/3/2018 3:22:07 PM info: iotedged -- Using runtime network id nat                                                                                                                                                                                               
    9/3/2018 3:22:07 PM info: iotedged::app -- Version - 1.0.0 (52ef77db24126bf473265fc09c53d35290a2dd6b)                                                                                                                                                            
    9/3/2018 3:22:07 PM info: iotedged::app -- Using config file: C:\ProgramData\iotedge\config.yaml                                                                                                                                                                 
    9/3/2018 3:22:07 PM info: iotedged::windows -- Starting iotedged service.                                                                                                                                                                                        
    9/3/2018 3:22:07 PM info: iotedged -- Configuring C:\ProgramData\iotedge as the home directory.                                                                                                                                                                  
    9/3/2018 3:22:07 PM info: iotedged -- Finished initializing the module runtime.                                                                                                                                                                                  
    9/3/2018 3:22:07 PM info: iotedged -- Transparent gateway certificates not found, operating in quick start mode...                                                                                                                                               
    9/3/2018 3:22:07 PM info: iotedged -- Finished configuring certificates.                                                                                                                                                                                         
    9/3/2018 3:22:07 PM info: iotedged -- Initializing hsm...                                                                                                                                                                                                        
    9/3/2018 3:22:07 PM info: iotedged -- Configuring certificates...                                                                                                                                                                                                
    9/3/2018 3:22:08 PM info: iotedged -- Finished initializing hsm.                                                                                                                                                                                                 
    9/3/2018 3:22:08 PM info: iotedged -- Detecting if configuration file has changed...                                                                                                                                                                             
    9/3/2018 3:22:08 PM info: iotedged -- Change to configuration file detected.                                                                                                                                                                                     
    9/3/2018 3:22:08 PM info: iotedged -- Removing all modules...                                                                                                                                                                                                    
    9/3/2018 3:22:09 PM info: iotedged -- Finished removing modules.                                                                                                                                                                                                 
    9/3/2018 3:22:09 PM info: iotedged -- Provisioning edge device...                                                                                                                                                                                                                                                                            
    9/3/2018 3:28:09 PM info: edgelet_core::watchdog -- Checking edge runtime status                                                                                                                                                                                 
    9/3/2018 3:28:09 PM info: edgelet_core::watchdog -- Edge runtime is running.                                                                                                                                                                                     
    9/3/2018 3:28:12 PM info: edgelet_http::logging -- [mgmt] - - - [2018-09-03 10:28:12.431950 UTC] "GET /modules?api-version=2018-06-28 HTTP/1.1" 200 OK 449 "-" "-" pid(any)                                                                                      
    9/3/2018 3:28:17 PM info: edgelet_http::logging -- [mgmt] - - - [2018-09-03 10:28:17.442486300 UTC] "GET /modules?api-version=2018-06-28 HTTP/1.1" 200 OK 449 "-" "-" pid(any)                                                                                   
    9/3/2018 3:28:22 PM info: edgelet_http::logging -- [mgmt] - - - [2018-09-03 10:28:22.448494200 UTC] "GET /modules?api-version=2018-06-28 HTTP/1.1" 200 OK 449 "-" "-" pid(any)                                                                                   
    9/3/2018 3:28:27 PM info: edgelet_http::logging -- [mgmt] - - - [2018-09-03 10:28:27.469429300 UTC] "GET /modules?api-version=2018-06-28 HTTP/1.1" 200 OK 449 "-" "-" pid(any)                                                                                   
    9/3/2018 3:28:32 PM info: edgelet_http::logging -- [mgmt] - - - [2018-09-03 10:28:32.471719400 UTC] "GET /modules?api-version=2018-06-28 HTTP/1.1" 200 OK 449 "-" "-" pid(any)                                                                                   
    9/3/2018 3:28:37 PM info: edgelet_http::logging -- [mgmt] - - - [2018-09-03 10:28:37.485219700 UTC] "GET /modules?api-version=2018-06-28 HTTP/1.1" 200 OK 449 "-" "-" pid(any)                                                                                   
    9/3/2018 3:28:42 PM info: edgelet_http::logging -- [mgmt] - - - [2018-09-03 10:28:42.500957700 UTC] "GET /modules?api-version=2018-06-28 HTTP/1.1" 200 OK 449 "-" "-" pid(any)                                                                                   
    9/3/2018 3:28:47 PM info: edgelet_http::logging -- [mgmt] - - - [2018-09-03 10:28:47.511517800 UTC] "GET /modules?api-version=2018-06-28 HTTP/1.1" 200 OK 449 "-" "-" pid(any)                                                                                   
    9/3/2018 3:28:52 PM info: edgelet_http::logging -- [mgmt] - - - [2018-09-03 10:28:52.517649100 UTC] "GET /modules?api-version=2018-06-28 HTTP/1.1" 200 OK 449 "-" "-" pid(any)                                                                                   
    9/3/2018 3:28:57 PM info: edgelet_http::logging -- [mgmt] - - - [2018-09-03 10:28:57.533708400 UTC] "GET /modules?api-version=2018-06-28 HTTP/1.1" 200 OK 449 "-" "-" pid(any)                                                                                   
    9/3/2018 3:29:02 PM info: edgelet_http::logging -- [mgmt] - - - [2018-09-03 10:29:02.543274600 UTC] "GET /modules?api-version=2018-06-28 HTTP/1.1" 200 OK 449 "-" "-" pid(any)                                                                                   
    9/3/2018 3:29:07 PM info: edgelet_http::logging -- [mgmt] - - - [2018-09-03 10:29:07.554093 UTC] "GET /modules?api-version=2018-06-28 HTTP/1.1" 200 OK 449 "-" "-" pid(any)                                                                                      
    9/3/2018 3:29:09 PM info: edgelet_core::watchdog -- Checking edge runtime status                                                                                                                                                                                 
    9/3/2018 3:29:09 PM info: edgelet_core::watchdog -- Edge runtime is running.                                                                                                                                                                                     
    9/3/2018 3:29:12 PM info: edgelet_http::logging -- [mgmt] - - - [2018-09-03 10:29:12.567305200 UTC] "GET /modules?api-version=2018-06-28 HTTP/1.1" 200 OK 449 "-" "-" pid(any)                                                                                   
    9/3/2018 3:29:17 PM info: edgelet_http::logging -- [mgmt] - - - [2018-09-03 10:29:17.575885700 UTC] "GET /modules?api-version=2018-06-28 HTTP/1.1" 200 OK 449 "-" "-" pid(any)                                                                                   
    9/3/2018 3:29:22 PM info: edgelet_http::logging -- [mgmt] - - - [2018-09-03 10:29:22.590898700 UTC] "GET /modules?api-version=2018-06-28 HTTP/1.1" 200 OK 449 "-" "-" pid(any)                                                                                   
    9/3/2018 3:29:27 PM info: edgelet_http::logging -- [mgmt] - - - [2018-09-03 10:29:27.599495900 UTC] "GET /modules?api-version=2018-06-28 HTTP/1.1" 200 OK 449 "-" "-" pid(any)                                                                                   
    9/3/2018 3:29:32 PM info: edgelet_http::logging -- [mgmt] - - - [2018-09-03 10:29:32.611798600 UTC] "GET /modules?api-version=2018-06-28 HTTP/1.1" 200 OK 449 "-" "-" pid(any)                                                                                   
    9/3/2018 3:29:37 PM info: edgelet_http::logging -- [mgmt] - - - [2018-09-03 10:29:37.620460100 UTC] "GET /modules?api-version=2018-06-28 HTTP/1.1" 200 OK 449 "-" "-" pid(any)                                                                                   
    9/3/2018 3:29:42 PM info: edgelet_http::logging -- [mgmt] - - - [2018-09-03 10:29:42.621030200 UTC] "GET /modules?api-version=2018-06-28 HTTP/1.1" 200 OK 449 "-" "-" pid(any)                                                                                   
    9/3/2018 3:29:42 PM info: edgelet_http::logging -- [work] - - - [2018-09-03 10:29:42.745729500 UTC] "POST /modules/%24edgeAgent/genid/636715662943777437/encrypt?api-version=2018-06-28 HTTP/1.1" 200 OK 985 "-" "-" pid(any)                                    
    9/3/2018 3:29:43 PM info: edgelet_http::logging -- [mgmt] - - - [2018-09-03 10:29:43.740061700 UTC] "GET /identities/?api-version=2018-06-28 HTTP/1.1" 200 OK 210 "-" "-" pid(any)                                                                               
    9/3/2018 3:29:44 PM info: edgelet_http::logging -- [mgmt] - - - [2018-09-03 10:29:44.067628900 UTC] "PUT /identities/%24edgeHub?api-version=2018-06-28 HTTP/1.1" 200 OK 98 "-" "-" pid(any)                                                                      
    9/3/2018 3:29:46 PM info: edgelet_http::logging -- [mgmt] - - - [2018-09-03 10:29:46.999173700 UTC] "POST /modules?api-version=2018-06-28 HTTP/1.1" 201 Created 908 "-" "-" pid(any)                                                                             
    9/3/2018 3:29:47 PM warn: edgelet_utils::logging -- Container runtime error - ApiError(ApiError { code: InternalServerError, content: Some(Object({"message": String("failed to create endpoint edgeHub on network nat: HNS failed with error : The process      
                        cannot access the file because it is being used by another process. ")})) })                                                                                                                                                                 
    9/3/2018 3:29:47 PM info: edgelet_http::logging -- [mgmt] - - - [2018-09-03 10:29:47.247618 UTC] "POST /modules/edgeHub/start?api-version=2018-06-28 HTTP/1.1" 500 Internal Server Error 294 "-" "-" pid(any)                                                    
    9/3/2018 3:29:47 PM warn: edgelet_utils::logging -- Container runtime error - ApiError(ApiError { code: InternalServerError, content: Some(Object({"message": String("failed to create endpoint edgeHub on network nat: HNS failed with error : The process      
                        cannot access the file because it is being used by another process. ")})) })                                                                                                                                                                 
    9/3/2018 3:29:47 PM info: edgelet_http::logging -- [mgmt] - - - [2018-09-03 10:29:47.460481300 UTC] "POST /modules/edgeHub/start?api-version=2018-06-28 HTTP/1.1" 500 Internal Server Error 294 "-" "-" pid(any)                                                 
    9/3/2018 3:29:52 PM info: edgelet_http::logging -- [mgmt] - - - [2018-09-03 10:29:52.039166500 UTC] "POST /modules/edgeHub/start?api-version=2018-06-28 HTTP/1.1" 500 Internal Server Error 294 "-" "-" pid(any)                                                 
    9/3/2018 3:29:52 PM warn: edgelet_utils::logging -- Container runtime error - ApiError(ApiError { code: InternalServerError, content: Some(Object({"message": String("failed to create endpoint edgeHub on network nat: HNS failed with error : The process      
                        cannot access the file because it is being used by another process. ")})) })                                                                                                                                                                 
    9/3/2018 3:29:58 PM info: edgelet_http::logging -- [mgmt] - - - [2018-09-03 10:29:58.058868200 UTC] "GET /modules/edgeAgent/logs?api-version=2018-06-28&follow=false&tail=all HTTP/1.1" 200 OK - "-" "iotedge/0.1.0" pid(any)                                    
    9/3/2018 3:30:03 PM warn: edgelet_utils::logging -- Container runtime error - ApiError(ApiError { code: InternalServerError, content: Some(Object({"message": String("failed to create endpoint edgeHub on network nat: HNS failed with error : The process      
                        cannot access the file because it is being used by another process. ")})) })                                                                                                                                                                 
    9/3/2018 3:30:03 PM info: edgelet_http::logging -- [mgmt] - - - [2018-09-03 10:30:03.261676500 UTC] "POST /modules/edgeHub/start?api-version=2018-06-28 HTTP/1.1" 500 Internal Server Error 294 "-" "-" pid(any)                                                 
    9/3/2018 3:30:03 PM info: edgelet_http::logging -- [work] - - - [2018-09-03 10:30:03.317280 UTC] "POST /modules/%24edgeAgent/genid/636715662943777437/encrypt?api-version=2018-06-28 HTTP/1.1" 200 OK 985 "-" "-" pid(any)                                       
    9/3/2018 3:30:08 PM info: edgelet_http::logging -- [mgmt] - - - [2018-09-03 10:30:08.632153200 UTC] "GET /modules?api-version=2018-06-28 HTTP/1.1" 200 OK 831 "-" "-" pid(any)                                                                                   
    9/3/2018 3:30:08 PM info: edgelet_http::logging -- [work] - - - [2018-09-03 10:30:08.633152900 UTC] "POST /modules/%24edgeAgent/genid/636715662943777437/encrypt?api-version=2018-06-28 HTTP/1.1" 200 OK 985 "-" "-" pid(any)                                    
    9/3/2018 3:30:08 PM info: edgelet_http::logging -- [mgmt] - - - [2018-09-03 10:30:08.802696300 UTC] "POST /modules/edgeHub/stop?api-version=2018-06-28 HTTP/1.1" 304 Not Modified - "-" "-" pid(any)                                                             
    9/3/2018 3:30:08 PM warn: edgelet_utils::logging -- Container already in this state                                                                                                                                                                              
    9/3/2018 3:30:08 PM warn: edgelet_utils::logging -- Container runtime error - ApiError(ApiError { code: InternalServerError, content: Some(Object({"message": String("failed to create endpoint edgeHub on network nat: HNS failed with error : The process      
                        cannot access the file because it is being used by another process. ")})) })                                                                                                                                                                 
    9/3/2018 3:30:08 PM info: edgelet_http::logging -- [mgmt] - - - [2018-09-03 10:30:08.929044700 UTC] "POST /modules/edgeHub/start?api-version=2018-06-28 HTTP/1.1" 500 Internal Server Error 294 "-" "-" pid(any)                                                 
    9/3/2018 3:30:09 PM info: edgelet_core::watchdog -- Checking edge runtime status                                                                                                                                                                                 
    9/3/2018 3:30:09 PM info: edgelet_core::watchdog -- Edge runtime is running.                                                                                                                                                                                     
    9/3/2018 3:30:09 PM warn: edgelet_utils::logging -- Container runtime error - ApiError(ApiError { code: InternalServerError, content: Some(Object({"message": String("failed to create endpoint edgeHub on network nat: HNS failed with error : The process      
                        cannot access the file because it is being used by another process. ")})) })                                                                                                                                                                 
    9/3/2018 3:30:09 PM info: edgelet_http::logging -- [mgmt] - - - [2018-09-03 10:30:09.086215200 UTC] "POST /modules/edgeHub/start?api-version=2018-06-28 HTTP/1.1" 500 Internal Server Error 294 "-" "-" pid(any)                                                 
    9/3/2018 3:30:14 PM warn: edgelet_utils::logging -- Container runtime error - ApiError(ApiError { code: InternalServerError, content: Some(Object({"message": String("failed to create endpoint edgeHub on network nat: HNS failed with error : The process      
                        cannot access the file because it is being used by another process. ")})) })                                                                                                                                                                 
    9/3/2018 3:30:14 PM info: edgelet_http::logging -- [mgmt] - - - [2018-09-03 10:30:14.661189 UTC] "POST /modules/edgeHub/start?api-version=2018-06-28 HTTP/1.1" 500 Internal Server Error 294 "-" "-" pid(any)

它最初显示edgeAgent启动,但是一旦部署模块,它就会显示与我上面提到的相同的错误。

1 个答案:

答案 0 :(得分:0)

不幸的是,从您的日志来看,您好像有一个Windows码头工人问题。 我发现一些github问题也有非常相似的问题。

您可以执行以下几项操作: 有些人可以通过重置docker(删除所有现有的docker映像)或通过以下方式来解析程序: -卸载Docker -删除容器窗口功能 - 重启 -启用容器窗口功能 -安装Docker

我知道另一个选择很麻烦而且很耗时,我只是在转发帮助别人的东西。