Docker Ubuntu IoT Edge edgeHub模块无法访问路径'/tmp/edgeHub/edgeHub';被拒绝

Docker Ubuntu IoT Edge edgeHub模块无法访问路径'/tmp/edgeHub/edgeHub';被拒绝,docker,ubuntu-18.04,azure-iot-edge,Docker,Ubuntu 18.04,Azure Iot Edge,我正在为IoT Edge部署一个可工作的OPCPublisher模块的生产版本,这意味着我在开发一个完全可以工作的解决方案 然而,当我尝试在生产服务器中部署相同的东西时,我从edgeHub模块得到一个错误 服务器是Ubuntu server 18.04,我使用官方文档安装edge: 现在,由于对互联网的访问权限非常严格,安装过程中出现了大量问题,但所有这些问题都得到了解决,edge成功安装,然后链接到运行在MS azure IoT hub中的OPCPublisher模块 此时,Linux上的ed

我正在为IoT Edge部署一个可工作的OPCPublisher模块的生产版本,这意味着我在开发一个完全可以工作的解决方案

然而,当我尝试在生产服务器中部署相同的东西时,我从edgeHub模块得到一个错误

服务器是Ubuntu server 18.04,我使用官方文档安装edge:

现在,由于对互联网的访问权限非常严格,安装过程中出现了大量问题,但所有这些问题都得到了解决,edge成功安装,然后链接到运行在MS azure IoT hub中的OPCPublisher模块

此时,Linux上的edge下载了OPCPublisher、edgeAgent和edgeHub的docker映像。Publihser和代理顺利通过(在我与docker image repos的更多访问权进行斗争之后),但edgeHub失败,代码139:

如果我看一下中心的日志,他们会说:

