Forem Creators and Builders 🌱

kanghouse
kanghouse

Posted on

Unable to login as administrator

Hi team!

I have selfhosted Forem but was not able to login at all because after I press “create my account” after filling in my name, email and password, it just redirects me to the same signup page.

You can test it at www.waitwhatfirst.com.

Please feel free to create admin account if you can, this domain is more like a test run for me.


I've managed to get a log of whats happening with the help of the command from the comments.

Feb 01 13:19:11 www.waitwhatfirst.com forem-rails[6972]: I, [2023-02-01T13:19:11.080472 #9]  INFO -- : [50f8cb54-66c9-4bd5-a004-45f044280343] [dd.env=production dd.service=rails-production dd.trace_id=1638366970051613229 dd.span_id=0] Started POST "/users" for 203.91.233.86 at 2023-02-01 13:19:11 +0000
Feb 01 13:19:11 www.waitwhatfirst.com forem-rails[6972]: I, [2023-02-01T13:19:11.103651 #9]  INFO -- : [50f8cb54-66c9-4bd5-a004-45f044280343] [dd.env=production dd.service=rails-production dd.trace_id=1638366970051613229 dd.span_id=0] Processing by RegistrationsController#create as HTML
Feb 01 13:19:11 www.waitwhatfirst.com forem-rails[6972]: I, [2023-02-01T13:19:11.104127 #9]  INFO -- : [50f8cb54-66c9-4bd5-a004-45f044280343] [dd.env=production dd.service=rails-production dd.trace_id=1638366970051613229 dd.span_id=0]   Parameters: {"utf8"=>"✓", "authenticity_token"=>"[FILTERED]", "user"=>{"name"=>"admin", "username"=>"admin", "email"=>"[FILTERED]", "password"=>"[FILTERED]"}, "commit"=>"Create my account"}
Feb 01 13:19:12 www.waitwhatfirst.com forem-rails[6972]: I, [2023-02-01T13:19:12.015060 #9]  INFO -- : [50f8cb54-66c9-4bd5-a004-45f044280343] [dd.env=production dd.service=rails-production dd.trace_id=1638366970051613229 dd.span_id=0]   Rendered devise/registrations/by_email.html.erb within layouts/application (Duration: 52.5ms | Allocations: 7660)
Feb 01 13:19:12 www.waitwhatfirst.com forem-rails[6972]: I, [2023-02-01T13:19:12.042337 #9]  INFO -- : [50f8cb54-66c9-4bd5-a004-45f044280343] [dd.env=production dd.service=rails-production dd.trace_id=1638366970051613229 dd.span_id=0]   Rendered layout layouts/application.html.erb (Duration: 79.9ms | Allocations: 13469)
Feb 01 13:19:12 www.waitwhatfirst.com forem-rails[6972]: I, [2023-02-01T13:19:12.051026 #9]  INFO -- : [50f8cb54-66c9-4bd5-a004-45f044280343] [dd.env=production dd.service=rails-production dd.trace_id=1638366970051613229 dd.span_id=0] Completed 200 OK in 946ms (Views: 88.7ms | ActiveRecord: 8.4ms | Allocations: 19832)
Feb 01 13:19:12 www.waitwhatfirst.com forem-rails[6972]: I, [2023-02-01T13:19:12.323033 #9]  INFO -- : [3eb5102d-a7a2-4686-b65c-b5835e554e74] [dd.env=production dd.service=rails-production dd.trace_id=2682673655117032949 dd.span_id=0] Started GET "/async_info/base_data" for 203.91.233.86 at 2023-02-01 13:19:12 +0000
Feb 01 13:19:12 www.waitwhatfirst.com forem-rails[6972]: I, [2023-02-01T13:19:12.343844 #9]  INFO -- : [3eb5102d-a7a2-4686-b65c-b5835e554e74] [dd.env=production dd.service=rails-production dd.trace_id=2682673655117032949 dd.span_id=0] Processing by AsyncInfoController#base_data as JSON
Feb 01 13:19:12 www.waitwhatfirst.com forem-rails[6972]: I, [2023-02-01T13:19:12.344210 #9]  INFO -- : [3eb5102d-a7a2-4686-b65c-b5835e554e74] [dd.env=production dd.service=rails-production dd.trace_id=2682673655117032949 dd.span_id=0]   Parameters: {"locale"=>nil}
Feb 01 13:19:12 www.waitwhatfirst.com forem-rails[6972]: I, [2023-02-01T13:19:12.366237 #9]  INFO -- : [3eb5102d-a7a2-4686-b65c-b5835e554e74] [dd.env=production dd.service=rails-production dd.trace_id=2682673655117032949 dd.span_id=0] Completed 200 OK in 21ms (Views: 0.6ms | ActiveRecord: 2.3ms | Allocations: 1315)
Feb 01 13:19:12 www.waitwhatfirst.com forem-rails[6972]: F, [2023-02-01T13:19:12.397721 #7] FATAL -- : [562eb491-42fa-46fa-8be2-f0fab24e2216] [dd.env=production dd.service=rails-production dd.trace_id=2309254324490364783 dd.span_id=0]   
Feb 01 13:19:12 www.waitwhatfirst.com forem-rails[6972]: [562eb491-42fa-46fa-8be2-f0fab24e2216] [dd.env=production dd.service=rails-production dd.trace_id=2309254324490364783 dd.span_id=0] ActionController::RoutingError (No route matches [POST] "/ahoy/visits"):
Feb 01 13:19:12 www.waitwhatfirst.com forem-rails[6972]: [562eb491-42fa-46fa-8be2-f0fab24e2216] [dd.env=production dd.service=rails-production dd.trace_id=2309254324490364783 dd.span_id=0]   
Feb 01 13:19:12 www.waitwhatfirst.com forem-rails[6972]: E, [2023-02-01T13:19:12.403797 #7] ERROR -- honeybadger: ** [Honeybadger] Unable to send error report: API key is missing. id=0d98fbe7-a24a-49c0-ae1f-69110f6abbf2 level=3 pid=7
Enter fullscreen mode Exit fullscreen mode

Chris

Top comments (7)

Collapse
 
zensharp profile image
Zensharp • Edited

@kanghouse okay I made some progress:

Setting up SMTP is actually required. (I used sendgrid and it's working for me.) Just make sure that in inventory/forem/setup.yml, set default_email to the address you want your users to receive emails from (e.g. info@www.waitwhatfirst.com)

Also I obtained sendgrid_api_key and sendgrid_api_key_id here. I created an API Key with "Restricted Access" and granted "Full Access" to "Mail Send" only.

Collapse
 
ngtrian profile image
Tri Ân

👍

Collapse
 
kanghouse profile image
kanghouse

Update:
I scrapped hosting on Digital Ocean and hosted it on AWS and it is now working as intended.

I removed and everything and tried again on Digital Ocean 3 times but same result everytime.

It is either me doing something wrong or the code for Digital Ocean self deployment is not working as expected.

Collapse
 
kanghouse profile image
kanghouse • Edited

Just to add, I only followed the guide provided by Forem to selfhost.
I am not aware of any additional changes in configs if needed.

E.g. didn’t set up any SMTP, S3, DB etc

If I was meant to change some config, please let me know!

And would there be a way for me to look at the logs to see what’s happening? I wasn’t sure where the log files are kept.

Collapse
 
zensharp profile image
Zensharp

By the way, I found this for viewing the logs:

journalctl -f -u forem-rails.service
Enter fullscreen mode Exit fullscreen mode
Collapse
 
zensharp profile image
Zensharp

I'm experiencing the same issue. Is your Forem instance on Digital Ocean?

Collapse
 
kanghouse profile image
kanghouse

Correct, the Forem instance is on Digital Ocean via Fedora OS on custom image.