Homestead: Redis is not started automatically

Created on 27 Jul 2020  ·  7Comments  ·  Source: laravel/homestead

Versions

  • Vagrant: 2.2.9
  • Provider: Virtualbox 6.1.12
  • Homestead: 11.0.1

Host operating system

macOS 10.15.6

Homestead.yaml

---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: ~/Sites/WebDev/php
      to: /home/vagrant/code

sites:
    - map: homestead.test
      to: /home/vagrant/code/laravel/public

databases:
    - homestead

features:
    - webdriver: true

Vagrant destroy & up output

https://gist.github.com/michaeldzjap/8515acea457c657cf7bb4bee22b32b6b

Expected behavior

I would expect sudo service redis-server status to show an "Active: active (running) ..." status.

Actual behavior

Instead I get:

● redis-server.service - Advanced key-value store
     Loaded: loaded (/lib/systemd/system/redis-server.service; disabled; vendor preset: enabled)
     Active: inactive (dead)
       Docs: http://redis.io/documentation,
             man:redis-server(1)

After manually running sudo service redis-server start I get:

● redis-server.service - Advanced key-value store
     Loaded: loaded (/lib/systemd/system/redis-server.service; disabled; vendor preset: enabled)
     Active: active (running) since Mon 2020-07-27 07:48:47 UTC; 2s ago
       Docs: http://redis.io/documentation,
             man:redis-server(1)
    Process: 4497 ExecStart=/usr/bin/redis-server /etc/redis/redis.conf (code=exited, status=0/SUCCESS)
   Main PID: 4513 (redis-server)
      Tasks: 5 (limit: 2320)
     Memory: 3.6M
     CGroup: /system.slice/redis-server.service
             └─4513 /usr/bin/redis-server 127.0.0.1:6379

Steps to reproduce

  1. Install laravel homestead 11.0.1
  2. vagrant up

References

  • Came across this closed issue which seems related: GH-1328

Most helpful comment

Hrm, Sorry about that. I guess it's not as clear as I remembered.

Essentially you need to add a services section to Homestead.yaml and add redis-server to the enabled list:

services:
    - enabled:
        - "redis-server"

All 7 comments

Same problem here...same workaround...

Please read the release notes about enabling/disabling services: https://github.com/laravel/homestead/releases/tag/v11.0.0

@svpernova09 Where in the release notes does it state that you have to explicitly enable _Redis_ from now on? It's also nowhere to be found in this list. Little bit confusing to be honest, as you never needed to do this for _Redis_ prior to this release (as opposed for other services like webdriver or mariadb).

Hrm, Sorry about that. I guess it's not as clear as I remembered.

Essentially you need to add a services section to Homestead.yaml and add redis-server to the enabled list:

services:
    - enabled:
        - "redis-server"

Ok, thanks for confirming! I will give that a try. Might be good to add it to the documentation though.

With the next 20.04 base box release redis-server should start automatically https://github.com/laravel/settler/commit/064a6e8935191e700a13fb6dae3ab2dffe1cd7a6

Was having same issue. Tried to update with 'vagrant box update' but said 10.0.0-beta was the latest (is that true?), But luckily svpernova09's suggestion to edit the Homestead.yml fixed it for me. Thanks svpernova09!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bironeaj picture bironeaj  ·  3Comments

Quix0r picture Quix0r  ·  4Comments

Modelizer picture Modelizer  ·  5Comments

svpernova09 picture svpernova09  ·  5Comments

dorinniscu picture dorinniscu  ·  4Comments