Monsieur Winner

MS D365FO || Monsieur D365FO

D365foOn-premisesTechnical

Unable to download asset … The job state is failed (Part 2): “The network name cannot be found”

Some time ago I wrote about the error “Unable to download asset” on D365 F&O on-premises. I recently met the same error message again, during the preparation of a 10.0.46 update on a production environment, but the cause was completely different. This is part 2.

Short version: the file share path used by the Local Agent did not exist. The message you see first says nothing about that, so here is how I found it.

The symptoms

In LCS, the Prepare step of the update failed with “Unable to get the configuration files”. On the primary orchestrator node, the AX-LocalAgent → Operational log showed this:

Unable to download asset. The job state is failed
Event 65002 on the first orchestrator node: very generic
Unable to download asset 68099d98-.... The job state is failed.

That’s all: a long stack trace and no reason.

What I ruled out first

Because this environment had slow internet some days before, everyone (me included) first blamed the network. Before you get to the real cause, these are the usual suspects. I checked them all:

  • Internet speed / timeout: networkTimeoutInMinutes in localagent-config.json was already 240. The speed was fine at that point, and it still failed.
  • Antivirus SSL/TLS inspection (ESET in my case): the certificate issuer on the LCS/Azure endpoints was the real Microsoft one, not the antivirus.
  • Time sync on the orchestrator nodes: fine.
  • gMSA access to the share: the Local Agent gMSA could read and write \\FILESERVER\agent.
  • Local Agent version: already the latest (3.5.0).
  • Clean-up and reinstall of the Local Agent: Message agent and Validate setup worked well afterwards, but the next Prepare still failed.

A clean reinstall didn’t fix it, so the problem was not in the agent itself. It was in the configuration the agent was given.

The key: check the right orchestrator node

The Local Agent is a Service Fabric application with several services (OrchestrationService, ArtifactsManager, StateService, BridgeService…). The download itself is done by ArtifactsManager, and it may run on a different orchestrator node than the one you are looking at. The node showing “Unable to download asset” only receives the result: “the job failed”.

To find where ArtifactsManager runs, use Service Fabric Explorer (Applications → Local Agent → ArtifactsManager → partition → replicas), or PowerShell after Connect-ServiceFabricCluster:

Get-ServiceFabricApplication |
  ForEach-Object { Get-ServiceFabricService -ApplicationName $_.ApplicationName } |
  Where-Object { $_.ServiceName -like '*ArtifactsManager*' } |
  ForEach-Object { Get-ServiceFabricPartition -ServiceName $_.ServiceName } |
  ForEach-Object { Get-ServiceFabricReplica -PartitionId $_.PartitionId } |
  Select-Object NodeName, ReplicaRole, ReplicaStatus

Or just open the AX-LocalAgent log on every orchestrator node. On the third node I found the real error:

Unable to get file endpoint - The network name cannot be found
Third orchestrator node: “Unable to get file endpoint – The network name cannot be found”
GetFileDownloadPath failed for download location \\FILESERVER\Shares\agent\assets
The real cause, with the path
GetFileDownloadPath failed for assetID: topology.xml/... for download location
'\\FILESERVER\Shares\agent\assets'
System.IO.IOException: The network name cannot be found.

Root cause

Look at the path: \\FILESERVER\Shares\agent\assets.

On the file server, C:\Shares is only a folder. The SMB share is agent (pointing to C:\Shares\agent), so the correct UNC path is \\FILESERVER\agent. There was no share called Shares.

The Local Agent was set up with the file share location \\FILESERVER\Shares\agent, which includes the local folder name. Windows cannot find a share named Shares on that server, so it returns “The network name cannot be found”. That error means the share doesn’t exist. It is not a permissions issue, and not a network or internet issue.

You can confirm it in seconds from an orchestrator node:

Test-Path '\\FILESERVER\Shares\agent'   # False  -> the problem
Test-Path '\\FILESERVER\agent'          # True   -> the real share

And on the file server itself:

Get-SmbShare | Format-Table Name, Path -AutoSize

The fix

You have two options.

Option A – quick fix (what I did under time pressure)

Make the path the agent expects actually exist. Create the share Shares on the file server (run this on the file server, not on the orchestrator):

New-SmbShare -Name 'Shares' -Path 'C:\Shares' `
  -FullAccess 'DOMAIN\svc-LocalAgent$','BUILTIN\Administrators'

Get-SmbShare | Format-Table Name, Path -AutoSize
Get-SmbShare list on the file server showing the Shares share
The Shares share now exists next to agent, aos-storage, dixf-share…

(The “name has already been shared” error in the screenshot is just because I ran the command a second time.)

Right after this, I started a new Prepare in LCS and the download went through. The assets appeared in the agent folder: topology.xml and the package folder.

agent assets folder with topology.xml and package folder
Assets finally downloaded into C:\Shares\agent\assets

Option B – the proper fix

Correct the path at its source, so you don’t need the extra share:

  1. In LCS, edit the on-premises connector configuration and set the agent file share to \\FILESERVER\agent.
  2. Download the new localagent-config.json and check that fileshareLocation is \\FILESERVER\agent.
  3. Clean up and reinstall the Local Agent with the new config:
    .\LocalAgentCLI.exe Cleanup <path>\localagent-config.json
    .\LocalAgentCLI.exe Install <path>\localagent-config.json
  4. Validate in LCS, then remove the extra Shares share (Remove-SmbShare -Name 'Shares').

Do this outside a deployment window. Don’t change the path while a servicing operation is running.

Lessons learned

  • “Unable to download asset … The job state is failed” is a symptom, not a cause. It can be caused by internet speed/timeouts (see part 1), certificates, antivirus inspection… or a wrong file share path.
  • Check the AX-LocalAgent log on all orchestrator nodes, and especially the node where ArtifactsManager runs. That’s where the real message is.
  • “The network name cannot be found” = the share does not exist. Compare the path in the error with Get-SmbShare on the file server.
  • Use a UNC path with the share name (\\server\agent), never the local folder structure (\\server\Shares\agent).
  • A Local Agent reinstall only helps if the config you give it is correct.

I hope this saves someone a long night. Questions are welcome in the comments.

Related: Unable to get file endpoint, the network name cannot be found (2024) · D365 F&O on-premises: Local Agent cannot connect to LCS – AADSTS700027

Komi Siabi

Komi Siabi is a Bilingual D365FO Solution architect who loves sharing his knowledge as he works on Both Francophone and Anglophone projects around the globe. He enjoys doing some tiktok videos in his leisure time.

Leave a Reply