MacOS 10.12 Sierra AFP Errors

Questions regarding Mac OS X Specifically can be placed here, such as questions regarding TimeMachine, for example.
Forum rules
1) This is a user forum for Synology users to share experience/help out each other: if you need direct assistance from the Synology technical support team, please use the following form:
https://myds.synology.com/support/suppo ... p?lang=enu
2) To avoid putting users' DiskStation at risk, please don't paste links to any patches provided by our Support team as we will systematically remove them. Our Support team will provide the correct patch for your DiskStation model.
mindphunk
I'm New!
I'm New!
Posts: 8
Joined: Thu Sep 22, 2016 3:34 pm

Re: MacOS 10.12 Sierra AFP Errors

Postby mindphunk » Mon Oct 03, 2016 1:33 pm

Let me help you out as far as I can.

I already wrote a summary in the German Synology board:
#Step 1: Listing all affected directories and files
#Step 2: Changing the stuff

I wrote the walkthrough in English.

---

So ... here we go. First I have to say that you should not just start typing the command lines and hope that it will fix your stuff. You might change some parts of the commands to get your desired results.
As far as you understand what the commands are doing exactly, you will have the control. Otherwise something might happen, which you did not want to happen...

Step by Step:

1. Access the Diskstation via SSH. You have to enable the SSH service in the DS settings first, check this for help.

Code: Select all

ssh admin@diskstation.local -p 22

The -p option specified the port. This has been set in the DS system preferences earlier.
An admin account is sufficient. Don't use the root, so you make sure that no DSM system own folders and files will be affected by changes.

2. List the files and directories! I have run several individual commands, so I have a specific list for each case and do not have to look through a long list. Directories and files that are located in a path which contains "@eaDir" or "#recycle" will not be observed. Thus, all directories and files in the share bins are irrelevant for us. The search goes through all volumes, so it starts with /volume1 and runs till no volume is left. The command will save the list in a CSV file in the home share of the user which is currently logged in via SSH. In this case it is admin. Here you might have to adjust the path of you want to save the CSV files in another directory or if your share "homes" is not located on /volume1.

Not the command lines:

1. Find directories with a period/dot at the end:

Code: Select all

find /volume* -name "*." -type d -not -path "*@eaDir*" -not -path "*#recycle*" -printf '"%h","%f","%CY-%Cm-%Cd %CT","%s","%u","%M"\n' > /volume1/homes/$USER/dir_dot_end.csv


2. Find all directories with a space at the end:

Code: Select all

find /volume* -name "* " -type d -not -path "*@eaDir*" -not -path "*#recycle*" -printf '"%h","%f","%CY-%Cm-%Cd %CT","%s","%u","%M"\n' > /volume1/homes/$USER/dir_space_end.csv


3. List all directories which contain the following chars in their names:
: ; ? " \ / < > * |

Code: Select all

find /volume* -name "*[\\:\;\"\\\?\<\>\*\|]*" -type d -not -path "*@eaDir*" -not -path "*#recycle*" -printf '"%h","%f","%CY-%Cm-%Cd %CT","%s","%u","%M"\n' > /volume1/homes/$USER/dir_not_allowed_chars.csv


4. List all files which contain the chars above:

Code: Select all

find /volume* -name "*[\\:\;\"\\\?\<\>\*\|]*" -type f -not -path "*@eaDir*" -not -path "*#recycle*" -printf '"%h","%f","%CY-%Cm-%Cd %CT","%s","%u","%M"\n' > /volume1/homes/$USER/files_not_allowed_chars.csv


5. This should have been created 4 .csv files. If there are some inch chars ( " ) inside the path or the targeted file/dir name, then excel and other table handling applications wont interpret the CSV correctly. Thus, you will have to find and replace these single chars with two inch signs: ( " " ). This page will help you somehow finding the bad lines. Additional information of the correct CSV structure is available here.

Example of Incorrect CSV line and the correction:

Code: Select all

"/volume1/homes/username/Test","Data for 27" Screen","2016-09-27 10:00:59.0612228610","4096","username","drwxrwxrwx"
                                            ↑
                                      change to:
                                            ↓
"/volume1/homes/username/Test","Data for 27"" Screen","2016-09-27 10:00:59.0612228610","4096","username","drwxrwxrwx"


------

Now you should have got an overview of the amount of affected data, so you can either rename the files and directories manually or proceed as follows.

I use the same commands again to create another list, but this time it will output a .sh bash script which needs to be run afterwards.

1. Directories containing a blank or dot at the end will get an underscore, plus a random Number to prevent overwriting (_5688).
a) create .sh file:

Code: Select all

