You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Why are trustd, nsurlsessiond, syslogd causing high CPU on Mac?

The syslogd high CPU I am pretty sure is a result of the excess logging coming from trustd and nsurlsessiond.

In console I am getting the same 3 messages logged constantly:

error	11:38:11.053373-0700	nsurlsessiond	Failed to obtain user-directory, errno: 5
error 11:38:11.053484-0700 nsurlsessiond Process with bundleID <private> [pid 222] does not have a bundle path, rejecting connection
error 11:38:11.053661-0700 trustd obliterateAllSessionsWithReply error handler called with error Error Domain=NSCocoaErrorDomain Code=4097 UserInfo={NSDebugDescription=<private>}
error 11:38:11.054331-0700 nsurlsessiond Failed to obtain user-directory, errno: 5


This reoccurs every millisecond or so and has been occurring since Catalina was installed. Originally after a reinstall I was running Mountain Lion and then did a bridging upgrade to Mavericks to get to Catalina. I also thought this might be due to not having iCloud setup so I logged it in but didn't change the problem.




[Re-Titled by Moderator]

Posted on Apr 8, 2020 11:42 AM

Reply
Question marked as Top-ranking reply

Posted on Jun 30, 2020 9:27 AM

Hi flipflips, I followed Jeremy's instructions, and now the issue is solved. So let me explain how to do this in more detail.


But before taking off: beware that tinkering with the Mac system using the Terminal is risky business. I had a long conversation with Apple Care, who took me through a lot of steps, and they in general advise to NOT use Terminal.

So, make sure to have a backup of all your files, and check the contents of the log-files to check that your issue is caused by exactly the same issue that Jeremy reported. That is how I did it, and it worked for me.


And if your system gets unstable, you can always go back to factory defaults, and start over from there :)


Now, first we will check the log files.

To do this, start Spotlight (the looking-glass symbol in the upper righthand corner of the screen) and type:


/var/log/asl


This brings up a Finder window with the folder with the log-files.

Those log-files have a name like:


2020.06.30.xxx.asl


You can open the log-file with the program Console (that is the default program, or you can use Open with...)


Check this log-file for lines as:


libcoreservices: __makeDirectory: 405: mkdir: path=/var/folders/zz/[randomized name]/0/ mode=0755: Operation not permitted.


The [randomize name] part is a long string like zyxvpxvq6csfxvn_n00000y800007k


This string is important: it is the name of a system subdirectory that is used by the nsurlsessiond process. Nsurlsessiond tries to write to this directory, but gets no permission, and repeats and repeats and repeats and repeats. That's why nsurlsessiond stays in the top of your list of processes, eating up to 50-60% of your CPU capacity, draining your battery, and heating your MacBook.


So check if you see these lines in your log file, to make sure your issue is the same.


To solve the issue you have to do 2 things:

  1. Kill the trustd process
  2. Delete the blocked directory, so that the OS can create a new one.


These things are done using the Terminal. You can find this program in the Launchpad, or find it using Spotlight.


First, find the name of the subdirectory (the string mentioned above). Copy it from the log-file, or find it using the Terminal.


Start the Terminal program. The Terminal window opens. After the prompt, type:


ls -la /var/folders/zz | grep nsurlsessiond


You will get an output like:


drwxr-xr-x@  5 _nsurlsessiond    _nsurlsessiond     160  9 jun 13:45 zyxvpxvq6csfxvn_n00000y800007k


The part that I made bold is the name of the subdirectory we need to delete, so copy this to your Clipboard.


Now, take a look again at the Activity monitor, and look for the trustd process, that is one of the top 3 or 4 processes in the list. It has a unique process id, the PID number (for example 219).


In Terminal, kill the trustd process, by typing:


sudo kill -9 [trustd PID]


So if the PID is 219, you type:


sudo kill -9 219


After killing this process, you will see the CPU usage drop immediately.


Now we delete the subdirectory. Again in Terminal, type


sudo rm -fr /var/folders/zz/[randomized name]


Again, replace [randomized name] with the string you copied before.


Congratulations, you are done!


Keep following your system performance for several days in the Activity Monitor.


Success!




Similar questions

125 replies

May 19, 2020 6:33 AM in response to Pau_LR

Still in "Terminal", copy and run the following command:

ls -la /var/folders/zz | grep nsurlsessiond

What you need is the name at the end of the line returned by that command.


In the line returned by the previous command, the name in the last column of that line is the name you need to replace "[randomized name]" with in the next and last command to run:

sudo rm -fr /var/folders/zz/[randomized name]

May 19, 2020 10:39 AM in response to henrytwohands

Hey bro,

I feel the exact same way. I was able to "fix" the issue, but I am awful at programming, so I did it the roundabout way. First, you have to understand exactly what is happening and why that hellish, beastly, completely ridiculous command is constantly coming on. Basically, Apple wants to know everything you do on your computer, so they can make improvements to their software. This means that every time you do anything, your Mac is sending data to Apple. Same goes for auto updates, backup and sync, etc. Every time you "communicate" with Apple via your computer, whether you mean to or not, that nsurlsessiond is the thing making that connection.


That means you have to turn off EVERYTHING that is communicating with Apple. Go into System Preferences. Start with the very first icon top left and work your way through every one, one at a time. Turn off everything that has to do with communicating to Apple. It will be intuitive. It will say very clearly, "auto-update", or "send to Apple". You'll know it when you see it. Basically, give them no permissions. SHARE NOTHING. If those bastards don't want to give us an easy fix, even after YEARS of customer complaints, then give them nothing.


I don't have a full list because I did it piecemeal over the course of a week, but here are a few I remember turning off:

Siri - Completely disable it

Auto Updates - Completely disable it

Spotlight - Completely disable it

