Webserver Inaccessible when Screen is Asleep?

Trying out the webserver feature today–upon troubleshooting tonight, it seems like when the screen goes to sleep on my server that is running DEVONthink Server, the webserver becomes inaccessible. As soon as I wake the screen, even before login in, it becomes accessible again. The computer itself is never asleep.

Anyone else experiences this?

I don’t use the webserver, so can’t say. But it occurs to me that maybe your machine is actually asleep and you are not aware. Check in the Mac’s Systems Setings, Energy Saver, that “Prevent computer from sleeping automatically when the display is off”.

You can run the command line following to look at the system log of your machine going into and out of sleep:

pmset -g log|grep -e " Sleep " -e " Wake "

There are other settings in Energy Saving about power nap and wake for network access, but I’ve never gotten them to work consistently for me. I’ve not pursued.

Did you enable the option to wake up the computer in case of network access in system preferences?

FYI, it’s that “wake-up in case of network” access option that I’ve had mixed success with, for other (not DEVONthink) “network access” programs. Good to hear that maybe DEVONthink will “wake” a sleeping machine.

Thanks for the ideas.

I’ve checked my settings (System Preferences>Energy Saver):
Computer sleep = never
Display sleep = 15 minutes
Do not put hard disks to sleep
Wake for network access

I checked the pmset log. I found no Wake or Sleep entries at all since the last restart.

Here are my current live settings:

System-wide power settings:
Currently in use:
         standbydelay         4200
         Sleep On Power Button 1
         standby              0
         womp                 1
         hibernatefile        /var/vm/sleepimage
         halfdim              1
         sms                  1
         networkoversleep     0
         disksleep            0
         sleep                0 (sleep prevented by backupd)
         hibernatemode        3
         ttyskeepawake        1
         displaysleep         15
         acwake               0
         lidwake              1

The server is a retired rack-mounted MBP running macOS 10.13.6 for content caching, TimeMachine, Plex, and now DEVONthink server. Only Plex and DT are accessible outside the house. During the testing time, Plex was accessible, but the DT webpage was not–both remotely and on the local network. As soon as I started a Screen Sharing connection to the server, the DT webserver login page would load. If I logged out of Screen Sharing, waited ~15 minutes, DT webserver would become inaccessible again.

Upon further testing this morning:

  1. I set the display sleep to 3 minutes, but it still takes closer to 15 minutes before I lose access. So probably not actually related to screen sleep time?

  2. Logging in through a secure shell does not trigger it to start working.

  3. Clicking on “Screen Sharing” in the Finder, activates the DT loading of the login page as soon as the dialog pop up asking if you want to share the screen of the logged-in user or log in as a different user.

  4. When it’s not working, I’m not getting an error in the browser, it just says “connecting” but never does (importantly, it doesn’t ever time out either). As soon as Screen Sharing activates, the DT log in page loads.

So have spent the morning working through a number of settings in a step-wise fashion. It appears that having a screen lock active cuts off access to the webserver once it kicks in, however, I don’t have to unlock the screen to regain access, just get the login screen to come up (or the Share Screens window to choose whether to share with the logged-in user or log in as a different user).

Since I disabled the screen lock (System Preferences>Security & Privacy>General>Require a password after sleep or screensaver) I have been able to access the webserver with no problems.

Not a security issue for my use case, but something to be aware of.

Thanks for the diligence and follow-up.

1 Like

Another source of oddity is the SMC. I started having constant Zoom camera freezes, also in Facetime.

The Facetime freezes went away with a reset of the SMC and the PRAM. I haven’t had a Zoom call yet, so I’m not sure if that was cured, too, but I think it probably was.

How that’s done differs depending on your system’s internals, basically whether or not your Mac has a T2 chip. I assume the M1 falls in that category, too.

I can’t select an alternate boot or reset the PRAM with my Apple Bluetooth keyboard. It wakes up too late for the command-option-P-R Vulcan neck pinch to work. I’ve got an old USB keyboard I’ve kept for just this purpose, though. About half the keys on that old keyboard no longer work, but at least the left hand command and option keys, and P and R, still work.

I’ve had to reboot the SMC twice in the time I’ve been using Macs, about 6 years at this point. It’s something that matters so seldom it’s easy to forget the SMC is there.

1 Like

I find if I plug in the charging cable the most times it works.

Doh! The wireless keyboard will plug into a USB port. Is there nothing the Apple Magic Keyboard will not do?

In fact, I’ve heard if you press keys in certain order it will crank out a New York Times bestseller on demand. That’s a cool keyboard, just wish I knew that hot-key sequence.

Thanks for the tip!

Slightly off-topic, but related, is that I have no problems at all with a headless MacMini running Big Sur, which used for webdav-based sync (not the same as a server I know, but a related use case).

The Mac Mini will sleep and wake just fine including waking and spinning up the external RAID when needed.

One part of getting it working easily and reliably (for me) was finding the utility Resolutionator which makes using a remote screen easy without any need to use the Terminal. An iMac on the same network (Gigabit Ethernet) runs as display, with 2560x1440 resolution. Not the max possible on the iMac, but more than good enough.


No connection other than being a satisfied customer.

Russell