# Here, the folders are listed with spaces and written in the .sh
find /volume* -name "* " -type d -not -path "*@eaDir*" -not -path "*#recycle*" -printf 'find "%h" -type d -name "* " -print0 | while IFS= read -r -d "" folder ; do mv -- "$folder" "${folder}_$RANDOM"; done\n' > /volume1/homes/$USER/dir_change_end.sh

# Now the folders are listed with spaces and written at the end of the .sh
find /volume* -name "*." -type d -not -path "*@eaDir*" -not -path "*#recycle*" -printf 'find "%h" -type d -name "*." -print0 | while IFS= read -r -d "" folder ; do mv -- "$folder" "${folder}_$RANDOM"; done\n' >> /volume1/homes/$USER/dir_change_end.sh


b) run the .sh file:

Code: Select all

/volume1/homes/$USER/dir_change_end.sh


This should have fixed all folders with the dot or space at the end. To make sure that it worked you can run again one of the first CSV listing commands and repeat the changes once again.
In case of parent folders being affected by the renaming, you will have to run it again because its subfolders cant be addressed by the script anymore, their name changed. Heres an example:

Code: Select all

/volume1/homes/username/Test /   >> changed to >>   /volume1/homes/username/Test _51247/

Will no longer be found because the parent folder has changed:
/volume1/homes/username/Test /Subfolder /


---

Now lets proceed with the renaming of directories and files which contain bad characters.

Its basically the same way, I have got two processes:

1. Directories containing : ; \ ? < > * |. Every single char will be replaced with an underscore.
I have excluded the share for Time Machine Backups, since I did not know if the backup (backupname.sparsebundle) is interpreted as a directory.
Thus, the backup should not be touched. Here you may definitely need to change the name of the share. For me it's just "Time Machine Backups".
Also the bin of the shares and all folders including "@" are excluded, thus remain System folders (like @tmp) untouched.

Code: Select all

find /volume* -name "*[\:\;\"\\\?\<\>\*\|]*" -type d -not -path "*@*" -not -path "*#recycle*" -not -path "*Time Machine Backups*" -printf 'find "%h" _X_X_X_\n' > /volume1/homes/$USER/folders_not_allowed_chars.sh


This created a .sh file in the home share of the logged-in user, as usual. Then the string _X_X_X_ must be replaced with the following text. I have to use the find & replace function of a simple text editor. (Because I have not got it done by a bash command. The escaping of each character was too stressful, is not my skill).

Code: Select all

_X_X_X_

change to:

-type d -name '*[\:\;\"\\\?\<\>\*\|]*' -not -path "*@*" -not -path "*#recycle*" -not -path "*Time Machine Backups*" -print0 | while IFS= read -r -d '' file ; do ext="${file##*.}" ; filename="${file%.*}" ; file_clean="$(echo $filename | tr "\:\;\"\\\?\<\>\*\|" "_")" ; final="$file_clean.$ext" ; mv -n -v "$file" "$final" ; done


After that, the folders_not_allowed_chars.sh will be run:

Code: Select all

/volume1/homes/$USER/folders_not_allowed_chars.sh

You will possibly have to rerun the script.

2. Files containing : ; \ ? < > * |. These chars will be replaced with an underscore.

Code: Select all

find /volume* -name "*[\:\;\"\\\?\<\>\*\|]*" -type f -not -path "*@*" -not -path "*#recycle*" -not -path "*Time Machine Backups*" -printf 'find "%h" _X_X_X_\n' > /volume1/homes/$USER/files_not_allowed_chars.sh


Code: Select all

_X_X_X_

change to:

-type f -name '*[\:\;\"\\\?\<\>\*\|]*' -not -path "*@*" -not -path "*#recycle*" -not -path "*Time Machine Backups*" -print0 | while IFS= read -r -d '' file ; do ext="${file##*.}" ; filename="${file%.*}" ; file_clean="$(echo $filename | tr "\:\;\"\\\?\<\>\*\|" "_")" ; final="$file_clean.$ext" ; mv -n -v "$file" "$final" ; done


Run the files_not_allowed_chars.sh afterwards:

Code: Select all

/volume1/homes/$USER/files_not_allowed_chars.sh


Again: you might have to repeat that script.

---

Of course you can customize the search pattern, so the script will change other characters or strings in your file and directory names. Just be careful with that thing and test the stuff in a test environment before you run it over all your data.

So that's it, folder and file names have been renamed correctly – hopefully ;-)

And for those who recognize lower transfer rates, like me:
If you are in a safe network, if you are sure that no one will use your mac, you can disable the signing on your mac. Read this article.
My AFP transfer rate was high with ~100MB/s, after switching to SMB it was only ~50MB/s.
After disabling signing I went back to ~100MB/s, its even faster than AFP.

