docs icon indicating copy to clipboard operation
docs copied to clipboard

Missing UNIX domain socket path

Open okpierre opened this issue 4 years ago • 4 comments

Testing sock connection

Command: php artisan horizon:status and then getting this error

Missing UNIX domain socket path.

  at vendor/predis/predis/src/Connection/StreamConnection.php:193
    189▕      */
    190▕     protected function unixStreamInitializer(ParametersInterface $parameters)
    191▕     {
    192▕         if (!isset($parameters->path)) {
  ➜ 193▕             throw new \InvalidArgumentException('Missing UNIX domain socket path.');
    194▕         }
    195▕ 
    196▕         $flags = STREAM_CLIENT_CONNECT;
    197▕ 

      +28 vendor frames 
  29  artisan:37
      Illuminate\Foundation\Console\Kernel::handle()

Here's my settings:

REDIS_SCHEME=unix
REDIS_HOST=/var/run/redis/redis.sock
REDIS_PASSWORD=null
REDIS_PORT=null

okpierre avatar Feb 20 '21 16:02 okpierre

Are you using predis or phpredis?

if you are using phpredis:

  • REDIS_HOST = path to socket
  • REDIS_PORT = null

if you are using predis:

  • REDIS_SCHEME = unix
  • REDIS_PATH = path to socket

trwnh avatar Feb 21 '21 01:02 trwnh

Maybe this could be mentioned in the "Generic installation guide" ...

This occurred to me when doing php artisan migrate --force, and when correcting the setting(s) as suggested above, another exception is thrown because stuff already exists :wink:

joho1968 avatar Dec 28 '22 09:12 joho1968

I bumped into the exact same problem. Please update the installation guide.

mijutu avatar Oct 07 '23 08:10 mijutu

Another issue I've encountered after resolving the one in the OP was a permission denied error on the Redis socket. The problem was that the user running the php artisan migrate --force command did not have rwx access to /run/redis/redis.sock.

  • I'm using a dedicated pixelfed user, I set the pixelfed directory owner to the pixelfed user, so this is the user running php artisan migrate --force`.
  • As per the guide on Configuring Redis socket, the permissions for the redis socket are set to 770 by the daemon, which means the redis user and redis group have rwx access to the socket.
  • I had to add the pixelfed user to the redis group in order for php artisan migrate --force to run without errors. usermod -aG redis pixelfed

Not entirely a big deal, but it would have been courteous if this was mentioned in the guide for using a dedicated pixelfed user.

hyperreal64 avatar Oct 26 '23 23:10 hyperreal64