Zend certified PHP/Magento developer

Caffeinate cannot connect to server, authorization required

In order to prevent sleep, I have a script:

tmux new-session -d -s "cafe" "caffeinate sleep infinity"

This would run caffeinate forever in the background and not take up a terminal window that I must keep open. It worked for weeks but something seems to have changed and I’m not sure what. It probably happened while upgrading from Ubuntu 20.04 to 23.04.

Anything I try to caffeinate runs the command successfully but includes the following output:

Connection to server failed -- (version 11.0)
Authorization required, but no authorization protocol specified
 at -e line 12.

Running caffeine with no parameters is also supposed to keep the computer awake while the process is alive but it fails without any output (fails as in the computer can still sleep even though the process is still running). It makes sense that caffeinate might have a daemon that actually keeps the computer awake and it’s only triggered by command line tools, but if that’s the case I need more info.

I’ve tried purging and reinstalling the caffeine package but it changes nothing.

Anybody ever run into this before?