Resend Activation Email - 404 Error

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:

  1. Sign up with the default form
  2. Ignore the activation email and attempt to sign in
  3. Click “Resend Activation Email” on the popup “You can’t log in yet. We previously sent an activation email to you…”
  4. “An error occurred: The requested URL or resource could not be found.”
  5. 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?

1 Like

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.

The 404 error is being triggered here:

1 Like

This sounds like a bug to me.

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.

2 Likes

Thanks for the report @john.sanchirico, and also @simon for the detailed analysis :pray:

This will be fixed by

2 Likes

This topic was automatically closed after 20 hours. New replies are no longer allowed.