com.apple.apfsd.wbc_drain
This task has now been running for a month now, when will it stop.
Just upgraded to MacOS 10.15.2 in hope that it would stop running. 😕
It prevents my iMac to go to sleep automatic.
iMac with Retina 5K display, macOS 10.15
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.
When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.
This task has now been running for a month now, when will it stop.
Just upgraded to MacOS 10.15.2 in hope that it would stop running. 😕
It prevents my iMac to go to sleep automatic.
iMac with Retina 5K display, macOS 10.15
It seems only to affect iMac's, I run a 2017 15" and and 2019 16" not having the problem. At the moment I rely on a tool to send my device to sleep, using the keyboard works as well. Just autosleep does not work.
Please: No "hints" to SMC reset, PRAM reset, etc, the basics are in place.
Yes, same here and downgrading to Mojave has a working autosleep feature.
I guess it is the combo of IMac and OS causing this but I have not seen any announcement from Apple on this. Catalina is so bug ridden that I believe Apple treats this bug as a minor slip.
For everyone: This obviously needs Apple's attention but they will not see your report here. This is a user-to-user venue and Apple development personnel do not monitor it.
However, you can report the problem in a way Apple employees will see it by using this feedback link:
I have exactly the same problem on my Mac Mini 2012. It's never entering sleep mode anymore since I moved to Catalina. It was working very well before on Mojave. Too bad.... The update 10.15.2 did not change anything.
The command shell "pmset -g log" shows com.apple.apfsd.wbc_drain is the culprit running for hours, with an external media disk mounted, and preventing the system to sleep as follows:
2019-12-15 10:02:13 +0100 Assertions PID 172(powerd) Summary ExternalMedia "com.apple.powermanagement.externalmediamounted" 47:13:57 id:0x0x800008002 [System: BGTask kCPU]
2019-12-15 10:02:13 +0100 Assertions PID 160(UserEventAgent) Summary BackgroundTask "com.apple.apfsd.wbc_drain" 47:08:25 id:0x0xb0000819b [System: BGTask kCPU]
% pmset -g live
System-wide power settings:
Currently in use:
standby 1
Sleep On Power Button 1
womp 1
autorestart 1
hibernatefile /var/vm/sleepimage
powernap 0
networkoversleep 0
disksleep 10
standbydelayhigh 86400
sleep 1 (sleep prevented by UserEventAgent)
autopoweroffdelay 14400
hibernatemode 0
autopoweroff 1
ttyskeepawake 1
displaysleep 1
highstandbythreshold 50
standbydelaylow 86400
My mac mini server 2012 has a fusion drive with an Intel SSD I put in it (non Apple SSD).
I figured out the kernel is writing, slowly but it is always writing on the disk. The total written size increases a lot among hours, up to several gigabytes. I don't know if this is expected or not?
I made a spindump and figured out there are some fusion_wbc_xxx functions called in a loop. As per the function name it seems linked to the fusion drive. I enabled the trim option a long time ago on High Sierra or even before with no problem before I migrated to Catalina. I will make a try by disabling trim to check if the wbc_drain disappears or not?
Do you have a fusion drive too? Is trim enabled?
I have a Fusion Drive. All that I know hav the same problem, neighbors and friends who have an iMac with fusion drive.
So it have to be a major issue, but as usually Apple don't care (hope not this is true). 😕
I found a trick in https://forums.macrumors.com/threads/no-sleep-after-catalina.2204818.
Killing twice the UserAgent task that runs the culprit wbc_drain solves the problem on my Mac mini.
Execute twice: ps -ef | grep UserEventAgent | grep -v grep | awk '{print $2}'| sudo xargs kill -9
If you reboot you need to execute again those commands.
I did it yesterday evening and my Mac entered sleep mode for the whole night.
"IODisplayWrangler which prevent my mac to sleep" => this one is your display which is on :). When your display will go off your Msc should suspend.
"Reboot does not get the ...drain process back." => be careful for me it takes several minutes to be rescheduled on reboot.
I have the exact same problem with a do it yourself fusion drive in my MacBook Pro. Everything was fine until I updated to Catalina :-( In some way I am glad to hear that it happens with the original Apple Fusion Drives in iMacs as well.
Great!!!! It works!!!!
Killing twice the UserAgent task that runs the culprit wbc_drain solves the problem on my Mac mini.
Execute twice: ps -ef | grep UserEventAgent | grep -v grep | awk '{print $2}'| sudo xargs kill -9
OK, here is what I did to automate. I created the below python script:
#
# Fix apfsd assertion for Mac power management under Catalina
# (C) 2020-01-29 Bernd Kunze
#
import subprocess
import os
import time
Done = 0;
while Done == 0:
time.sleep (60);
Result = subprocess.Popen(['pmset', '-g', 'assertions'],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
PMSet = Result.communicate();
if "wbc_drain" in str (PMSet):
os.system ("ps -ef | grep UserEventAgent | grep -v grep | awk '{print $2}'| xargs kill -9");
time.sleep (5);
os.system ("ps -ef | grep UserEventAgent | grep -v grep | awk '{print $2}'| xargs kill -9");
print('\a');
print('\a');
Done = 1;
Using hhttp://launched.zerowidth.com/
a plist file is created and installed.
FixSleep.py basically waits for the assertion to appear, then kills UserEventAgent twice.
Works here, no warranties, use at your own risk.
Well, I am a bad explainer.
Place the python script in a directory of your choice, i.e. $HOME/bin. Go to http://launched.zerowidth.com/
There, create a plist file to execute the python script at boot time.
There will be instructions on how to install the plist file at the bottom of the page.
the python file that I downloaded should have a py extension, right? Then I have to put it in a folder on the computer ... How do I have to complete the launched page to get the plist file? Sorry, I recognize that I am a clumsy but I would be grateful if you could help me ... thanks
I think I understand how to build launched…. I tried but the script did not work, however, because I think I made some errors in filling the form. In particular, the tick should be placed under the heading "RUN AT LOAD" or under the heading "LAUNCH ONLY ONCE"? Please let me know ... I am attaching how I filled out the form ... Tell me if I'm wrong ... Thanks ...
com.apple.apfsd.wbc_drain