Best wishes!
Last edited by mindphunk on Thu Oct 06, 2016 8:43 am, edited 1 time in total.
drfoto
I'm New!
I'm New!
Posts: 3
Joined: Mon Oct 03, 2016 4:13 am

Re: MacOS 10.12 Sierra AFP Errors

Postby drfoto » Tue Oct 04, 2016 2:14 pm

I'm new to RAID and Synology and also new to OS Sierra. I have a large image archive for which migrating to a RAID NAS server makes sense. Having no experience with RAID pre-Sierra, I just imagined I was doing something wrong or had a localized problem with my iMac or the RAID software. Now I'm wondering if I'm yet another victim of this AFP Sierra update.

Has anyone encountering this problem downgraded Sierra to El Capitan and seen the problem disappear? For those of you with a Synology RAID, was the hardware / software reliable as a NAS server in a pre-Sierra environment?
dthompsn1@gmail.com
I'm New!
I'm New!
Posts: 1
Joined: Wed Oct 05, 2016 3:57 am

Re: MacOS 10.12 Sierra AFP Errors

Postby dthompsn1@gmail.com » Wed Oct 05, 2016 4:24 am

There has got to be an issue here and it would be great if we could provide information to Synology for a fix (I'd really like Apple to get involved here, but I think that is wishful thinking). I have a 66GB iPhotos library that I was able to download over afp, but if I try and open it on the NAS over it just hangs.

So I downloaded the 66GB library updated it for Sierra, then tried to upload it over afp on the NAS and it only gets about 2GB and then locks up. Required a hard reboot. So then I tried SMB as people recommended here. This was better but could never complete--the best I could get was 45GB transferred--but at least it didn't lock up the whole system--it did delay a long time trying to delete the iphotos directory that it was able to copy.

So I'm noticing that reads are okay (not great transfer rates) but writes typically hang and have all kinds of problems.

So Synology, is there anything we can do to help provide logs, etc. that might help locate the issues? Are we really at the mercy of Apple to come out with a fix for this? @apple [Please control your language].com
MaxS
I'm New!
I'm New!
Posts: 1
Joined: Thu Oct 06, 2016 5:45 am

Re: MacOS 10.12 Sierra AFP Errors

Postby MaxS » Thu Oct 06, 2016 5:49 am

All,

i raised a ticket regarding that issue with Synology yesterday. They respoded quite quickly and confimed they are aware of this bug. The support analyst mentioned there will be an DSM patch available this week

This is indeed a known issue [Program (Finder & various apps) hang] which will be fixed in next DSM update this week so please kindly wait for the fix


MS
dwmreg
Trainee
Trainee
Posts: 14
Joined: Sat Aug 01, 2015 4:04 pm

Re: MacOS 10.12 Sierra AFP Errors

Postby dwmreg » Fri Oct 07, 2016 11:02 pm

Apple isn't admitting that they have depreciated or no longer support AFP. Please stop spewing that crap all over the internet. I got so fed up with this problem I wrote an email to Tim Cook. Apple does not or has not made any claims favoring AFP vs. SMB. So unless you have some proof please just keep it to yourself.

Now Synology support claims there is a critical hot fix out. More crap. They don't know what they are talking about either.

Seems like all we have to help us are a bunch of clowns. These days no one likes clowns!!! :-p
dwmreg
Trainee
Trainee
Posts: 14
Joined: Sat Aug 01, 2015 4:04 pm

Re: MacOS 10.12 Sierra AFP Errors

Postby dwmreg » Fri Oct 07, 2016 11:04 pm

Apple isn't admitting that they have depreciated or no longer support AFP. Please stop spewing that crap all over the internet. I got so fed up with this problem I wrote an email to Tim Cook. Apple does not or has not made any claims favoring AFP vs. SMB. So unless you have some proof please just keep it to yourself.

Now Synology support claims there is a critical hot fix out. More crap. They don't know what they are talking about either.

Seems like all we have to help us are a bunch of clowns. These days no one likes clowns!!! :-p
iknowtech
Knowledgeable
Knowledgeable
Posts: 329
Joined: Thu Jun 19, 2014 8:11 am

Re: MacOS 10.12 Sierra AFP Errors

Postby iknowtech » Fri Oct 07, 2016 11:57 pm

dwmreg wrote:Apple had me try a fresh clean install of Sierra to test because they thought software I had on the previous version of macOS was the issue. The test proved that this isn't the case. A fresh clean install of Sierra and it still exhibited the errors I was seeing with AFP while trying to connect to my Photos library.

Please note that Apple does not official support SHARING a Photos or iTunes library on a NAS - the key word is sharing in the sense that two or more people are trying to access the same library. In my case only one user and one computer (a Mac Mini) accesses either library. I don't share photos, but my iTunes library is accessible via cloud services and the stuff you can set up for home sharing in iTunes. Since iTunes is the transfer mechanism I cannot say it's being shared in the way Apple doesn't support. Since no one else directly accesses the library as far as I know.

Bottomline I'm blaming Apple right now for the AFP problems. I'd also like to note that someone using another brand of NAS is seeing the same problems we are seeing with our devices from Synology.


You can blame Apple, but probably not for the reasons your wanting to, with this specific issue. The only way to reliably put your iTunes or Photos library on a NAS is to use iSCSI with the Volume formatted as Mac OS Extended Journaled. That's the only file type supported for the Photos database. Anything else you have a high risk of corruption. If your only connecting from one Mac that's always on the network ie and iMac or Mac Pro, this is probably workable. If your trying to do it from a laptop that leaves the network frequently or from multiple computers its just a bad idea in general, because you will have to disconnect and reconnect the iSCSI connection everytime you want to leave and return the network or switch to another computer to access the databases.

The other downside is that iSCSI is not Native in MacOS, so you have to use a 3rd party product for your iSCSI initiator.
dwmreg
Trainee
Trainee
Posts: 14
Joined: Sat Aug 01, 2015 4:04 pm

Re: MacOS 10.12 Sierra AFP Errors

Postby dwmreg » Sat Oct 08, 2016 2:52 pm

Well it looks like Synology's latest release of the OS for the NAS products has resolved the problem - even on beta release of Sierra. I'll do some additional testing and go from there. The new firmware update is rolling out and will hit different regions at different times per Synology support folks. Hopefully this will resolve the issue permanently. It has taught me one thing - I'm now thinking of getting a separate external storage device to house only my iTunes and Photos libraries even though I only access both through one and only one Mac.
Muppetron
I'm New!
I'm New!
Posts: 1
Joined: Mon Oct 10, 2016 7:55 am

Re: MacOS 10.12 Sierra AFP Errors

Postby Muppetron » Mon Oct 10, 2016 8:11 am

Could you clarify what version you are referring to dwmreg? I have the most recently released 6.0.2-8451 Update 2 and the problem is most definitely not fixed for me.

I have a few auto-mounted afp shares pointing to a Synology NAS that have worked fine for years pre-Sierra. Since the Sierra update none of these load at all and both the terminal and finder hang indefinitely if I try to browse to them. Same with any application (eg iTunes) that references anything on those mounts. In fact, the OS would not even shut down or restart without a hard power button intervention if I tried to use them.

So no problem, I'll switch to smb3 as suggested. Nope, this doesn't work either. I can get a little further and see the shares listed with the machine in the finder, but navigating to any of them will not list any files. Auto mounting using smb is a complete failure too.

This is all compounded by the fact that the DSM won't load for me on any browser either. Just a white screen with a never ending loading bar animation.

To admin anything I have to either use a different Mac with a pre-Sierra OS, or use Windows via VMware on the Sierra Mac which works fine when SMB is enabled (yeah, go figure). All round its a complete clusterf---!
mindphunk
I'm New!
I'm New!
Posts: 8
Joined: Thu Sep 22, 2016 3:34 pm

Re: MacOS 10.12 Sierra AFP Errors

Postby mindphunk » Wed Oct 12, 2016 5:01 pm

Muppetron wrote:Could you clarify what version you are referring to dwmreg? I have the most recently released 6.0.2-8451 Update 2 and the problem is most definitely not fixed for me.

I have a few auto-mounted afp shares pointing to a Synology NAS that have worked fine for years pre-Sierra. Since the Sierra update none of these load at all and both the terminal and finder hang indefinitely if I try to browse to them. Same with any application (eg iTunes) that references anything on those mounts. In fact, the OS would not even shut down or restart without a hard power button intervention if I tried to use them.

So no problem, I'll switch to smb3 as suggested. Nope, this doesn't work either. I can get a little further and see the shares listed with the machine in the finder, but navigating to any of them will not list any files. Auto mounting using smb is a complete failure too.

This is all compounded by the fact that the DSM won't load for me on any browser either. Just a white screen with a never ending loading bar animation.

To admin anything I have to either use a different Mac with a pre-Sierra OS, or use Windows via VMware on the Sierra Mac which works fine when SMB is enabled (yeah, go figure). All round its a complete clusterf---!


It seems that you got much more than a smb/afp problem if DSM isnt even loading correctly. I can only repeat: SMB3 is working great with macOS Sierra. And guess what: I spoke to a Synology engineer who told me that they will provide an update soon which will enable Apples Time Machine via SMB. This is bc Apple gets rid off AFP.
And btw: using 10.12 macOS Sierra, I do not have any problems automounting the shares. Make sure to remove and store your login data again to keychain!

Return to “Mac OS X”

Who is online

Users browsing this forum: No registered users and 2 guests