libsodium-64.dll not found in production Azure Service Fabric cluster

大兔子大兔子 提交于 2019-12-03 21:29:04

问题


Using libsodium-net for all of its security goodness in an Azure Service Fabric Reliable Service, on my local dev cluster everything is working fine (although I did have to set the libsodium-64.dll to copy to the output directory).

Unfortunately, when deployed to a real cluster in Azure it throws the following error:

Unable to load DLL 'libsodium-64.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

I've checked by Remote Desktop-ing into one of the nodes and the DLL is copied across into the same directory as the service, exactly as it is in my dev cluster. Can't work out why it can't be found in production.

I've tried setting the PATH environment variable as suggested in this answer, and verified that it does actually get set - unfortunately that doesn't help.

Is there anything special I need to do to get ASF to pick up the DLL?

Edit: also tried adding the DLL to System32 on all the nodes, didn't solve it either.


回答1:


Turns out libsodium-64.dll depends on the Visual C++ Runtime, which didn't seem to be present on the Azure VMs. Ran Process Monitor as mentioned here and saw it was picking up "libsodium-64.dll" but failing on "vcruntime140.dll" - the exception message alone makes this pretty much impossible to work out.

Installed the Visual C++ Redistributable on the VMs and everything seems to be working fine now.

If anyone happens to run into the same problem, you can solve it by adding the following extension to the VM profile of the scale set in your ARM deployment template (VMSS -> properties -> virtualMachineProfile -> extensionProfile -> extensions):

{
    "name": "InstallVCRuntime",
    "properties": {
        "publisher": "Microsoft.Compute",
        "type": "CustomScriptExtension",
        "typeHandlerVersion": "1.7",
        "autoUpgradeMinorVersion": true,
        "settings": {
            "fileUris": [
                "https://some.blob.storage.url/vc_redist.x64.exe"
            ],
            "commandToExecute": "vc_redist.x64.exe /q /norestart"
        }
    }
}

All it does is grab the installer, and run it silently. There didn't seem to be a public link to the redistributable, so I just downloaded it and put it into blob storage.



来源:https://stackoverflow.com/questions/38383411/libsodium-64-dll-not-found-in-production-azure-service-fabric-cluster

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!