I’m just setting up a Discourse server with Patreon integration. I have received the following error message when Patrons sign up for Discourse:
Patreon group membership callback failed for new user 7 with error: undefined method `add' for nil:NilClass.
/var/www/discourse/plugins/discourse-patreon/plugin.rb:166:in `block (3 levels) in activate!'
/var/www/discourse/plugins/discourse-patreon/plugin.rb:164:in `each'
/var/www/discourse/plugins/discourse-patreon/plugin.rb:164:in `block (2 levels) in activate!'
/var/www/discourse/lib/plugin/instance.rb:215:in `public_send'
/var/www/discourse/lib/plugin/instance.rb:215:in `block (2 levels) in add_model_callback'
The user registers using Patreon authentication. The user is created, patreon shows up under Associated Accounts
but their Patreon data (Amount, Rewards) is not added to their profile, and they are not added to the group. If I click on Update Patreon Data & Sync Groups
, then the data shows up and they are added to the group successfully.
They are not new Patrons. They have been Patrons for a long time and are only now joining Discourse.
I’m now running the current version - 2.4.0.beta4
. It’s on my own server, but a standard install.
Before updating to this version, I did deactivate the plugin, and deleted and recreated the Client Key. (A desperate attempt to resolve a problem which was actually fixed by the new version…) I wonder whether I have “broken” the configuration around the patrons group somehow, although it does seem odd that the Sync works, but registering a new user doesn’t.
I just did a test using a test user:
- Create test user in Patreon, with pledge to my campaign. (Webhook is triggered, but I don’t think this is relevant as the problem occurs with “old” Patrons.)
- Click on
Update Patreon Data & Sync Groups
, wait for async message that data has been updated. - Register test user in Discourse.
- Check Patreon data for test user. No
Patreon
section - Amount, Rewards. User not included in patrons group. - Click on
Update Patreon Data & Sync Groups
, wait for async message that data has been updated. - Check Patreon data for test user.
Patreon
section now present, with Amount, Rewards. User is included in patrons group.
Thanks in advance for any help!