Fail to install Discourse via Docker

I fill in the app.yml file, and use this command to rebuild the image.

sudo ./launcher rebuild app

However, I encountered this issue and I have no idea how to deal with it…

I, [2021-07-07T01:28:34.484614 #1]  INFO -- : 
I, [2021-07-07T01:28:34.484941 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
** PLUGIN FAILURE **

You are unable to build Discourse due to this error during plugin
initialization:

uninitialized constant Onebox

/var/www/discourse/plugins/google_docs_onebox/plugin.rb:6:in `activate!'
/var/www/discourse/lib/plugin/instance.rb:629:in `instance_eval'
/var/www/discourse/lib/plugin/instance.rb:629:in `activate!'
lib/discourse.rb:240:in `block in activate_plugins!'
lib/discourse.rb:237:in `each'
lib/discourse.rb:237:in `activate_plugins!'
/var/www/discourse/config/application.rb:313:in `block in <class:Application>'
/var/www/discourse/lib/plugin_initialization_guard.rb:5:in `plugin_initialization_guard'
/var/www/discourse/config/application.rb:312:in `<class:Application>'
/var/www/discourse/config/application.rb:73:in `<module:Discourse>'
/var/www/discourse/config/application.rb:72:in `<top (required)>'
/var/www/discourse/Rakefile:7:in `require'
/var/www/discourse/Rakefile:7:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rake-13.0.4/lib/rake/rake_module.rb:29:in `load'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rake-13.0.4/lib/rake/rake_module.rb:29:in `load_rakefile'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rake-13.0.4/lib/rake/application.rb:710:in `raw_load_rakefile'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rake-13.0.4/lib/rake/application.rb:104:in `block in load_rakefile'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rake-13.0.4/lib/rake/application.rb:186:in `standard_exception_handling'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rake-13.0.4/lib/rake/application.rb:103:in `load_rakefile'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rake-13.0.4/lib/rake/application.rb:82:in `block in run'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rake-13.0.4/lib/rake/application.rb:186:in `standard_exception_handling'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rake-13.0.4/lib/rake/application.rb:80:in `run'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rake-13.0.4/exe/rake:27:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.7.0/bin/rake:23:in `load'
/var/www/discourse/vendor/bundle/ruby/2.7.0/bin/rake:23:in `<top (required)>'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.19/lib/bundler/cli/exec.rb:63:in `load'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.19/lib/bundler/cli/exec.rb:63:in `kernel_load'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.19/lib/bundler/cli/exec.rb:28:in `run'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.19/lib/bundler/cli.rb:474:in `exec'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.19/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.19/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.19/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.19/lib/bundler/cli.rb:30:in `dispatch'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.19/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.19/lib/bundler/cli.rb:24:in `start'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.19/exe/bundle:49:in `block in <top (required)>'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.19/lib/bundler/friendly_errors.rb:130:in `with_friendly_errors'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.19/exe/bundle:37:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
I, [2021-07-07T01:28:35.629849 #1]  INFO -- : 
I, [2021-07-07T01:28:35.674810 #1]  INFO -- : Terminating async processes
I, [2021-07-07T01:28:35.674950 #1]  INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/13/bin/postmaster -D /etc/postgresql/13/main pid: 70
I, [2021-07-07T01:28:35.675020 #1]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 187
2021-07-07 01:28:35.675 UTC [70] LOG:  received fast shutdown request
187:signal-handler (1625621315) Received SIGTERM scheduling shutdown...
187:M 07 Jul 2021 01:28:35.675 # User requested shutdown...
187:M 07 Jul 2021 01:28:35.675 * Saving the final RDB snapshot before exiting.
2021-07-07 01:28:35.742 UTC [70] LOG:  aborting any active transactions
187:M 07 Jul 2021 01:28:35.742 * DB saved on disk
187:M 07 Jul 2021 01:28:35.742 # Redis is now ready to exit, bye bye...
2021-07-07 01:28:35.745 UTC [70] LOG:  background worker "logical replication launcher" (PID 79) exited with exit code 1
2021-07-07 01:28:35.747 UTC [74] LOG:  shutting down
2021-07-07 01:28:36.300 UTC [70] LOG:  database system is shut down


FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 3841 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
1eaf7abdf201a825d63cd5c85f3e2217f718c135926b71519cda2050340da3d5
** 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.

Here is the entire log :
Note.txt (75.4 KB)

The thing is that I don’t why I cannot add the plugin in the app.yml file.

In my app.yml, the plugin area is below:

## Plugins go here
## see https://meta.discourse.org/t/19157 for details
hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - git clone https://github.com/discourse/docker_manager.git
          - sudo -E -u discourse git clone https://github.com/discourse/discourse-solved.git
          - sudo -E -u discourse git clone https://github.com/discourse/discourse-checklist.git
          - sudo -E -u discourse git clone https://github.com/discourse/discourse-whos-online.git
          - sudo -E -u discourse git clone https://github.com/gdpelican/babble.git
          - sudo -E -u discourse git clone https://github.com/kasperpeulen/discourse-mathjax.git
          - sudo -E -u discourse git clone https://github.com/discourse/discourse-tooltips.git
          - sudo -E -u discourse git clone https://github.com/paviliondev/discourse-topic-previews.git
          - sudo -E -u discourse git clone https://github.com/naveed-ahmad/google_docs_onebox.git

It seems to encounter the permission denied issue…
Is there any method to solve it?
Thanks!!

the google_docs_onebox is probably broken, just remove the line in the app.yml ?

1 Like

The source of that gem has not been updated in 6 years. The documentation specifically says:

this plugin has been merged in offical Onebox gem. So no need to install this if you are using the latest version.

So you will need to remove that entry.

2 Likes

Got it!!
Thank you @Benjamin_D , and @Andrew Schleifer !!

Indeed what I tested is after I removed the parts below, it could work well without any error, but the entire plugins would not be installed.

- sudo -E -u discourse git clone https://github.com/discourse/discourse-solved.git
          - sudo -E -u discourse git clone https://github.com/discourse/discourse-checklist.git
          - sudo -E -u discourse git clone https://github.com/discourse/discourse-whos-online.git
          - sudo -E -u discourse git clone https://github.com/gdpelican/babble.git
          - sudo -E -u discourse git clone https://github.com/kasperpeulen/discourse-mathjax.git
          - sudo -E -u discourse git clone https://github.com/discourse/discourse-tooltips.git
          - sudo -E -u discourse git clone https://github.com/paviliondev/discourse-topic-previews.git
          - sudo -E -u discourse

Thank you for your help!!

BR,
Chieh