Error setting up with separate Redis

There is a half-lazy database server running PostgreSQL inside local network and I wanted to use it for Discourse too. Reason for this is that the web server, is far more stressed than the previously mentioned database one, which still has a lot of unused resources/potential. Redirecting Discourse’s PostgreSQL was quite easy, following a few threads on this forum (example). Whenever I try to do the same for Redis though:

  • commenting out - "templates/redis.template.yml"
  • setting DISCOURSE_REDIS_HOST instead

I always get:

Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 582 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
bootstrap failed with exit code 1

whenever I try to rebuild with launcher rebuild app

Is this a known issue? Anyone successfully running Discourse with non-containerised Redis?

That is all you need indeed. Can you paste a the complete rebuild error? You probably have either the need for a password, mandatory TLS or an unreachable domain. Which one should be clear in the rebuild log.

1 Like

That’s basically all. There are some warnings further up the log:

warning " > @mixer/parallel-prettier@2.0.3" has unmet peer dependency "prettier@^2.0.0".
warning "eslint-config-discourse > eslint-plugin-lodash@7.1.0" has unmet peer dependency "lodash@>=4".
warning " > babel-plugin-debug-macros@0.4.0-pre1" has unmet peer dependency "@babel/core@^7.0.0".
warning "workspace-aggregator-3fff36d0-9fd8-4d1a-ac4c-d10694a59627 > discourse > @uppy/aws-s3@3.0.6" has incorrect peer dependency "@uppy/core@^3.1.2".
warning "workspace-aggregator-3fff36d0-9fd8-4d1a-ac4c-d10694a59627 > discourse > @uppy/aws-s3-multipart@3.1.3" has incorrect peer dependency "@uppy/core@^3.1.2".
warning "workspace-aggregator-3fff36d0-9fd8-4d1a-ac4c-d10694a59627 > discourse > @uppy/xhr-upload@3.1.1" has incorrect peer dependency "@uppy/core@^3.1.2".

but they are there even when rebuilding with containerised Redis.

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 581 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
bootstrap failed with exit code 1
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.
2533af220cc44d8c77bc12c17ed7635dee49ba7f280[…]

UPDATE:

Found lines marked as INFO rather than error and this might be the reason I guess:

I, [2023-04-06T18:44:02.460059 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'LOAD_PLUGINS=0 bundle exec rake plugin:pull_compatible_all'
I, [2023-04-06T18:44:04.581741 #1]  INFO -- : docker_manager is already at latest compatible version

I, [2023-04-06T18:44:04.581929 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
Discourse requires Redis 6.2.0 or up
I, [2023-04-06T18:44:05.937604 #1]  INFO -- :

And the pretty fresh Ubuntu 22.04.2 LTS provides:

Package: redis-server
Architecture: amd64
Version: 5:6.0.16-1ubuntu1

Argh… no chances to use this version, right?

I believe Discourse uses some Redis commands that were only introduced with 6.2.

You can also install it using Redis’ official APT repository:

3 Likes

Yes, that’s exactly what I am doing, thank you. I only wish that message was marked as ERROR rather than INFO (among many other INFOs), and stopped right away. Lost a lot of time debugging all sort of things and not noticing this line

Redis doesn’t use many resources and you can’t share it with Multiple servers. I would just use the discourse one that was already working.