# Slack 認証プラグインの不具合修正

**URL:** <https://meta.discourse.org/t/fixing-the-broken-slack-auth-plugin/97033>\
**Category:** Development\
**Created:** [2018 年 9 月 12 日午後 1:14 UTC](https://meta.discourse.org/t/fixing-the-broken-slack-auth-plugin/97033 "2018-09-12T13:14:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kukks](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kukks/32/111004_2.png) [@Kukks](https://meta.discourse.org/u/Kukks)\
**Post date:** [2018 年 9 月 12 日午後 1:15 UTC](https://meta.discourse.org/t/fixing-the-broken-slack-auth-plugin/97033/1 "2018-09-12T13:15:00Z")

</div>

Hi there guys! Just started messing around with a discourse instance and wanted to add authentication via slack. Found an existing plugin but it’s broken so I decided to try and patch it up however I am no ruby dev at all and don’t have an env to set up for local testing and whatnot. I’ve published my fixes to the plugin at [GitHub - Kukks/oauth-slack-discourse: Discourse plugin to sign up using slack · GitHub](https://github.com/Kukks/oauth-slack-discourse/) but the discourse builder fails on it and I’m unsure why. Can someone point me in the right direction? 🙂

The code is almost identical to the linkedin auth plugin.

---

<div class="post-metadata">

**Author:** ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)\
**Post date:** [2018 年 9 月 12 日午後 7:41 UTC](https://meta.discourse.org/t/fixing-the-broken-slack-auth-plugin/97033/2 "2018-09-12T19:41:30Z")

</div>

> [@Kukks](#):
>
> but the discourse builder fails on it and I’m unsure why

Do you mean it fails when running `./launcher rebuild app`? Can you share the output please?

---

<div class="post-metadata">

**Author:** ![Kukks](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kukks/32/111004_2.png) [@Kukks](https://meta.discourse.org/u/Kukks)\
**Post date:** [2018 年 9 月 14 日午前 7:55 UTC](https://meta.discourse.org/t/fixing-the-broken-slack-auth-plugin/97033/3 "2018-09-14T07:55:28Z")

</div>

Thanks for replying @jomaxro.  
Yup, that’s the one. Output below:

```plaintext
Bundle complete! 111 Gemfile dependencies, 201 gems now installed.
Gems in the group development were not installed.
Bundled gems are installed into `./vendor/bundle`

I, [2018-09-14T07:53:36.321758 #14] INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
rake aborted!
LoadError: cannot load such file -- ginjo-omniauth-slack
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `require'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `block in require'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in `load_dependency'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `require'
/var/www/discourse/lib/plugin_gem.rb:20:in `load'
/var/www/discourse/lib/plugin/instance.rb:507:in `gem'
/var/www/discourse/plugins/oauth-slack-discourse/plugin.rb:8:in `activate!'
/var/www/discourse/lib/plugin/instance.rb:437:in `instance_eval'
/var/www/discourse/lib/plugin/instance.rb:437:in `activate!'
lib/discourse.rb:164:in `block in activate_plugins!'
lib/discourse.rb:161:in `each'
lib/discourse.rb:161:in `activate_plugins!'
/var/www/discourse/config/application.rb:224:in `<class:Application>'
/var/www/discourse/config/application.rb:39:in `<module:Discourse>'
/var/www/discourse/config/application.rb:38:in `<top (required)>'
/var/www/discourse/Rakefile:5:in `require'
/var/www/discourse/Rakefile:5:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
(See full trace by running task with --trace)
I, [2018-09-14T07:53:55.035148 #14] INFO -- : gem install ginjo-omniauth-slack -v 2.4.0 -i /var/www/discourse/plugins/oauth-slack-discourse/gems/2.5.1 --no-document --ignore-dependencies
Successfully installed ginjo-omniauth-slack-2.4.0
1 gem installed

I, [2018-09-14T07:53:55.035909 #14] INFO -- : Terminating async processes
I, [2018-09-14T07:53:55.035983 #14] 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/10/bin/postmaster -D /etc/postgresql/10/main pid: 69
2018-09-14 07:53:55.036 UTC [69] LOG: received fast shutdown request
I, [2018-09-14T07:53:55.036708 #14] INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 185
185:signal-handler (1536911635) Received SIGTERM scheduling shutdown...
2018-09-14 07:53:55.066 UTC [69] LOG: aborting any active transactions
185:M 14 Sep 07:53:55.068 # User requested shutdown...
185:M 14 Sep 07:53:55.068 * Saving the final RDB snapshot before exiting.
2018-09-14 07:53:55.070 UTC [69] LOG: worker process: logical replication launcher (PID 78) exited with exit code 1
2018-09-14 07:53:55.071 UTC [73] LOG: shutting down
185:M 14 Sep 07:53:55.150 * DB saved on disk
185:M 14 Sep 07:53:55.150 # Redis is now ready to exit, bye bye...
2018-09-14 07:53:55.162 UTC [69] 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 646 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"bundle_exec", "cmd"=>["su discourse -c 'bundle install --deployment --verbose --without test --without development --retry 3 --jobs 4'", "su discourse -c 'bundle exec rake db:migrate'", "su discourse -c 'bundle exec rake assets:precompile'"]}
492d48f97d0280a16a181bf84f908ba5b874a7fb38bf50964c7c9de0966b2785
**FAILED TO BOOTSTRAP** please scroll up and look for earlier error messages, there may be more than one

```

---

<div class="post-metadata">

**Author:** ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)\
**Post date:** [2018 年 9 月 14 日午後 4:37 UTC](https://meta.discourse.org/t/fixing-the-broken-slack-auth-plugin/97033/4 "2018-09-14T16:37:10Z")

</div>

Perhaps try using [GitHub - kmrshntr/omniauth-slack: omniauth-slack · GitHub](https://github.com/kmrshntr/omniauth-slack) instead of `ginjo-omniauth-slack`? From a quick review it seems that the `ginjo` gem is deprecated.

---

<div class="post-metadata">

**Author:** ![Kukks](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kukks/32/111004_2.png) [@Kukks](https://meta.discourse.org/u/Kukks)\
**Post date:** [2018 年 9 月 14 日午後 6:28 UTC](https://meta.discourse.org/t/fixing-the-broken-slack-auth-plugin/97033/5 "2018-09-14T18:28:11Z")

</div>

According to this thread, ginjo should be a more or less fork of that repo

[https://github.com/kmrshntr/omniauth-slack/issues/63](https://github.com/kmrshntr/omniauth-slack/issues/63)

---

<div class="post-metadata">

**Author:** ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)\
**Post date:** [2018 年 9 月 14 日午後 7:07 UTC](https://meta.discourse.org/t/fixing-the-broken-slack-auth-plugin/97033/6 "2018-09-14T19:07:07Z")

</div>

So it does. Sadly I can’t help much beyond that suggestion. I’ll note that it does _appear_ to eventually install successfully later in the logs. Perhaps one of the community developers could offer better suggestions.
