Users are experiencing a 404 Error when attempting to resend activation emails on the “Resend Activation Email” page after signing up and not activating their account. The issue is caused by the username and email parameters not being set for the POST request made to /u/action/send_activation_email. This issue also affects deactivated users who try to resend activation emails after attempting to log in.
@simon analyzed the issue and found that the problem occurs when users attempt to log in with a username and password without having activated their account. The username parameter is only set when the resend activation email button is clicked from the account-created page immediately after registering.
When a user signs up the activation email works fine. However attempting to Sign In and resend the activation emails results in the following production log:
Started POST "/u/action/send_activation_email" for (removed ip and timestamp)
Processing by UsersController#send_activation_email as */*
Completed 404 Not Found in 2ms (Views: 0.1ms | ActiveRecord: 0.0ms | Allocations: 542)
This error occurs on all of containers running 3.2.0.beta1-dev. “production_errors.log” is empty.
Steps to reproduce:
Sign up with the default form
Ignore the activation email and attempt to sign in
Click “Resend Activation Email” on the popup “You can’t log in yet. We previously sent an activation email to you…”
“An error occurred: The requested URL or resource could not be found.”
Click “OK” and then the following popup appears “We sent another activation email to you at…” (However the second activation email is not actually sent)
I see the function/action send_activation_email is rate limited.
def send_activation_email
if current_user.blank? || !current_user.staff?
RateLimiter.new(nil, "activate-hr-#{request.remote_ip}", 30, 1.hour).performed!
RateLimiter.new(nil, "activate-min-#{request.remote_ip}", 6, 1.minute).performed!
end
Would this result in the 404 error? Is there any other logs I can look at to debug this issue?
Testing this on my local dev site, the problem seems to be that neither the username or email parameters get set for the POST request that’s made to /u/action/send_activation_email when the request is made after a user who has not clicked the link in the activation email attempts to login with a username/password:
If, instead, the user clicks the Resend Activation Email button from the account-created page that’s displayed immediately after registering an account, the username parameter is set for the request. For reference, the button that is working is this one:
My guess about what’s happening is that for the request that is working, is that the parameters for the POST request are being set based off the values the user enters when they complete the signup form.
Just adding a note that this issue also prevents users who have had their accounts deactivated from their admin / users page from triggering the activation email after they attempt to login and click the “Resend Activation Email” button.
That causes the same error as has been reported above.