“macOS needs to repair your library” error loop on Mojave upgrade
https://support.apple.com/en-us/HT203538

That’s the link that should help. Worked for me.  I’d been frustrated by this problem for weeks.  Disk utility repair was not good enough. 
But resetting user permissions as per above link did the trick.