Fai Lai
Fai Lai

Reputation: 51

IoT Edge Hub exception - Unable to start Kestrel

I am running an IoT Edge transparent gateway on a custom Debian Linux distro but I hit this error "Unable to start Kestrel" every now and then. Does anyone know what is the cause of this error?

2018-05-06 23:54:49.750 +00:00 [INF] - Starting Edge Hub
2018-05-06 23:54:49.756 +00:00 [INF] - Version - 1.0.0-preview022.11567621 (12a8e1bb63e619b17ca685efd470ad3f412034f4)
2018-05-06 23:54:49.757 +00:00 [INF] - 
        █████╗ ███████╗██╗   ██╗██████╗ ███████╗
       ██╔══██╗╚══███╔╝██║   ██║██╔══██╗██╔════╝
       ███████║  ███╔╝ ██║   ██║██████╔╝█████╗
       ██╔══██║ ███╔╝  ██║   ██║██╔══██╗██╔══╝
       ██║  ██║███████╗╚██████╔╝██║  ██║███████╗
       ╚═╝  ╚═╝╚══════╝ ╚═════╝ ╚═╝  ╚═╝╚══════╝

 ██╗ ██████╗ ████████╗    ███████╗██████╗  ██████╗ ███████╗
 ██║██╔═══██╗╚══██╔══╝    ██╔════╝██╔══██╗██╔════╝ ██╔════╝
 ██║██║   ██║   ██║       █████╗  ██║  ██║██║  ███╗█████╗
 ██║██║   ██║   ██║       ██╔══╝  ██║  ██║██║   ██║██╔══╝
 ██║╚██████╔╝   ██║       ███████╗██████╔╝╚██████╔╝███████╗
 ╚═╝ ╚═════╝    ╚═╝       ╚══════╝╚═════╝  ╚═════╝ ╚══════╝

2018-05-06 23:54:49.763 +00:00 [INF] - Initializing configuration
2018-05-06 23:54:51.071 +00:00 [INF] - Created persistent store   at /tmp/edgeHub
2018-05-06 23:54:51.293 +00:00 [INF] - Attempting to connect to IoT Hub for client SIVgateway/$edgeHub via AMQP...
2018-05-06 23:54:54.723 +00:00 [INF] - Connected to IoT Hub for client SIVgateway/$edgeHub via AMQP, with client operation timeout 60000.
2018-05-06 23:54:54.769 +00:00 [INF] - Created cloud connection for client SIVgateway/$edgeHub
2018-05-06 23:54:54.782 +00:00 [INF] - New cloud connection created for device SIVgateway/$edgeHub
2018-05-06 23:54:54.887 +00:00 [INF] - New device connection for device SIVgateway/$edgeHub
2018-05-06 23:54:56.330 +00:00 [INF] - Created new message store
2018-05-06 23:54:56.344 +00:00 [INF] - Started task to cleanup processed and stale messages
2018-05-06 23:54:58.266 +00:00 [INF] - Obtained edge hub config from module twin
2018-05-06 23:54:58.773 +00:00 [INF] - Set the following 1 route(s) in edge hub
2018-05-06 23:54:58.790 +00:00 [INF] - route: FROM /* INTO $upstream
2018-05-06 23:54:58.794 +00:00 [INF] - Updated message store TTL to 7200 seconds
2018-05-06 23:54:58.802 +00:00 [INF] - Updated the edge hub store and forward configuration
2018-05-06 23:54:58.804 +00:00 [INF] - Initialized edge hub configuration
2018-05-06 23:54:59.039 +00:00 [INF] - Starting protocol heads - (HTTP, MQTT)
2018-05-06 23:54:59.050 +00:00 [INF] - Starting HTTP head
2018-05-06 23:54:59.294 +00:00 [INF] - Starting MQTT head
2018-05-06 23:55:00.347 +00:00 [INF] - Initializing TLS endpoint on port 8883 for MQTT head.
2018-05-06 23:55:00.686 +00:00 [INF] - Started MQTT head
2018-05-06 23:55:00.759 +00:00 [FTL] - Unable to start Kestrel.
Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking.UvException: Error -13 EACCES permission denied
   at Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking.LibuvFunctions.ThrowError(Int32 statusCode)
   at Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking.UvTcpHandle.Bind(IPEndPoint endPoint)
   at Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Listener.ListenTcp(Boolean useFileHandle)
   at Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Listener.c.b__8_0(Listener listener)
   at Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.LibuvThread.DoPostWork()

Upvotes: 5

Views: 724

Answers (2)

Rafa Silva
Rafa Silva

Reputation: 1

I have the same issue when running my application from whithin a proxied environment.

When running outside the proxy, no problem at all.

To run inside the proxy, I had to turn on the UpstreamProtocol and the https_proxy environment variables.

{"Env":["EdgeHubUser=root"]} on create options didn't help much, since it says invalid environment variable on the edgeagent log execution.

Upvotes: 0

Sean Edmond
Sean Edmond

Reputation: 21

We managed to resolve this issue by adding the following line to the "Create Options" of the Edge Hub in the Azure Portal (Home -> IoT Edge (preview) -> Device Details-> Set Modules -> Advanced Edge Settings):

{"Env":["EdgeHubUser=root"]}

Upvotes: 2

Related Questions