I am having a problem copying certain directories and files from my Mac to my family file server via AFP. When I attempt to copy them by dragging them from a Finder window on my Mac to the corresponding Finder window on the file server, Finder displays a window saying, ‘Copying 2 items to “other_folder”‘. Then the copy hangs.
- If I click the (X) icon to the right of the progress bar, the window adds a message, “Stopping…”, but hangs forever.
- If I attempt to eject the server volume from Finder, Finder refuses, saying, “The volume can’t be ejected because it is currently in use.”
- The command
ps up 670
, where 670 is the process ID of the/System/Library/CoreServices/Finder.app/Contents/MacOS/Finder
process, says that the state of the Finder process isU
. This “marks a process in uninterruptible wait”, according toman ps
. - I have narrowed down the problem to the point where I can trigger it by trying to copy only one directory containing only one file. Both directory and file seem innocuous: not very large, created in a very ordinary way.
Sometimes I can recover from this by relaunching the Finder process, and after a couple of minutes the Finder relaunches in a new process, without the server mounted. Sometimes the Finder does not relaunch, and I have to log out and back in again, or even restart macOS.
If I connect to the family file server via SMB rather than AFP, Finder copies the very same files with no problem. But I prefer to connect via AFP, because I make heavy use of relative symbolic links between my project directories. Neither Apple’s SMB software nor the server’s SMB software present symbolic links as links. Instead, they present links as conventional directories. That messes up my workflow.
I have used this file server for years, and this Mac and its predecessor with this server via AFP for years. I have not encountered this problem before. I have copied similar files from Mac to server before without problems. Connecting to this server via AFP works well in general, even though both Apple and the server vendor have deprecated AFP.
Hypotheses:
- There is something about these files which triggers a bug in the Mac’s AFP code.
- Something in a recent macOS upgrade broke this aspect of AFP support.
- Something about the path length or other context is the actual trigger, not the files themselves.
- It is not the visible file, but an invisible system file like
.DS_Store
, which triggers the problem.
The Mac is running macOS Sonoma 14.7.4, and has an Apple M1 CPU. The server is running TrueNAS-13.0-U6.2 software, with AFP support via NetATalk.
How can I fix this so that these file copy operations succeed when copying via Finder over AFP?
How can I recover from the hung Finder file copy in a less invasive way than restarting macOS? Can I interrupt a process in state U
?
How can I diagnose what is triggering the problem, so that I know to avoid it?