iCloud - Completely disable it


Also, go to User Groups and check to be sure that everything that boots up on login is removed. You'll see a tab for login. Just remove everything.


Your goal is to cut all automatic communication ties with Apple. I basically did it by trial and error everyday until one morning I woke up and my computer was quiet. No fans, no hot laptop, no nsurlsessiond. Bliss...


Good luck.

Peter

May 20, 2020 4:09 PM in response to mathieu105

When I did this, it said no match found.

%  ls -la /var/folders/zz | grep nsurlsessiond  
drwxr-xr-x   4 _nsurlsessiond      _nsurlsessiond       128 Dec 12  2016 zyxvpxvq6csfxvn_n00000y800007k
% sudo rm -fr /var/folders/zz/[zyxvpxvq6csfxvn_n00000y800007k]
zsh: no matches found: /var/folders/zz/[zyxvpxvq6csfxvn_n00000y800007k]

Jun 5, 2020 2:02 AM in response to Thatusernameistaken9

I have the same problem with trustd and nsurlsessiond (didn't check syslogd yet). I just installed the last huge Catalina update - and the problem is still here.

I am no computer whizz. I did change the shell, but I do not understand what to do to get rid of the trustd issue. Sorry, guys, I'm a horse vet with a specialist degree, so I am not always stupid but I just do not understand what exactly to put into the terminal.


If someone could break it down for a dummy, I would be really happy, because the **** trustd issue eats battery like mad. When I'm at the computer I just force it to shut down with activity app, but it keeps coming back. And if it comes back, when I'm not at the Macbook it has killed the battery. (Btw. the screenshot pics are also not moving, but I chose to ignore that for the moment.)


I have to admit, I am thoroughly angered by Apple. I explicitely bought a Macbook Pro to NOT, I repeat NOT have to be a computer freak to get the bloody thing running. From what I read this is an ongoing issue for older Macs (mine is from 2013) for months, and for hundreds of people, but Apple obviously didn't see fit to do something officially about it. I was planning to change my whole practice to Mac because they have the superior display for x-rays but at the moment I'm not keen to invest a fortune in a firm that doesn't seem to give a sh*t about their customers.


Any help for a dummy would be appreciated. Please don't recommend to delete everything and setup the whole computer new from the back-up. I have read more than enough stories where that did not work out, and loads of data was lost.


Thanks in advance!!

Jun 8, 2020 12:31 PM in response to jpaussa

Same issue solved here in Denmark with the recipe above, on my girlfriend's eight year old Macbook Air after updated it to "Catalina". The folder name was exactly the same, so doesn't seem to be that random. After reboot the folder was re-created, but this time as a symbolic link - that's what the "@" in the 'ls' output means - to a directory under mountpoint /System/Volumes:

$ ls -ldi /var/folders/zz/zyxvpxvq6csfxvn_n00000y800007k
 12885475075 drwxr-xr-x@ 5 _nsurlsessiond _nsurlsessiond 160 7 Jun 09:16 /var/folders/zz/zyxvpxvq6csfxvn_n00000y800007k
$ find / -inum 12885475075 -ls 2>/dev/null
 12885475075 0 drwxr-xr-x 5 _nsurlsessiond _nsurlsessiond 160 7 Jun 09:16 /System/Volumes/Data/private/var/folders/zz/zyxvpxvq6csfxvn_n00000y800007k
 12885475075 0 drwxr-xr-x 5 _nsurlsessiond_nsurlsessiond 160 7 Jun 09:16 /private/var/folders/zz/zyxvpxvq6csfxvn_n00000y800007k

Jun 9, 2020 6:14 AM in response to Thatusernameistaken9

Thatusernameistaken9 thank you very much for taking the time and effort!!!

I followed your instructions, and it seems to have worked. That is so much better. Trustd killed the battery on my Macbook even during sleep, it really got on my nerves. I am still not happy that Apple didn't do anything to solve the problem, but I am more than thankful for the community.

Jun 11, 2020 5:27 AM in response to jpaussa

Works for me!! Thanks a lot!. After an upgrade my MacBook pro Mid 2012 to an SSD I thought the upgrade cause the overheating. I started to search about this and notice that the upgrade itself doesn't cause this problem on my Mac version. I had to keep searching for a solution and I end here. After kill the trustd process I notice that my CPU starts to low down and the overheating begin to cool down. I remove the directory and look to the attributes @jpaussa reported and looks exactly like his reply. Thank you guys!

Jun 15, 2020 11:42 AM in response to jeremywohl

Hi Jeremy, Im trying to follow your solution since im having the problem described with nsurlsessiond but when i run the commands in terminal nothing happens and it continues to give the same "operation not permitted" message inside the asl files.


Im replacing the [randomized name] with mine but nothing happens still. could you help me out? thanks

Jun 23, 2020 11:00 PM in response to elle0405

I killed the trustd process, and that has taken care of nsurlsessiond as well. It's been a few weeks now.


There is a comment, where you are walked step by step through the process. I don't have a link at the moment, but it should be this, because I'm getting the notifications. I usually don't touch Terminal, but it worked very well.


Thanks again to everyone taking time and effort to help!

Jun 29, 2020 7:01 PM in response to jeremywohl

Hi Jeremy,


I installed el Catalina last week. Long story, needed to update from 10.11 but didn't update to 10.12 first. I am having similar CPU issues and my mac is running the fan a lot more. I read your solution to this issue. I am a newbie when it comes to anything IT with my Mac Book Pro. I have a 2017. Can you walk me through how to access the log files and where to go "to terminal" etc. I have no idea what these are and where to access this on my computer. My machine is heating up alot more too. Would appreciate any help you can offer. Thank you

Why are trustd, nsurlsessiond, syslogd causing high CPU on Mac?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.