Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create parent socket folder in Windows upgrade script #5477

Merged

Conversation

yophilav
Copy link
Contributor

@yophilav yophilav commented Sep 8, 2021

TL;DR - The windows install script creates the mnt folder in the install scenario (Initialize-IoTEdge) but not the upgrade scenario, which is inconsistent and causes problems. This change addresses the missed case.

Context :
Recently we have updated that each deployed module uses its own Workload socket to do its communication with the runtime edgelet. This unpromptedly leads us to two bugs where where /mnt directory is not created properly upon startup on Windows.

Issues:
The two known bugs were:

  1. EdgeAgent would have a hard time binding the socket i.e.
<3> 2021-08-31 00:04:34.253 +00:00 [ERR] - Executing command for operation ["create"] failed.
Microsoft.Azure.Devices.Edge.Agent.Edgelet.EdgeletCommunicationException- Message:Error calling Create module edgeHub: Could not create module edgeHub
caused by: Could not create module edgeHub
caused by: invalid volume specification: 'C:\ProgramData\iotedge\mnt\edgeHub:C:\ProgramData\iotedge\workload': invalid mount config for type "bind": bind source path does not exist: c:\programdata\iotedge\mnt\edgehub, StatusCode:500

This was fixed in 382cf77

  1. IoTEdge runtime would have an issue starting up with "forbidden access" after Update-IoTEdge from a version prior to 1.1.5.
<0> 2021-09-04 14:45:48.824 +08:00 [FTL] - Fatal error building application.
System.Net.Internals.SocketExceptionFactory+ExtendedSocketException (10013): An attempt was made to access a socket in a way forbidden by its access permissions. C:\ProgramData\iotedge\workload\sock
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)

Fixes: #5465.

@yophilav yophilav requested a review from arsing September 8, 2021 20:46
@arsing
Copy link
Member

arsing commented Sep 8, 2021

Perhaps update the PR description to include what Damon put in your previous one.

@yophilav yophilav changed the title Update the New-Socket to be used in Update-IoTEdge Create parent socket folder in Windows upgrade script Sep 8, 2021
@kodiakhq kodiakhq bot merged commit 6d0ca55 into Azure:release/1.1 Sep 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants