A user, jerry0, reported that enabling the Discourse Assign plugin after modifying group settings crashed their site, with error logs indicating invalid integer syntax for group name ‘patently-staff’. The issue stemmed from a failed migration where group names were stored instead of IDs. Roman diagnosed the problem and provided a Ruby script to manually update the setting by converting the group name to its ID. jerry0 confirmed the fix worked. Another user, diwr, encountered a similar issue after upgrading to 2.4.0.beta4, particularly affecting LDAP users; their ‘staff’ group had been renamed to ‘team’. Roman advised running the script with ‘team’, and diwr confirmed success after rebuilding the app. The root cause appears to be migration logic failing when group names are not matched to existing IDs, especially after renaming groups or during plugin updates.
I recently changed the site setting for the group(s) that are able to use Discourse Assign. Something went awfully wrong when I hit the update button, it took the whole site down.
I have since disabled Discourse Assign, which has got the site back up, but I am unable to get Discourse Assign working again. When I re-enable it, the site is taken down, and cannot change the site settings for the Discourse Assign plugin.
I am looking at the error logs, there are two:
ActiveRecord::StatementInvalid (PG::InvalidTextRepresentation: ERROR: invalid input syntax for integer: "patently-staff"
LINE 1: ...RE "group_users"."user_id" = 1 AND (groups.id in ('patently-...
^
: SELECT 1 AS one FROM "groups" INNER JOIN "group_users" ON "groups"."id" = "group_users"."group_id" WHERE "group_users"."user_id" = 1 AND (groups.id in ('patently-staff')) LIMIT 1)
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-mini-profiler-1.0.2/lib/patches/db/pg.rb:69:in `async_exec_params'
And:
Failed to handle exception in exception app middleware : PG::InvalidTextRepresentation: ERROR: invalid input syntax for integer: "patently-staff"
LINE 1: ...RE "group_users"."user_id" = 1 AND (groups.id in ('patently-...
^
: SELECT 1 AS one FROM "groups" INNER JOIN "group_users" ON "groups"."id" = "group_users"."group_id" WHERE "group_users"."user_id" = 1 AND (groups.id in ('patently-staff')) LIMIT 1
Is the discourse-assign plugin up to date in your instance? Or maybe you forked the plugin a while ago? There was a change in the discourse-assign plugin in July that seems relevant to the errors you’re seeing.
Hmm, I see. Did you change the setting before or after updating to beta4?
Looks like somehow our automatic migration failed to update you setting, I’m going to investigate why this happened. Did you try restarting the server before enabling the plugin just in case the old value could have been cached? Let me know if this doesn’t work and I’ll provide you a ruby script to manually fix the issue.
It happened before I updated. Something weird happened as I added the new setting, I think I pressed the green tick before “adding” the new groupname.
I am not sure how to do that (btw I may have mispoken when saying “disabled/enabled” in my OP - what I meant was that I commented out the git clone url in the app.yml file to add the plugin). When I add the plugin in the yml file it crashes the site straight away (and it was previously enabled) so I can’t go in and then set it to disabled… unless I have misunderstood you?