User mail activation url not working.

26 views
Skip to first unread message

Aman Aman

unread,
Mar 24, 2016, 1:10:49 PM3/24/16
to rubyonra...@googlegroups.com
I was following the tutorails in
https://www.railstutorial.org/book/account_activation_password_reset#sec-activating_the_account
for usr email activation. I successfully got the mail in development log
file but when enter that url it does not opens.
I have again checked the log file for error but there is no error on it
. And when I check my server console it give prints the following :

[2016-03-24 22:37:58] ERROR bad Request-Line
`\x16\x03\x03\x00?\x01\x00\x00?\x03
\x03V?\x1E?\x11?\x04?M??y?b????yGl?\x03S\x11?\x00?\x10E?`\x00\x008?0?/?(?'?\x14?
\x13\x00?\x00?\x00?\x00?\x00=\x00<\x005\x00/?,?+?$?#?'.
[2016-03-24 22:37:58] ERROR bad Request-Line
`\x16\x03\x01\x00}\x01\x00\x00y\x03
\x01V?\x1E??-O??'aY?R?GZ;?g^9F??E?\x1Ct?\x00\x00\x18?\x14?\x13\x005\x00/?'.

--
Posted via http://www.ruby-forum.com/.

Colin Law

unread,
Mar 24, 2016, 4:35:28 PM3/24/16
to Ruby on Rails: Talk
On 24 March 2016 at 17:09, Aman Aman <li...@ruby-forum.com> wrote:
> I was following the tutorails in
> https://www.railstutorial.org/book/account_activation_password_reset#sec-activating_the_account
> for usr email activation. I successfully got the mail in development log
> file but when enter that url it does not opens.

What url are you entering?

> I have again checked the log file for error but there is no error on it
> . And when I check my server console it give prints the following :
>
> [2016-03-24 22:37:58] ERROR bad Request-Line
> `\x16\x03\x03\x00?\x01\x00\x00?\x03
> \x03V?\x1E?\x11?\x04?M??y?b????yGl?\x03S\x11?\x00?\x10E?`\x00\x008?0?/?(?'?\x14?
> \x13\x00?\x00?\x00?\x00?\x00=\x00<\x005\x00/?,?+?$?#?'.
> [2016-03-24 22:37:58] ERROR bad Request-Line
> `\x16\x03\x01\x00}\x01\x00\x00y\x03
> \x01V?\x1E??-O??'aY?R?GZ;?g^9F??E?\x1Ct?\x00\x00\x18?\x14?\x13\x005\x00/?'.

Post the section of the log that is generated when you enter the url,
or do you mean there is nothing added to the log? It looks like some
sort of encoding error.

Colin

Aman Aman

unread,
Mar 27, 2016, 11:32:55 AM3/27/16
to rubyonra...@googlegroups.com
I have attached some of my files for user activation mail. You can check
it.
and here is what I get on development log file when I signup a new user.
and the mail in development log file.

