Crowd plugin, compile fails all the time, unable to install


(Rad) #1

I hope someone has seen this before, so let me explain. I have Discourse instance running in Docker container and everything seems to be OK, until I try to install Crowd auth. plugin from:


I have changed /var/discourse/containers/app.yml to include GitHub - discourse/discourse-crowd: A plugin to enable authentication support for Atlassian Crowd git (excerpt from app.yml file below):

## The docker manager plugin allows you to one-click upgrade Discouse
## http://discourse.example.com/admin/docker
hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - mkdir -p plugins
          - git clone https://github.com/discourse/docker_manager.git
          **- git clone https://github.com/discourse/discourse-crowd.git**

In bold typeface is the line i have added and after I recompile the app, i get the following error:

FAILED
--------------------
RuntimeError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 291 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:105:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"web", "cmd"=>["gem update bundler", "chown -R discourse $home", "su discourse -c 'bundle install --deployment --verbose --without test --without development'", "su discourse -c 'bundle exec rake db:migrate'", "su discourse -c 'bundle exec rake assets:precompile'"]}
14f72c2f8ec529031108aa9ff174b95b74ed8185b0b043b55aa301872f9385c0
FAILED TO BOOTSTRAP

If I comment out the line, everything goes OK, but I seem to be unable to install the plugin which I so desperately need. What could be the issue? The documentation with the plugin is almost non existent. Since I have just copied/paste the plugin URL in app.yml file, I don’t think it is syntax issue, or maybe there is another step that I am not aware of…
Any help is much appreciated.
Thanks!


(Sam Saffron) #2

Need more of your log to debug this.


(Rad) #3

Here’s the app log after unsuccessful compile:

rad@discourse:/var/discourse$ sudo ./launcher logs my_container
WARNING: No memory limit support
WARNING: No swap limit support
Config file was not found, ensure containers/my_container.yml exists

Available configs ( app )
rad@discourse:/var/discourse$ ls
bin  cids  containers  image  launcher  README.md  samples  scripts  shared  templates
rad@discourse:/var/discourse$ ls containers/
app.yml
rad@discourse:/var/discourse$

The /var/log/docker.log seems to be not very helpful (to me at least) but here it is anyway, last few lines when error kicks in:
[info] POST /v1.15/containers/create
[b13da9eb] +job create()
[b13da9eb] +job log(create, c454d903ede267364f7b1ca90976eb7b6a1d2ecab179fa4e5dc02aded910caf8, samsaffron/discourse:1.0.6)
[b13da9eb] -job log(create, c454d903ede267364f7b1ca90976eb7b6a1d2ecab179fa4e5dc02aded910caf8, samsaffron/discourse:1.0.6) = OK (0)
[b13da9eb] -job create() = OK (0)
[info] POST /v1.15/containers/c454d903ede267364f7b1ca90976eb7b6a1d2ecab179fa4e5dc02aded910caf8/attach?stderr=1&stdin=1&stdout=1&stream=1
[b13da9eb] +job container_inspect(c454d903ede267364f7b1ca90976eb7b6a1d2ecab179fa4e5dc02aded910caf8)
[b13da9eb] -job container_inspect(c454d903ede267364f7b1ca90976eb7b6a1d2ecab179fa4e5dc02aded910caf8) = OK (0)
[b13da9eb] +job attach(c454d903ede267364f7b1ca90976eb7b6a1d2ecab179fa4e5dc02aded910caf8)
[info] POST /v1.15/containers/c454d903ede267364f7b1ca90976eb7b6a1d2ecab179fa4e5dc02aded910caf8/start
[b13da9eb] +job start(c454d903ede267364f7b1ca90976eb7b6a1d2ecab179fa4e5dc02aded910caf8)
[b13da9eb] +job allocate_interface(c454d903ede267364f7b1ca90976eb7b6a1d2ecab179fa4e5dc02aded910caf8)
[b13da9eb] -job allocate_interface(c454d903ede267364f7b1ca90976eb7b6a1d2ecab179fa4e5dc02aded910caf8) = OK (0)
[b13da9eb] +job log(start, c454d903ede267364f7b1ca90976eb7b6a1d2ecab179fa4e5dc02aded910caf8, samsaffron/discourse:1.0.6)
[b13da9eb] -job log(start, c454d903ede267364f7b1ca90976eb7b6a1d2ecab179fa4e5dc02aded910caf8, samsaffron/discourse:1.0.6) = OK (0)
[b13da9eb] -job start(c454d903ede267364f7b1ca90976eb7b6a1d2ecab179fa4e5dc02aded910caf8) = OK (0)
[b13da9eb] +job log(die, c454d903ede267364f7b1ca90976eb7b6a1d2ecab179fa4e5dc02aded910caf8, samsaffron/discourse:1.0.6)
[b13da9eb] -job log(die, c454d903ede267364f7b1ca90976eb7b6a1d2ecab179fa4e5dc02aded910caf8, samsaffron/discourse:1.0.6) = OK (0)
[b13da9eb] +job release_interface(c454d903ede267364f7b1ca90976eb7b6a1d2ecab179fa4e5dc02aded910caf8)
[b13da9eb] -job release_interface(c454d903ede267364f7b1ca90976eb7b6a1d2ecab179fa4e5dc02aded910caf8) = OK (0)
[info] POST /v1.15/containers/c454d903ede267364f7b1ca90976eb7b6a1d2ecab179fa4e5dc02aded910caf8/wait
[b13da9eb] +job wait(c454d903ede267364f7b1ca90976eb7b6a1d2ecab179fa4e5dc02aded910caf8)
[b13da9eb] -job attach(c454d903ede267364f7b1ca90976eb7b6a1d2ecab179fa4e5dc02aded910caf8) = OK (0)
[b13da9eb] -job wait(c454d903ede267364f7b1ca90976eb7b6a1d2ecab179fa4e5dc02aded910caf8) = OK (0)
[info] DELETE /v1.15/containers/c454d903ede267364f7b1ca90976eb7b6a1d2ecab179fa4e5dc02aded910caf8
[b13da9eb] +job rm(c454d903ede267364f7b1ca90976eb7b6a1d2ecab179fa4e5dc02aded910caf8)
[b13da9eb] +job log(destroy, c454d903ede267364f7b1ca90976eb7b6a1d2ecab179fa4e5dc02aded910caf8, samsaffron/discourse:1.0.6)
[b13da9eb] -job log(destroy, c454d903ede267364f7b1ca90976eb7b6a1d2ecab179fa4e5dc02aded910caf8, samsaffron/discourse:1.0.6) = OK (0)
[b13da9eb] -job rm(c454d903ede267364f7b1ca90976eb7b6a1d2ecab179fa4e5dc02aded910caf8) = OK (0)

