Server 2012 UNC Network Share One Way 0x80004005
Recently I’ve had a strange issue with Microsoft Azure. For some reason on some of the Virtual Machines could not access UNC network shares, throwing a 0x80004005 error. However strangely, worked the other way. The virtual machines run Server 2012 Datacentre edition.
From Machine A
Ping Machine B – Success
Access Network Share on Machine B – Success
From Machine B
Ping Machine A – Success
Access Network Share on Machine A – Fail
The following did not help with resolving the issue:
- Removal and rejoin domain (rejoin failed)
- Check Firewall Settings
- Disable IP6
- Delete network adapters
Following some work by Azure’s support team, it was identified that the issue is a bug in windows due to the way Azure handles the automatic scaling.
The automatic scaling feature in Microsoft Azure automatically boots and shuts down machines dependant on load on the cloud service. This allows cloud services and associated websites to benefit from extra processing power and memory when load is higher than expected.
Every time the virtual machine assigns the windows image to a new host machine, a new virtual network adapter is created, and various entries are added to the registry. SMB then picks up the details from the registry to resolve the UNC path on the network. Once a specific number is reached, SMB then fails to redirect the paths to the right address, causing this error.
Microsoft do not have a permanent fix, however the following script clears out the junk in the registry and leaves only the valid entries behind. Running this script fixed the issue after a reboot of the machine.