Failing to install the discourse-crowd plugin

(Jakub Ryška) #1


I’m trying to install the crowd-discourse plugin.
I’m successful at the localhost with vagrant, but when I’m trying to do it in the production on docker, I’m not successful.

Even though that I haven’t even cloned the repo in the plugins directory, when I run the bundle exec rake assets:precompile command in the /var/www/discourse dir as root, it results in error:

PG::Error: FATAL:  Peer authentication failed for user "discourse"

What does it mean? I didn’t do anything with the database. I can see that the discourse is usable, the posts are fetched into fronted…

My version is: e5059137d0908d0a84b11158f69a7754069d7f7c

(Ben T) #2

Have you ./launcher rebuild app after adding the information to the .yml file? It should pick up any plugins when updating… no need to go into the container and run any commands.

(Jakub Ryška) #3

The plugin says, that I need to modify discourse.conf. Should I also do it from the .yml file? with echo >>?

Is there any difference between going to the docker and running the commands there and doing it from the .yml file? I want firstly test out that my plugin installation is working correctly and then save it into the .yml file.

(Ben T) #4

You’ll have a difficult time getting the assets to re-compile inside the container; as it’s designed to be re-built after an update anyway. There may be steps to take where you can re-compile assets after bootstraping, but I am not aware of them.

The variables you are talking about can be added in the env section of the .yml file. They should be picked up and sent when rebuilding discourse.

(Jakub Ryška) #5

Not sure if the rebuild was such a good idea, got this error:

cd /var/www/discourse && sudo -E -u discourse bundle exec rake db:migrate failed with return #<Process::Status: pid 18508 exit 1> (RuntimeError)

And the discourse is down.

(Ben T) #6

Did the rebuild log contain any other information? It should be showing what step it failed at while rebuilding the database.

Since the data is stored outside of the container, it will be safe to rebuild again if you need to capture the message.

(Jakub Ryška) #7

Yeah, there is the message:

/pups/lib/pups/exec_command.rb:85:in `spawn': cd /var/www/discourse && sudo -E -u discourse bundle exec rake db:migrate failed with return #<Process::Status: pid 269 exit 1> (RuntimeError)
	from /pups/lib/pups/exec_command.rb:55:in `block in run'
	from /pups/lib/pups/exec_command.rb:53:in `each'
	from /pups/lib/pups/exec_command.rb:53:in `run'
	from /pups/lib/pups/command.rb:6:in `run'
	from /pups/lib/pups/config.rb:85:in `block (2 levels) in run_commands'
	from /pups/lib/pups/config.rb:76:in `each'
	from /pups/lib/pups/config.rb:76:in `block in run_commands'
	from /pups/lib/pups/config.rb:75:in `each'
	from /pups/lib/pups/config.rb:75:in `run_commands'
	from /pups/lib/pups/config.rb:71:in `run'
	from /pups/lib/pups/cli.rb:31:in `run'
	from /pups/bin/pups:8:in `<main>'

(Ben T) #8

Have you updated the launcher recently? ‘git pull’ while in the ‘/var/docker’ folder.

(Jakub Ryška) #9

OK, I’ve been able to proceed, the problem was in the misconfiguration.

I still cannot get the plugin working with docker based setup, the log (/app/shared/log/rails/production.log) says this:

Processing by Users::OmniauthCallbacksController#failure as HTML
  Parameters: {"message"=>"invalid_credentials", "strategy"=>"crowd"}

and the gui saying this:

Sorry, there was an error authorizing your Crowd account. Perhaps you did not approve authorization?

which is unlikely, since I’m able to get it working on localhost with development vagrant environment.

Is there a way, how to debug the the discourse in the docker environment? Can I turn some development setting somewhere?

Crowd plugin authentication
(Sam Saffron) #10

You can always ssh in and muck around. We should add a guide.

./launcher ssh app
sudo -iu discourse
cd /var/www/discourse

To restart unicorn

sv stop unicorn
sv start unicorn