500 Internal Server NoMethod Error on Registration

(Daniel) #1

Hello there!
I am encountering this problem after installing Discourse in Vultr (1GB installation with swap. Ubuntu 16.04).
Followed all the steps here:

Server mail was not working (although it did get through the registration) so I decided to wipe out the server and start again with Mailgun. But after inputting the details for the registration and clicking on submit I get HTTP 500.
Here the log bit:

Completed 500 Internal Server Error in 230ms (ActiveRecord: 36.7ms)
NoMethodError (undefined method `strip' for nil:NilClass)
/var/www/discourse/app/controllers/finish_installation_controller.rb:15:in `register'

Also getting this:

Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED) subscribe failed, reconnecting in 1 second. Call stack ["/var/www/discourse/vendor/bund
le/ruby/2.3.0/gems/redis-3.3.3/lib/redis/client.rb:345:in `rescue in establish_connection'", "/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/redis-3.3.
3/lib/redis/client.rb:331:in `establish_connection'", "/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/redis-3.3.3/lib/redis/client.rb:101:in `block in 
connect'", "/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/redis-3.3.3/lib/redis/client.rb:293:in `with_reconnect'", "/var/www/discourse/vendor/bundle/
ruby/2.3.0/gems/redis-3.3.3/lib/redis/client.rb:100:in `connect'", "/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/redis-3.3.3/lib/redis/client.rb:364:
in `ensure_connected'", "/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/redis-3.3.3/lib/redis/client.rb:221:in `block in process'", "/var/www/discourse
/vendor/bundle/ruby/2.3.0/gems/redis-3.3.3/lib/redis/client.rb:306:in `logging'", "/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/redis-3.3.3/lib/redis
/client.rb:220:in `process'", "/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/redis-3.3.3/lib/redis/client.rb:134:in `block in call_loop'", "/var/www/d
iscourse/vendor/bundle/ruby/2.3.0/gems/redis-3.3.3/lib/redis/client.rb:280:in `with_socket_timeout'", "/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/r
edis-3.3.3/lib/redis/client.rb:133:in `call_loop'", "/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/redis-3.3.3/lib/redis/subscribe.rb:43:in `subscript
ion'", "/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/redis-3.3.3/lib/redis/subscribe.rb:12:in `subscribe'", "/var/www/discourse/vendor/bundle/ruby/2.
3.0/gems/redis-3.3.3/lib/redis.rb:2765:in `_subscription'", "/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/redis-3.3.3/lib/redis.rb:2143:in `block in 
subscribe'", "/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/redis-3.3.3/lib/redis.rb:58:in `block in synchronize'", "/usr/local/lib/ruby/2.3.0/monitor
.rb:214:in `mon_synchronize'", "/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/redis-3.3.3/lib/redis.rb:58:in `synchronize'", "/var/www/discourse/vendo
r/bundle/ruby/2.3.0/gems/redis-3.3.3/lib/redis.rb:2142:in `subscribe'", "/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/message_bus-2.0.5/lib/message_b
us/backends/redis.rb:302:in `global_subscribe'", "/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/message_bus-2.0.5/lib/message_bus.rb:513:in `global_su
bscribe_thread'", "/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/message_bus-2.0.5/lib/message_bus.rb:461:in `block in new_subscriber_thread'"]
Job exception: Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED)

Tried to to git pull+rebuild and nothing…
Any ideas? :frowning: Let me know if you need any further details…

(Jeff Atwood) #2

Hard to say, looks like you have a busted / incomplete install. I’d start over and follow our official guide to the letter.

(Daniel) #3

Just got a reply from Vultr and they say they won’t look into it since it’s Ubuntu 16.04
I will wipe-out the server and start again…

The swap file creation is not in the official guide, though. Are these steps correct?:

  1. Create an empty swap file: sudo install -o root -g root -m 0600 /dev/null /swapfile
  2. Write out a 1GB file named: swapfile: dd if=/dev/zero of=/swapfile bs=1k count=1024k
  3. Tell Linux that this is the swap file: mkswap /swapfile
  4. Activate it: swapon /swapfile
  5. Add it to the system table so that it is available after reboot: echo “/swapfile swap swap auto 0 0” | sudo tee -a /etc/fstab
  6. Set the “swappiness” so that it is only used as an emergency buffer: sudo sysctl -w vm.swappiness=10

Thanks a lot for your support!! :smiley:

(Jeff Atwood) #4

The setup script sets up the swap file, so I don’t know what you’re talking about?

(Daniel) #5

It looks like I was following a mix of both guides and creating the swap file before hand…

Anyway, tried clean install, only following official guide, and same error :frowning:

(Daniel) #6

Ok, weird. Tried to follow the install wizard using the IP address instead of the subdomain, and it worked.
Curiously enough, when following the confirmation link in the email (now with the subdomain, not the IP) the wizard continued without problem…
Not sure if this might have something to do with the way Cloudflare is routing the subdomain to the IP?