Started POST "/users" for ::1 at 2016-03-27 20:37:31 +0530
Processing by UsersController#create as HTML
Parameters: {"utf8"=>"✓",
"authenticity_token"=>"k37x/FEjLGKxkSbAMlH1zt3QLze/gQCXHrwk0bXtlFPoF/mbduoI4gQ4H7bhZOhD+jw2375EpMzqy6IeeifmHQ==",
"user"=>{"name"=>"testing", "email"=>"siteshr...@gmail.com",
"password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"},
"commit"=>"Create my account"}
[1m[35m (1.0ms)[0m BEGIN
[1m[36mUser Exists (36.6ms)[0m [1mSELECT 1 AS one FROM `users` WHERE
`users`.`email` = 'siteshr...@gmail.com' LIMIT 1[0m
[1m[35mSQL (111.8ms)[0m INSERT INTO `users` (`name`, `email`,
`password_digest`, `created_at`, `updated_at`, `activation_digest`)
VALUES ('testing', 'siteshr...@gmail.com',
'$2a$10$0Q8teDUvinfjI3y.df4lwuDKcT1DiKUHmxk.VX0Iz8LPaANI4VVvy',
'2016-03-27 15:07:32', '2016-03-27 15:07:32',
'$2a$10$FQI1PtuYiq7UOFK8WVsUnuZ2lUS5gR04LC.dqQ8ILW5QIHdZzRJtq')
[1m[36m (32.3ms)[0m [1mCOMMIT[0m
Rendered user_mailer/account_activation.html.erb within layouts/mailer
(2.0ms)
Rendered user_mailer/account_activation.text.erb within layouts/mailer
(0.0ms)

UserMailer#account_activation: processed outbound mail in 315.2ms

Sent mail to siteshr...@gmail.com (340.5ms)
Date: Sun, 27 Mar 2016 20:37:33 +0530
From: amanpr...@gmail.com
To: siteshr...@gmail.com
Message-ID: <56f7f7366091_2...@DESKTOP-A70NEJG.mail>
Subject: Account activation
Mime-Version: 1.0
Content-Type: multipart/alternative;
boundary="--==_mimepart_56f7f735c4e0f_2668335a258201e4";
charset=UTF-8
Content-Transfer-Encoding: 7bit


----==_mimepart_56f7f735c4e0f_2668335a258201e4
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit

Hi testing,

Welcome to the Ama's Website! Click on the link below to activate your
account:

https://localhost:3000/account_activations/pkYUYrlBZPPqz82hSPyMSQ/edit?email=siteshranjan39%40gmail.com


----==_mimepart_56f7f735c4e0f_2668335a258201e4
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: 7bit

<html>
<body>
<h1>Aman website</h1>

<p>Hi testing,</p>

<p>
Welcome to the Aman's website! Click on the link below to activate
your account:
</p>

<a
href="https://localhost:3000/account_activations/pkYUYrlBZPPqz82hSPyMSQ/edit?email=siteshranjan39%40gmail.com">Activate</a>


</body>
</html>

----==_mimepart_56f7f735c4e0f_2668335a258201e4--

Redirected to http://localhost:3000/
Completed 302 Found in 2635ms (ActiveRecord: 181.6ms)


Started GET "/" for ::1 at 2016-03-27 20:37:34 +0530
Processing by SitePagesController#home as HTML
Rendered site_pages/home.html.erb within layouts/application (2.0ms)
Rendered layouts/_menubar.html.erb (4.0ms)
Rendered layouts/_footer.html.erb (1.0ms)
Completed 200 OK in 285ms (Views: 284.6ms | ActiveRecord: 0.0ms)


Started GET "/login" for ::1 at 2016-03-27 20:57:05 +0530
Processing by LoginController#new as HTML
Rendered login/new.html.erb within layouts/application (2847.2ms)
Rendered layouts/_menubar.html.erb (69.8ms)
Rendered layouts/_footer.html.erb (1.0ms)
Completed 200 OK in 7874ms (Views: 7721.3ms | ActiveRecord: 0.0ms)


And I am entering this url for activation
https://localhost:3000/account_activations/pkYUYrlBZPPqz82hSPyMSQ/edit?email=siteshranjan39%40gmail.com

Attachments:
http://www.ruby-forum.com/attachment/11315/account_activations_controller.rb
http://www.ruby-forum.com/attachment/11316/users_controller.rb
http://www.ruby-forum.com/attachment/11317/application_controller.rb
http://www.ruby-forum.com/attachment/11318/application_mailer.rb
http://www.ruby-forum.com/attachment/11319/user_mailer.rb
http://www.ruby-forum.com/attachment/11320/account_activation.html.erb

Colin Law

unread,
Mar 27, 2016, 11:42:43 AM3/27/16
to Ruby on Rails: Talk
On 27 March 2016 at 16:32, Aman Aman <li...@ruby-forum.com> wrote:
> I have attached some of my files for user activation mail. You can check
> it.
> and here is what I get on development log file when I signup a new user.
> and the mail in development log file.

It is not good just posting a big chunk of code and logs, you need to
find the bit that is failing and explain the problem clearly. You
have not even said here what the problem is.

Colin

Aman Aman

unread,
Mar 27, 2016, 12:46:11 PM3/27/16
to rubyonra...@googlegroups.com
Colin Law wrote in post #1182496:
The Problem is that when I register new user I gets the mail in
development log file and I can also see the generated mail in server
console. But when I enter the activation url from the mail it does not
opens and I get the error bad request line in the server console Like.
> [2016-03-24 22:37:58] ERROR bad Request-Line
> `\x16\x03\x03\x00?\x01\x00\x00?\x03
> \x03V?\x1E?\x11?\x04?M??y?b????yGl?\x03S\x11?\x00?\x10E?`\x00\x008?0?/?(?'?\x14?
> \x13\x00?\x00?\x00?\x00?\x00=\x00<\x005\x00/?,?+?$?#?'.
> [2016-03-24 22:37:58] ERROR bad Request-Line
> `\x16\x03\x01\x00}\x01\x00\x00y\x03
> \x01V?\x1E??-O??'aY?R?GZ;?g^9F??E?\x1Ct?\x00\x00\x18?\x14?\x13\x005\x00/?'.

I don't know why. Is it ssl error ? I am working on localhost .

Colin Law

unread,
Mar 27, 2016, 3:09:05 PM3/27/16
to Ruby on Rails: Talk
On 27 March 2016 at 17:45, Aman Aman <li...@ruby-forum.com> wrote:
> Colin Law wrote in post #1182496:
>> On 27 March 2016 at 16:32, Aman Aman <li...@ruby-forum.com> wrote:
>>> I have attached some of my files for user activation mail. You can check
>>> it.
>>> and here is what I get on development log file when I signup a new user.
>>> and the mail in development log file.
>>
>> It is not good just posting a big chunk of code and logs, you need to
>> find the bit that is failing and explain the problem clearly. You
>> have not even said here what the problem is.
>>
>> Colin
>
> The Problem is that when I register new user I gets the mail in
> development log file and I can also see the generated mail in server
> console. But when I enter the activation url from the mail it does not
> opens and I get the error bad request line in the server console Like.

What happens if you copy/paste the url from the email into the browser
address bar?

If that still gives the same error what happens if you re-type it into
the address bar (boring I know but please try it).

Colin

>> [2016-03-24 22:37:58] ERROR bad Request-Line
>> `\x16\x03\x03\x00?\x01\x00\x00?\x03
>> \x03V?\x1E?\x11?\x04?M??y?b????yGl?\x03S\x11?\x00?\x10E?`\x00\x008?0?/?(?'?\x14?
>> \x13\x00?\x00?\x00?\x00?\x00=\x00<\x005\x00/?,?+?$?#?'.
>> [2016-03-24 22:37:58] ERROR bad Request-Line
>> `\x16\x03\x01\x00}\x01\x00\x00y\x03
>> \x01V?\x1E??-O??'aY?R?GZ;?g^9F??E?\x1Ct?\x00\x00\x18?\x14?\x13\x005\x00/?'.
>
> I don't know why. Is it ssl error ? I am working on localhost .
>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/fe2f647f61074c649316b11c46bff694%40ruby-forum.com.
> For more options, visit https://groups.google.com/d/optout.

Aman Aman

unread,
Mar 29, 2016, 2:03:56 PM3/29/16
to rubyonra...@googlegroups.com
Colin Law wrote in post #1182498:

> What happens if you copy/paste the url from the email into the browser
> address bar?
>
> If that still gives the same error what happens if you re-type it into
> the address bar (boring I know but please try it).
>
> Colin

Yes it's giving same error

Colin Law

unread,
Mar 29, 2016, 3:55:15 PM3/29/16
to Ruby on Rails: Talk
On 27 March 2016 at 16:32, Aman Aman <li...@ruby-forum.com> wrote:
>
> Welcome to the Ama's Website! Click on the link below to activate your
> account:
>
> https://localhost:3000/account_activations/pkYUYrlBZPPqz82hSPyMSQ/edit?email=siteshranjan39%40gmail.com

What happens if you try it with http rather than https?

Colin

Aman Aman

unread,
Mar 30, 2016, 2:17:10 PM3/30/16
to rubyonra...@googlegroups.com
Thanks http solved the issue

Colin Law

unread,
Mar 30, 2016, 4:13:35 PM3/30/16
to Ruby on Rails: Talk
On 30 March 2016 at 19:15, Aman Aman <li...@ruby-forum.com> wrote:
> Thanks http solved the issue

I should have noticed that earlier.

By the way, in future could you please remember to quote the previous
message when replying, it makes it easier to follow the thread. This
is a mailing list not a forum (though you may be accessing it via a
forum-like interface. Thanks.

Colin
Reply all
Reply to author
Forward
0 new messages