Telegram Notifications Plugin (discourse-telegram-notifications)


(GoXonLine) #21

@david is fixed! thanks! Great work!!!


(Pad Pors) #22

Hi.

we got errors using this plugin, when we enter a chat ID into the field in user profile page 500 Internal Server Error as well as the log below:

ActiveRecord::RecordNotUnique (PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "user_custom_fields_pkey" DETAIL: Key (id)=(699) already exists. : INSERT INTO "user_custom_

it seems there exists conflict between some user-custom fields (an existing one and the new one).

is it a bug regarding the plugin? if so, may you check it?


(SMHassanAlavi) #23

@david

I think I found the problem. The plugin is trying to push a new row with and id to database but the problem is the id is already exists.
I have scanned the database to find the last id saved in database. and it was 717 but this plugin was trying to push a row with id of 699.
Where did you find the id and how?
previously I have created a plugin and for finding the last id. I ran this code:
SELECT id FROM user_custom_fields ORDER BY id DESC
and I choose the last id and add 1 to this id (new id = last id + 1) to find the good id to insert.


(Rafael dos Santos Silva) #24

The column id on user_custom_fields has an associated sequence that will guarantee that this never happens, except on the case someone messed with the database table and inserted an ID like you did, instead of omitting it and letting PostgreSQL insert the next one automatically and increment the sequence.

You should never do this.


[PAID] A plugin for showing some charts in user profile and topics
(David Taylor) #25

I don’t think I’m doing anything unusual with regards to the database - all I’m doing is registering a custom field. Maybe @Falco can confirm to be sure? The relevant lines are:

@Alavi1412 and @Pad_Pors are you managing the same discourse instance, or is this two separate forums?


(Rafael dos Santos Silva) #26

No, not you.

If they have a mismatch between the pg sequence and the table means they either: have another bad plugin or messed directly with the table.


(Pad Pors) #28

thanks for the handy plugin :slight_smile: , two slight suggestions, which you may have thought about yourself:

to make this simpler:

the user can simply give his email to the bot (the same email he uses in the discourse forum).

then if this happens, create topic can be handled via “create topic via email”.


(Pad Pors) #29

I got errors using the plugin, is it something related to the telegram bot or is it related to the plugin?

are the errors important?


(David Taylor) #30

Possibly something on the plugin side to do with unicode escaping… Would you be able to PM the exact content of one of the failed posts?

Can you also click on one of those errors, go to the “info” tab, and send the whole of that message to me?


(Daniela) #31

Hi @david,
I’ve just istalled this plugin.

Probably I found an issue

If the plugin is not active (no flag on “telegram notifications enabled” and no token):

  • A group’s owner says that he can’t add member to his group (he can’t click on Add members)
  • I can’t change ownership to the posts. When I try to save it says that an error has occurred

All the problems disappear when the plugin is active.

Here the logs:

Info
Job exception: unexpected return

Backtrace
/var/www/discourse/plugins/discourse-telegram-notifications/plugin.rb:195:in `block (2 levels) in activate!'
/var/www/discourse/lib/discourse_event.rb:12:in `block in trigger'
/usr/local/lib/ruby/2.4.0/set.rb:324:in `each_key'
/usr/local/lib/ruby/2.4.0/set.rb:324:in `each'
/var/www/discourse/lib/discourse_event.rb:11:in `trigger'
/var/www/discourse/app/services/post_alerter.rb:408:in `create_notification'
/var/www/discourse/app/services/post_alerter.rb:480:in `block in notify_non_pm_users'
/var/www/discourse/app/services/post_alerter.rb:479:in `each'
/var/www/discourse/app/services/post_alerter.rb:479:in `notify_non_pm_users'
/var/www/discourse/app/services/post_alerter.rb:69:in `after_save_post'
/var/www/discourse/app/services/post_alerter.rb:6:in `post_created'
/var/www/discourse/app/jobs/regular/post_alert.rb:7:in `execute'
/var/www/discourse/app/jobs/base.rb:154:in `block (2 levels) in perform'
Env
hostname	adu1-app
process_id	[144, 138]
application_version	d29a0eeedf23dfd2dd67dcb78aedbc3834078c78
current_db	default
current_hostname	forum.adunanza.net
job	Jobs::PostAlert
problem_db	default
	
opts	null
post_id	[57483, 57489, 57502, 57503, 57506, 57507, 57513, 57515, 57522, 57523, 57533, 57534, 57536, 57537, 57538]
current_site_id	default

Info

    LocalJumpError (unexpected return)
    /var/www/discourse/plugins/discourse-telegram-notifications/plugin.rb:195:in `block (2 levels) in activate!'
Backtrace
/var/www/discourse/plugins/discourse-telegram-notifications/plugin.rb:195:in `block (2 levels) in activate!'
/var/www/discourse/lib/discourse_event.rb:12:in `block in trigger'
/usr/local/lib/ruby/2.4.0/set.rb:324:in `each_key'
/usr/local/lib/ruby/2.4.0/set.rb:324:in `each'
/var/www/discourse/lib/discourse_event.rb:11:in `trigger'
/var/www/discourse/app/services/post_alerter.rb:408:in `create_notification'
/var/www/discourse/app/services/post_alerter.rb:480:in `block in notify_non_pm_users'
/var/www/discourse/app/services/post_alerter.rb:479:in `each'
/var/www/discourse/app/services/post_alerter.rb:479:in `notify_non_pm_users'
/var/www/discourse/app/services/post_alerter.rb:60:in `after_save_post'
/var/www/discourse/lib/post_revisor.rb:473:in `alert_users'
/var/www/discourse/lib/post_revisor.rb:173:in `revise!'
/var/www/discourse/app/models/post.rb:452:in `revise'
/var/www/discourse/app/models/post.rb:495:in `set_owner'
/var/www/discourse/app/services/post_owner_changer.rb:24:in `block (2 levels) in change_owner!'
/var/www/discourse/app/services/post_owner_changer.rb:15:in `each'
/var/www/discourse/app/services/post_owner_changer.rb:15:in `block in change_owner!'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/transaction.rb:184:in `within_new_transaction'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/transactions.rb:220:in `transaction'
/var/www/discourse/app/services/post_owner_changer.rb:14:in `change_owner!'
/var/www/discourse/app/controllers/topics_controller.rb:547:in `change_post_owners'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/abstract_controller/base.rb:198:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_controller/metal/rendering.rb:10:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:117:in `call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:505:in `call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:92:in `__run_callbacks__'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:778:in `_run_process_action_callbacks'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:81:in `run_callbacks'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/abstract_controller/callbacks.rb:19:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_controller/metal/rescue.rb:29:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/notifications.rb:164:in `block in instrument'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/notifications.rb:164:in `instrument'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/abstract_controller/base.rb:137:in `process'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionview-4.2.8/lib/action_view/rendering.rb:30:in `process'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-mini-profiler-0.10.5/lib/mini_profiler/profiling_methods.rb:76:in `block in profile_method'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_controller/metal.rb:196:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_controller/metal.rb:237:in `block in action'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_dispatch/routing/route_set.rb:74:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_dispatch/routing/route_set.rb:43:in `serve'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_dispatch/journey/router.rb:43:in `block in serve'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_dispatch/journey/router.rb:30:in `each'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_dispatch/journey/router.rb:30:in `serve'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_dispatch/routing/route_set.rb:817:in `call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:189:in `call!'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:167:in `call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:189:in `call!'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:167:in `call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:189:in `call!'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:167:in `call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:189:in `call!'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:167:in `call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:189:in `call!'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:167:in `call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:189:in `call!'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:167:in `call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:189:in `call!'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:167:in `call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/builder.rb:63:in `call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-1.6.8/lib/rack/conditionalget.rb:38:in `call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-1.6.8/lib/rack/head.rb:13:in `call'
/var/www/discourse/lib/middleware/anonymous_cache.rb:149:in `call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_dispatch/middleware/flash.rb:260:in `call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-1.6.8/lib/rack/session/abstract/id.rb:225:in `context'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-1.6.8/lib/rack/session/abstract/id.rb:220:in `call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_dispatch/middleware/cookies.rb:560:in `call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/query_cache.rb:36:in `call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:88:in `__run_callbacks__'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:81:in `run_callbacks'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/logster-1.2.7/lib/logster/middleware/reporter.rb:31:in `call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-4.2.8/lib/rails/rack/logger.rb:38:in `call_app'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-4.2.8/lib/rails/rack/logger.rb:22:in `call'
/var/www/discourse/config/initializers/100-quiet_logger.rb:17:in `call_with_quiet_assets'
/var/www/discourse/config/initializers/100-silence_logger.rb:29:in `call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_dispatch/middleware/request_id.rb:21:in `call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-1.6.8/lib/rack/methodoverride.rb:22:in `call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-1.6.8/lib/rack/runtime.rb:18:in `call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-1.6.8/lib/rack/sendfile.rb:113:in `call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-mini-profiler-0.10.5/lib/mini_profiler/profiler.rb:171:in `call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/message_bus-2.0.2/lib/message_bus/rack/middleware.rb:62:in `call'
/var/www/discourse/lib/middleware/request_tracker.rb:73:in `call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-4.2.8/lib/rails/engine.rb:518:in `call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-4.2.8/lib/rails/application.rb:165:in `call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-4.2.8/lib/rails/railtie.rb:194:in `public_send'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-4.2.8/lib/rails/railtie.rb:194:in `method_missing'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-1.6.8/lib/rack/urlmap.rb:66:in `block in call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-1.6.8/lib/rack/urlmap.rb:50:in `each'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-1.6.8/lib/rack/urlmap.rb:50:in `call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/unicorn-5.3.0/lib/unicorn/http_server.rb:606:in `process_client'
/var/www/discourse/lib/scheduler/defer.rb:85:in `process_client'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/unicorn-5.3.0/lib/unicorn/http_server.rb:702:in `worker_loop'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/unicorn-5.3.0/lib/unicorn/http_server.rb:549:in `spawn_missing_workers'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/unicorn-5.3.0/lib/unicorn/http_server.rb:142:in `start'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/unicorn-5.3.0/bin/unicorn:126:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.4.0/bin/unicorn:22:in `load'
/var/www/discourse/vendor/bundle/ruby/2.4.0/bin/unicorn:22:in `<main>'
Env
hostname	adu1-app
process_id	[194, 176, 159]
application_version	d29a0eeedf23dfd2dd67dcb78aedbc3834078c78
HTTP_HOST	forum.adunanza.net
REQUEST_URI	/t/13856/change-owner
REQUEST_METHOD	POST
HTTP_USER_AGENT	Mozilla/5.0 (Windows NT 10.0; WOW64; rv:54.0) Gecko/20100101 Firefox/54.0
HTTP_ACCEPT	*/*
HTTP_REFERER	https://forum.adunanza.net/t/tester-alpha/13856/10
HTTP_X_FORWARDED_FOR	95.249.136.250, unix:
HTTP_X_REAL_IP	unix:
username	Dax
	
params	
post_ids	[57539]
username	Dax

Discourse version 1.9.0.beta4 +2


(David Taylor) #32

Oops, sorry about that - definitely not what you want to happen when the plugin is supposed to be disabled!

I’ve pushed a fix


(Makary Gołosz) #33

Hi there! Great job, this plugin and the Chatroom Integration!
I’m wondering lately… Would it require lots of work to adapt this plugin to work with FB Messenger?
We’d really love to see the possibility to receive notifications this way :slight_smile:
Cheers!


(Jay Patel) #34

Well I have currently applied this Solution for my forum: linked rss feed of latest to >> riot.im [Matrix] room and have Matrix room connection to >> telegram group/channel :slight_smile: it works like charm. Hope it helps to some


(David Taylor) #35

It’s next on the list, hopefully I’ll have an answer as to whether it’s possible next week :slight_smile:

Edit: to clarify: that’s FB messenger as part of the discourse-chat-integration plugin, not an equivalent to the plugin described in this thread


(Erlend Sogge Heggen) #36

Speaking of which, shouldn’t this Telegram plugin eventually be deprecated in favour of the discourse-chat-integration plugin?


(David Taylor) #37

They solve different problems - this is for personal notifications for any forum users, discourse-chat-integration is for forum admins to integrate specific categories with team/group chats.

Technical difference is that this one uses DiscourseEvent.on(:post_notification_alert), whereas Discourse-chat-integration implements its own filtering system.

I’ve added a big notice at the top of this page which describes the difference.


(Makary Gołosz) #38

Well actually that’s exactly my point.
I’d like to see a plugin that sends personal notifications on the user basis via Messenger. :left_speech_bubble:


(David Taylor) #39

Ah, in that case sorry :frowning: , it’s not something I’m currently planning to make. I will let you know if that changes.

But to answer your original question of how much work it is - the Discourse end is super easy, it’s the API integration with Facebook that takes more time.


(Makary Gołosz) #40

I’m not much of a Ruby programmer, so I thought about setting up some bot/service registered w/ Messenger, I could write it on PHP or Python… What do you think about this approach?


Edit:
I just looked into fb API, it’s nightmarish. Sending a message from Discourse to user would require geting three different access tokens :open_mouth:


Chatroom Integration Plugin (discourse-chat-integration)
(Oleg Bovykin) #41

I got this problem with latest version of discourse. I think its because of skip_before_filter deprecation in Rails 5.1.

I, [2017-09-25T13:47:51.874514 #15]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
rake aborted!
NoMethodError: undefined method `skip_before_filter' for DiscourseTelegramNotifications::TelegramController:Class
Did you mean?  skip_before_action
/var/www/discourse/plugins/discourse-telegram-notifications/plugin.rb:35:in `<class:TelegramController>'
/var/www/discourse/plugins/discourse-telegram-notifications/plugin.rb:32:in `block in activate!'
/var/www/discourse/lib/plugin/instance.rb:248:in `block in notify_after_initialize'
/var/www/discourse/lib/plugin/instance.rb:246:in `each'
/var/www/discourse/lib/plugin/instance.rb:246:in `notify_after_initialize'
/var/www/discourse/config/application.rb:211:in `each'
/var/www/discourse/config/application.rb:211:in `block in <class:Application>'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.3/lib/active_support/lazy_load_hooks.rb:43:in `execute_hook'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.3/lib/active_support/lazy_load_hooks.rb:52:in `block in run_load_hooks'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.3/lib/active_support/lazy_load_hooks.rb:51:in `each'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.3/lib/active_support/lazy_load_hooks.rb:51:in `run_load_hooks'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/railties-5.1.3/lib/rails/application/finisher.rb:73:in `block in <module:Finisher>'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/railties-5.1.3/lib/rails/initializable.rb:30:in `instance_exec'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/railties-5.1.3/lib/rails/initializable.rb:30:in `run'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/railties-5.1.3/lib/rails/initializable.rb:59:in `block in run_initializers'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/railties-5.1.3/lib/rails/initializable.rb:58:in `run_initializers'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/railties-5.1.3/lib/rails/application.rb:353:in `initialize!'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/railties-5.1.3/lib/rails/railtie.rb:185:in `public_send'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/railties-5.1.3/lib/rails/railtie.rb:185:in `method_missing'
/var/www/discourse/config/environment.rb:5:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:292:in `require'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:292:in `block in require'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:258:in `load_dependency'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:292:in `require'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/railties-5.1.3/lib/rails/application.rb:329:in `require_environment!'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/railties-5.1.3/lib/rails/application.rb:445:in `block in run_tasks_blocks'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:22:in `load'
/usr/local/bin/bundle:22:in `<main>'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)
I, [2017-09-25T13:48:17.409992 #15]  INFO -- : gem install hkdf -v 0.2.0 -i /var/www/discourse/plugins/discourse-push-notifications/gems/2.3.4 --no-document --ignore-dependencies
Successfully installed hkdf-0.2.0
1 gem installed
gem install webpush -v 0.3.1 -i /var/www/discourse/plugins/discourse-push-notifications/gems/2.3.4 --no-document --ignore-dependencies
Successfully installed webpush-0.3.1
1 gem installed



FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 10652 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:108:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"bundle_exec", "cmd"=>["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'"]}
e84c434754eac73b5ab7855b5cbcae06c844146d070f452225e4b331920f6a25
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one