New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid metadata EA errors #236
Comments
@Adubzzy can you please provide a core file? https://github.com/Netatalk/netatalk/wiki/Developer-Notes#user-content-Debugging_process_crashes |
I don't have those tools installed besides that is a bit out of my depth too. The odd thing is that from what I do know, even though the logs are saying a core file is being created the process is not dying nor is there performance issues so even if I did what you said no core file would be created if the process didn't die correct? If I didn't look in the log I would not have noticed anything. Netatalk is working fine, only thing is that I noticed that since upgrading the log files were getting huge since they were constantly being spammed by that message . Edit: I know it's not the proper thing to do but I just turned logging on to severe and the logs stopped being spammed, but I imagine the underlying issue is still happening but I am not noticing anything out of the ordinary in terms of netatalk. |
Aha, I see. Yes this is unusual, since the invalid metadata EA error led to a segfault crash in the previous netatalk3 release version, IINM. So either the error message here is bogus, or an assertion is missing in the code. Can you please upload a more complete log, just so that we can see if there are other leads earlier in the chain of messages? |
Some more background... I have 4 shares, 1 is a home dir, 1 is a regular dir and 2 are Time Machine dirs. The only ones that cause this error are the home dir and the regular dir. I thought is had something to do with the "." files so like .DS_Store so I deleted them and recreated them but it still causes an issue. In the logs below you can see I mounted /storage/stuff which causes the errors and then I mounted my Tmemachine dir and there was no error. Mar 03 12:23:54.050819 netatalk[836] {netatalk.c:447} (note:Default): Netatalk AFP server starting |
@Adubzzy I tried to recreate your setup locally on a Debian Bookworm VM, but couldn't reproduce your issue immediately there. Would you say that your shared volumes have quite a lot of accumulated data? Just to estimate the probability that there is some corrupted EA data on your file system. It's weird though that it throws the error on the root of the shared volume (/storage/stuff) and not an a particular file that it should, by glancing at the code. If you can give me some pointers on how to set up FreeBSD I can give that a go as well. |
Since this only happens on 2 of my shared drives, is there a command to check for corrupted EA data? |
@rdmark Not sure if it would have helped I also ran all of the dbd commands on the 2 shares that throw and error and nothing: I ran: 8107 sudo dbd -s /usr/home/alex I gave up after running the last command because I kept getting the error. The '-f' command is supposed to rebuild the entire CNID DB. So I don't know what is causing this. The Timemachine shares don't cause a problem. I also check that on my Mac I am do have the boolean set to create .DS_Store files $ defaults read com.apple.desktopservices DSDontWriteNetworkStores |
@Adubzzy Thanks for the update. We've gotten other reports that For context, were this volumes originally netatalk2 volumes that were converted to netatalk3? Or created with netatalk3 from scratch? |
Yes I believe the problematic shares were created originally in netatlk2 and then I upgraded to netatalk3. If this isn't a big deal for anyone else, I don't really think it's a good idea to keep pursuing, I just silenced my logs to print WARN level messages and it stopped complaining. I plan on converting everything to SMB when I upgrade FreeBSD to v13 in a few weeks. That and afp is a dead protocol from apple's side, so if I can get everything running on SMB I'll be fine. |
@Adubzzy I think it's still worth keeping this issue ticket open regardless. Converting netatalk2 volumes to netatalk3 is still an active usecase since netatalk2 is still alive and kicking (appletalk support.) Anyhow, I would recommend using Netatalk / AFP only if you need to network older Macs (Mountain Lion and earlier) or Apple II clients. If all your Macs speak SMB natively then Samba is clearly the way to go. :) |
I suspect this is the same regression I encountered with the dbd tool after fixes were applied to harden AppleDouble verification. When the dbd tool encounters a malformed AppleDouble header, it can't fix it because the stricter checking causes the utility to terminate parsing. This leads to a catch-22 where the utility that can repair the errors, but can't because the adouble library detects an error and bails. I would try downgrading to Netatalk 3.1.12, running dbd on your file shares and seeing if that corrects the errors. |
Grab an installer from either: https://download.freebsd.org/ftp/releases/ISO-IMAGES/13.1/ (try FreeBSD-13.1-RELEASE-i386-disc1.iso for CD or FreeBSD-13.1-RELEASE-i386-memstick.img for USB) https://download.freebsd.org/ftp/releases/VM-IMAGES/13.1-RELEASE/amd64/Latest/ Once installed, as root (or via sudo https://people.freebsd.org/~murray/handbook/security-sudo.html), you can install netatalk with I think you will find this occurs in all the directories in the configured share, regardless of metadata. I had tried |
@derekmarcotte Thanks, I have FreeBSD set up in a VM now and running a Netatalk share. |
@derekmarcotte I have been running the latest main development code on FreeBSD for about a week now, doing some light copying of files back and forth on macOS Ventura and Mac OS 9.1 clients. No EA errors as of yet. So I still think what we're seeing is some kind of corrupted metadata is the culprit, whether it's caused by failed AFP operations or failed conversion from ad to ea metadata... Edit: what I meant to say is that it's non-trivial to reproduce with a fresh shared volume. |
Site note: One potential workaround is to disable the ad to ea on-the-fly conversion in netatalk3. The afp.conf option is:
|
I am not surprised you are having a difficult time reproducing this issue. As I mentioned in previous posts, this only happens on 2 out of 4 directories I have listed. One is my home directory and another is a miscellaneous storage dir. I also have 2 directories for TimeMachine Backups and they load fine. Also when I create a new test directory it works fine. It seems like something got corrupted and I don't know how to fix them. Even though I took the measures I noted above with the "DBD" command. If I want to try the convert appledouble = no setting.... Does that go into the global section or individual share sections? |
Please have a look at the man page: https://netatalk.sourceforge.io/3.1/htmldocs/afp.conf.5.html |
@anodos325 Do you have an idea why the current code throws What I see is the Edit: So AFP_ASSERT is defined as
...which means that AFP_ASSERT(false) lets the program continue running, doesn't it? |
I added the convert appledouble = no option to the volumes that give me trouble and still getting errors when log level is set to "error". Not sure why but I didn't include my full config, I added below to see if there is something maybe I am missing. ; [Global] [Homes] [TimeMachine2] [TimeMachineLB] [Stuff] [Torrent] |
On a side note when I was running the command |
As @derekmarcotte calls out, and as evident from all the recent logs that I've seen, the issue happens when For those of you where the error isn't fatal, can you please run BTW, the "easy" solution here is to partially revert 4140e54 and restore the call to |
This option worked perfectly for me, I was having issues with my time machine share. Thank you! |
Ever since I upgraded to 3.1.12 on Ubuntu 20.04 (netatalk:amd64 (3.1.12 I have been getting 1000's of these errors:
I have been trying many different things to clean up these errors for the last two months, I have also tired to delete and recreate the DB (in /var/lib/netatalk/CNID/) and still no luck. Today I thought to try and copy the sparsebundle to a new AFP share to see if it's ok, that seems to have worked. What I did in the end was:
After doing this, it seems to have stopped reporting the ad errors and the Time Machine backups are all working. There must be something different between this new version 3.1.12~ds-4ubuntu0.20.04.1 and the previous version I had Thanks |
@starkjs Thanks for sharing your scenario! Yes, as I demonstrated in another ticket, #357 , Ubuntu recently applied a suite of security fixes which strengthens the validation of extended attribute headers. As has been demonstrated here, and by other reports, there is some kind of extended attribute of the root directory of a shared netatalk volume that is not passing this validation. If you saved a backup of the malfunctioning volumes before you moved them, I have a PR with some added logging here: #363 . If you're able to compile and run netatalk from the code in this PR, it would help pinpoint which type of metadata is causing the failed validation. And, please try running |
Hi @rdmark, Ah, thanks for the link to the other ticket, I had not found that one in my searching. That looks very similar, but I am not getting a crash. So that is very curious! I was able to do the
If I compare that to the new directory I have created, it looks like the user.org.netatalk.Metadata is different, but not sure if or how it matters.
Yep, happy to compile based on your PR, I don't think I am going to get time to do that this week. Thanks |
All, I have a tentative fix for this issue now in PR #363 If you have a moment to spare, I would appreciate if you could test it and provide feedback. |
To explain the theory of the fix, thanks to additional logging and help from the reporter of #368, we found out that the root dir of their shared volume had the four netatalk private AppleDouble entires (PRIVDEV/PRIVINO/PRIVSYN/PRIVID) set but no data in them (zero length). The However, reading the AppleDouble spec I could confirm that zero length AD entries are a valid case. The caveat is that the private netatalk entries aren't of course covered by Apple's spec, but our testing so far suggests that zero length private entries are safe. Now, I first filed my own fix to allow zero length entries in the previously mentioned PR. However, further research made me realize that @Synology-andychen actually filed a fix for this a year ago in #178 so I went ahead and merged his fix to main earlier. My own PR only has a few minor additional fixes in it now to remove a special case for the COMMENT entry amongst other things. Anyhow, there is still a chance that some of you are actually encountering a different issue than the zero length entry described above, so please be continuously vigilant about post-fix "invalid metadata EA this is now being treated as a fatal error" messages which will require further analysis to figure out what is failing the validity check! |
The Debian Buster netatalk package has been hotfixed now, so if you're running Buster you can do The patch will probably propagate to Ubuntu soon, too, although I don't have any insights into their process. |
Closing this out now after merging #363 which is a minor change that simplifies the handling of COMMENT entries. Since the logic changed quite a lot, I've left the assertion in place for one more release cycle. If you all encounter this "invalid metadata EA" error again, this means there's yet another metadata corner case that needs to be addressed. In that case, please raise a new issue ticket and share the full log and backtrace leading up the error. Once we are confident that all corner cases have been addressed, we will take action in #400 to remove the assertion and allow netatalk to delete invalid entries in the future. |
Note that the netatalk 3.1.15~ds-3 package in Debian unstable has been patched now with a fix for this bug:
|
I am running "12.3-RELEASE-p11 FreeBSD 12.3-RELEASE-p11 GENERIC amd64" and have just updated to the newest netatalk port using postmaster.
netatalk3-3.1.14,1 File server for Mac OS X
I read several reports on sourceforge documenting the issue I am seeing below:
https://sourceforge.net/p/netatalk/bugs/670/?limit=25
same recurring error in the log and that this would be addressed in the newest release. I do not think it was addressed as my logs are still being spammed with the message. I even rebooted the machine to make sure all libraries and apps start up organically.
My afpd logs show this error every few seconds while I have a share open:
Mar 02 16:29:24.771487 afpd[1134] {ad_open.c:818} (error:ad): ad_header_read_ea("/usr/home/alex"): invalid metadata EA this is now being treated as a fatal error. if you see this log entry, please file a bug ticket with your upstream vendor and attach the generated core file.
Mar 02 16:29:24.771494 afpd[1134] {ad_open.c:1280} (error:ad): ad_open_hf_ea: unexpected: Invalid argument
The text was updated successfully, but these errors were encountered: