iotedge: edgeHub container fails to start, probably due to user permissions (listen on port 443 with unprivileged user)

I am trying to setup GA on redhat 7. One of the errors I have found is that the edgeHub Docker container is unable to start. After some troubleshooting and after checking that the iotedged daemon was reachable through http I created a custom Docker image with user “root” and it worked so I suspect it is due to the edgeHub is unable to listen in that port and it fails. This is the error I am getting:

[2018-07-17 07:23:34 : Starting Edge Hub [07/17/2018 07:23:34.254 AM] Edge Hub Main() FailFast: Exception thrown from SocketAsyncEngine event loop: System.TypeInitializationException: The type initializer for ‘OperationQueue1' threw an exception. ---> System.IO.FileLoadException: Could not load file or assembly 'System.Threading.ThreadPool, Version=4.1.1.0, Culture=neutral, PublicKeyToken=*********'. Access is denied. at System.Net.Sockets.SocketAsyncContext.OperationQueue1…cctor() — End of inner exception stack trace — at System.Net.Sockets.SocketAsyncContext.OperationQueue1.HandleEvent(SocketAsyncContext context) at System.Net.Sockets.SocketAsyncContext.HandleEvents(SocketEvents events) at System.Net.Sockets.SocketAsyncEngine.EventLoop() at System.Environment.FailFast(System.String, System.Exception) at System.Environment.FailFast(System.String, System.Exception) at System.Net.Sockets.SocketAsyncEngine.EventLoop() at System.Net.Sockets.SocketAsyncEngine+<>c.<.ctor>b__24_0(System.Object) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef) Exception details: System.TypeInitializationException: The type initializer for 'OperationQueue1’ threw an exception. —> System.IO.FileLoadException: Could not load file or assembly ‘System.Threading.ThreadPool, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’. Access is denied. at System.Net.Sockets.SocketAsyncContext.OperationQueue1..cctor() --- End of inner exception stack trace --- at System.Net.Sockets.SocketAsyncContext.OperationQueue1.HandleEvent(SocketAsyncContext context) at System.Net.Sockets.SocketAsyncContext.HandleEvents(SocketEvents events) at System.Net.Sockets.SocketAsyncEngine.EventLoop()

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 20 (6 by maintainers)

Most upvoted comments

Hi, have you tried it after rebooting it?

Our host is RHEL 7.5 and it works after a fresh install however it fails after reboot due to two things:

  1. Folder /var/run/iotedge is not automatically created, solution is to create the file /etc/tmpfiles.d/iotedge.conf:
d /run/iotedge 0755 iotedge iotedge -
  1. Socket permissions are still wrong for eventHub and any other non root module, the workaround is to run them with root

We use unix sockets directly in iotedge configuration. That may change in your case.

Setting User as root in the deployment does not work so you need a new image. It does not make sense for me being able to change a subset not documented of Docker options and not others. This is my workaround:

  • Dockerfile
FROM mcr.microsoft.com/azureiotedge-hub:1.0.1
User root
  • Build
docker build -t <my_registry/user in dockerhub>/azureiotedge-hub:1.0.1-as_root .
  • Use this image in your deployment