Can't upgrade user to admin - unhandled server error

I tried searching for an answer, so sorry if I missed something, but I am not able to upgrade 2 users to admin (self-hosted) and getting an unhandled server error when I tap the grant admin button.

Any ideas?

Do you see anything helpful in the Discourse logs? {}/logs/ ?

1 Like

Nothing jumping out that is obvious to me right away, but I’ll review more in detail.

I’ve found in the past that errors I find in the logs don’t initially seem to relate to the issue I’m having, but the timestamp indicates otherwise so it’s probably better to trigger the issue and check for that timestamp, then report back with the exact error - folks here (not me usually) are pretty good at figuring out the issue based on the errors.

1 Like

As well as the /logs, you can also try it in safe mode and see if the error still occurs, as well as checking the browser console for any errors when you try and click the button. :+1:

@JammyDodger thanks for the tip, still seems to fail in safe mode but was worth a try.

@rorycb the following line appeared in the logs:

Job exception: Failed to open TCP connection to (redacted) (Cannot assign requested address - connect(2) for “(redacted)” port 443)

1 Like

It seems like it’s struggling trying to send the confirmation email. I would definitely look into what’s causing that, but I think a potential workaround in the short term is to add 2FA to your admin account (a good idea anyway) and granting admin would use that rather than an email confirmation.

Thanks @JammyDodger I started wondering if that was the issue, I’ll get that sorted and try again.

*edit → enabled 2FA for both, but still getting unhandled server error.

1 Like

Some additional detail from /var/discourse/shared/standalone/log/rails/production.log

Started PUT "/admin/users/30591/grant_admin" for (IP redacted) at 2023-08-30 15:01:47 +0000
Processing by Admin::UsersController#grant_admin as */*
Parameters: {"user_id"=>"30591"}
Completed 403 Forbidden in 12ms (Views: 0.3ms | ActiveRecord: 0.0ms | Allocations: 1492)

Just to be sure, you enabled it for the person granting admin and not the people getting admin?

1 Like

2FA was already enabled for the account granting admin to others.

1 Like

Any suggestions here? We are having the same issue. I se the same 403 happening in the production.log file. The frontend returns a 503.