Do I need to have my_container.yml file under containers directory created and configured? What other logs do I need to post?

Thanks,
Rad


(Rad) #4

Thanks Sam,
What other logs do I need to post please?
Thanks!


(Sam Saffron) #5

I need you to run

./launcher rebuild app

and post the full output here.


(Rad) #6

I have uncommented git repo entry in app.yml for Crowd plugin install so the error could be reproduced. Here is the full output of the ./launceher rebuild app in .txt file.
launcher-app-rebuild-log.txt (55.2 KB)


(Sam Saffron) #7

You need to set the env var for DISCOURSE_CROWD_SERVER_URL for that plugin to work.


(Rad) #8

Thanks, just a curiosity, once env var is set (i’ll have to do it tomorrow to test it properly) do I get the option for Crowd auth at the login screen, as in Yahoo/Google login for example when they are enabled, or is it default login once it’s compiled? Is there anything else I should be paying attention to?


(Sam Saffron) #9

I am not sure … @eviltrout wrote it, I think it works that way.

Note there are a bunch of other env vars you need to set as well …

crowd_application_name , crowd_application_password and crowd_application_mode (all in caps with a DISCOURSE_ in front) , once you get this working PLEASE submit a PR with updated instruction on the plugin repo so others don’t fail in future.


(Robin Ward) #10

You definitely need all the ENV vars as noted in the README. Once that’s done, you’ll get a button for logging in with Crowd in the login dialog.

You can keep other providers, but so far all our clients who have used crowd have disabled them in the admin section and only gone with crowd.


(Rad) #11

I have configured a Crowd application on our stage to be used for authentication as seen in the text file attached, app.yml with redacted info. I tried again and it fails with similar message as before (if not theapp.yml.txt (3.6 KB) same). I would really like get this going past configuration stage so I can tweak things and hopefully post full how-to for future reference here. I hope env vars are in the right place, app.yml.
@eviltrout, in which file do I have to stick in the env variables? /var/discourse/containers/app.yml or somewhere else? If you need any additinal info or a log file please let me know. I got the button working on unsupported Debian install, no Docker container, but I would like to have it running in container since that is the supported method.
Thanks!
Rad