Unhandled Exception: System.AggregateException: One or more errors occurred. (Access to the path '/tmp/edgeHub/edgeHub' is denied.) ---> System.UnauthorizedAccessException: Access to the path '/tmp/edgeHub/edgeHub' is denied. ---> System.IO.IOException: Permission denied
   --- End of inner exception stack trace ---
   at System.IO.FileSystem.CreateDirectory(String fullPath)
   at System.IO.Directory.CreateDirectory(String path)
   at Microsoft.Azure.Devices.Edge.Hub.Service.DependencyManager.GetStoragePath() in /home/vsts/work/1/s/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Service/DependencyManager.cs:line 282
   at Microsoft.Azure.Devices.Edge.Hub.Service.DependencyManager.GetStoreAndForwardConfiguration() in /home/vsts/work/1/s/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Service/DependencyManager.cs:line 245
   at Microsoft.Azure.Devices.Edge.Hub.Service.DependencyManager.Register(ContainerBuilder builder) in /home/vsts/work/1/s/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Service/DependencyManager.cs:line 79
   at Microsoft.Azure.Devices.Edge.Hub.Service.Startup.BuildContainer(IServiceCollection services) in /home/vsts/work/1/s/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Service/Startup.cs:line 85
   at Microsoft.Azure.Devices.Edge.Hub.Service.Startup.ConfigureServices(IServiceCollection services) in /home/vsts/work/1/s/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Service/Startup.cs:line 39
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.Initialize()
   at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
   at Microsoft.Azure.Devices.Edge.Hub.Service.Hosting.Initialize(IConfigurationRoot configuration, X509Certificate2 serverCertificate, IDependencyManager dependencyManager, Boolean clientCertAuthEnabled) in /home/vsts/work/1/s/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Service/Hosting.cs:line 34
   at Microsoft.Azure.Devices.Edge.Hub.Service.Program.MainAsync(IConfigurationRoot configuration) in /home/vsts/work/1/s/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Service/Program.cs:line 53
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at Microsoft.Azure.Devices.Edge.Hub.Service.Program.Main() in /home/vsts/work/1/s/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Service/Program.cs:line 30
2020-09-15 14:48:09  Starting Edge Hub
2020-09-15 14:48:09.764 +00:00 Edge Hub Main()
<7> 2020-09-15 14:48:10.014 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Util.Edged.WorkloadClient] - Making a Http call to unix:///var/run/iotedge/workload.sock to CreateServerCertificateAsync
<7> 2020-09-15 14:48:10.243 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Util.Uds.HttpUdsMessageHandler] - Connecting socket /var/run/iotedge/workload.sock
<7> 2020-09-15 14:48:10.247 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Util.Uds.HttpUdsMessageHandler] - Connected socket /var/run/iotedge/workload.sock
<7> 2020-09-15 14:48:10.252 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Util.Uds.HttpUdsMessageHandler] - Sending request http://workload.sock/modules/%24edgeHub/genid/637352543162943819/certificate/server?api-version=2019-01-30
<7> 2020-09-15 14:48:10.362 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Util.Uds.HttpUdsMessageHandler] - Response received Created
<7> 2020-09-15 14:48:10.444 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Util.Edged.WorkloadClient] - Received a valid Http response from unix:///var/run/iotedge/workload.sock for CreateServerCertificateAsync
<7> 2020-09-15 14:48:10.717 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Util.Edged.WorkloadClient] - Making a Http call to unix:///var/run/iotedge/workload.sock to TrustBundleAsync
<7> 2020-09-15 14:48:10.726 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Util.Uds.HttpUdsMessageHandler] - Connecting socket /var/run/iotedge/workload.sock
<7> 2020-09-15 14:48:10.726 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Util.Uds.HttpUdsMessageHandler] - Connected socket /var/run/iotedge/workload.sock
<7> 2020-09-15 14:48:10.726 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Util.Uds.HttpUdsMessageHandler] - Sending request http://workload.sock/trust-bundle?api-version=2019-01-30
<7> 2020-09-15 14:48:10.738 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Util.Uds.HttpUdsMessageHandler] - Response received OK
<7> 2020-09-15 14:48:10.741 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Util.Edged.WorkloadClient] - Received a valid Http response from unix:///var/run/iotedge/workload.sock for TrustBundleAsync
<6> 2020-09-15 14:48:10.750 +00:00 [INF] [EdgeHub] - Installing certificates [CN=iotedged workload ca:12/02/2020 11:35:15],[CN=Test Edge Device CA:12/02/2020 11:35:15],[CN=Test Edge Owner CA:12/02/2020 11:35:15] to Root
<6> 2020-09-15 14:48:10.764 +00:00 [INF] [EdgeHub] - Installing certificates [CN=Test Edge Owner CA:12/02/2020 11:35:15] to Root
未处理的异常:System.AggregateException:发生一个或多个错误。(对路径“/tmp/edgeHub/edgeHub”的访问被拒绝。)-->System.UnauthorizedAccessException:对路径“/tmp/edgeHub/edgeHub”的访问被拒绝。-->System.IO.IOException:权限被拒绝
---内部异常堆栈跟踪的结束---
位于System.IO.FileSystem.CreateDirectory(字符串完整路径)
位于System.IO.Directory.CreateDirectory(字符串路径)
位于/home/vsts/work/1/s/Edge-Hub/src/Microsoft.Azure.Devices.Edge.Hub.Service.DependencyManager.GetStoragePath()中的Microsoft.Azure.Devices.Edge.Hub.Service.DependencyManager.cs:第282行
在/home/vsts/work/1/s/Edge-Hub/src/Microsoft.Azure.Devices.Edge.Hub.Service.DependencyManager.GetStoreAndForwardConfiguration()中的Microsoft.Azure.Devices.Edge.Hub.Service/DependencyManager.cs:第245行
在/home/vsts/work/1/s/Edge-Hub/src/Microsoft.Azure.Devices.Edge.Hub.Service.DependencyManager.Register(ContainerBuilder builder)中的/home/vsts/work/1/s/Edge-Hub/src/Microsoft.Azure.Devices.Edge.Hub.Service/DependencyManager.cs:第79行
位于/home/vsts/work/1/s/Edge-Hub/src/Microsoft.Azure.Devices.Edge.Hub.Service.Startup.BuildContainer(IServiceCollection services)中的Microsoft.Azure.Devices.Edge.Hub.Service.Startup.cs:第85行
位于/home/vsts/work/1/s/Edge-Hub/src/Microsoft.Azure.Devices.Edge.Hub.Service.Startup.ConfigureServices(IServiceCollection services)中的Microsoft.Azure.Devices.Edge.Hub.Service.Startup.cs:第39行
在Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()上
在Microsoft.AspNetCore.Hosting.Internal.WebHost.Initialize()中
在Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()上
在/home/vsts/work/1/s/Edge-Hub/src/Microsoft.Azure.Devices.Edge.Hub.Service.Hosting.Initialize(IConfigurationRoot配置、X509Certificate2服务器证书、IDependencyManager依赖管理器、布尔clientCertAuthEnabled)中的/home/vsts/work/1/s/Edge-Hub/src/Microsoft.Azure.Devices.Edge.Hub.Hub.Service/Hosting
位于/home/vsts/work/1/s/Edge-Hub/src/Microsoft.Azure.Devices.Edge.Hub.Service.Program.mainsync(IConfigurationRoot配置)中的Microsoft.Azure.Devices.Hub.Service.mainSync:53行
---内部异常堆栈跟踪的结束---
位于System.Threading.Tasks.Task`1.GetResultCore(布尔waitCompletionNotification)
在/home/vsts/work/1/s/Edge-Hub/src/Microsoft.Azure.Devices.Edge.Hub.Service.Program.Main()中的Microsoft.Azure.Devices.Edge.Hub.Service.Main()处:第30行
2020-09-15 14:48:09起始边缘枢纽
2020-09-15 14:48:09.764+00:00边缘枢纽主管道
2020-09-15 14:48:10.014+00:00[DBG][Microsoft.Azure.Devices.Edge.Util.Edge.WorkloadClient]-对进行Http调用unix:///var/run/iotedge/workload.sock 创建ServerCertificateAsync的步骤
2020-09-15 14:48:10.243+00:00[DBG][Microsoft.Azure.Devices.Edge.Util.Uds.HttpUdsMessageHandler]-连接套接字/var/run/iotdedge/workload.sock
2020-09-15 14:48:10.247+00:00[DBG][Microsoft.Azure.Devices.Edge.Util.Uds.HttpUdsMessageHandler]-已连接套接字/var/run/iotdedge/workload.sock
2020-09-15 14:48:10.252+00:00[DBG][Microsoft.Azure.Devices.Edge.Util.Uds.HttpUdsMessageHandler]-发送请求http://workload.sock/modules/%24edgeHub/genid/637352543162943819/certificate/server?api-版本=2019-01-30
2020-09-15 14:48:10.362+00:00[DBG][Microsoft.Azure.Devices.Edge.Util.Uds.HttpUdsMessageHandler]-收到的响应已创建
2020-09-15 14:48:10.444+00:00[DBG][Microsoft.Azure.Devices.Edge.Util.Edge.WorkloadClient]-从接收到有效的Http响应unix:///var/run/iotedge/workload.sock 对于CreateServerCertificateAsync
2020-09-15 14:48:10.717+00:00[DBG][Microsoft.Azure.Devices.Edge.Util.Edge.WorkloadClient]-对进行Http调用unix:///var/run/iotedge/workload.sock 信任bundleasync
2020-09-15 14:48:10.726+00:00[DBG][Microsoft.Azure.Devices.Edge.Util.Uds.HttpUdsMessageHandler]-连接套接字/var/run/iotdedge/workload.sock
2020-09-15 14:48:10.726+00:00[DBG][Microsoft.Azure.Devices.Edge.Util.Uds.HttpUdsMessageHandler]-已连接套接字/var/run/iotdedge/workload.sock
2020-09-15 14:48:10.726+00:00[DBG][Microsoft.Azure.Devices.Edge.Util.Uds.HttpUdsMessageHandler]-发送请求http://workload.sock/trust-bundle?api-版本=2019-01-30
2020-09-15 14:48:10.738+00:00[DBG][Microsoft.Azure.Devices.Edge.Util.Uds.HttpUdsMessageHandler]-收到的响应正常
2020-09-15 14:48:10.741+00:00[DBG][Microsoft.Azure.Devices.Edge.Util.Edge.WorkloadClient]-收到来自的有效Http响应unix:///var/run/iotedge/workload.sock 用于TrustBundleAsync
2020-09-15 14:48:10.750+00:00[INF][EdgeHub]-将证书[CN=IoEdge workload ca:12/02/2020 11:35:15],[CN=Test Edge Device ca:12/02/2020 11:35:15],[CN=Test Edge Owner ca:12/02/2020 11:35:15]安装到根目录
2020-09-15 14:48:10.764+00:00[INF][EdgeHub]-将证书[CN=测试边缘所有者CA:12/02/2020 11:35:15]安装到根目录
我对linux/ubuntu不太了解,但显然edgeHub并不了解
sudo chown -R 1000:1000 [your local storageFolder]
sudo chmod -R 700 [your local storageFolder]