Help, I disabled local logins and can't get back

I chose “local logins disabled”, however, I did not add Facebook or twitter login, I can’t login my site as admin.

Any suggestions?

1 Like

You’re going to need to do a rails console recovery.

Do you have a Docker-based install or a hosted install? If hosted, contact your hosting provider (probably or

For Docker:

./launcher enter app
rails c
SiteSetting.local_logins_enabled = true

When I run command above

it shows

WARNING: No swap limit support
Downloading nsenter
Pulling repository samsaffron/nsenter
FATA[0000] Get Bad Request
Unable to find image ‘samsaffron/nsenter:latest’ locally
Pulling repository samsaffron/nsenter
time=“2015-02-19T16:25:27+08:00” level=“fatal” msg=“Get Bad Request”

How can I do?

Does the server have an uninterrupted connection to the net, or is it passing through an intercepting proxy?

In the meantime, try ./launcher ssh app instead.

I have vim the /etc/default/docker

and can get into rails c

but execute sitsetting.lcoal_logins_enabled = true

it shows

root@discuss-app:~# rails c
[1] pry(main)> SiteSetting.local_logins_enabled = true
NoMethodError: undefined method local_logins_enabled=' for #<Class:0x007f7f5487aa20> from /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.8/lib/active_record/dynamic_matchers.rb:26:inmethod_missing’

How can I do?

Oops, change that to “enable_local_logins”, serves me right for not actually looking up what it’s called.

All done

Seems did not work.

How can I do…

Are there any other options about login will cause this problem?

I am not sure how many box I diselected days ago in the login options in settings.

Here is my site.

When you click login or sign up, no blank to type user name and psw…

Let’s see the output of this. Scrub sensitive data.

puts {|s| "#{}: #{s.value}" } .join "\n"

edit: it would appear you have no login methods enabled, fun fun fun

1 Like

It shows

uncategorized_category_id: 1
lounge_category_id: 2
meta_category_id: 3
staff_category_id: 4
tos_topic_id: 4
guidelines_topic_id: 5
privacy_topic_id: 6
last_vacuum: 1423994069
has_login_hint: f
title: Eye Doctor
site_description: Eye Doctor’s Garden
category_style: box
default_locale: en
limit_suggested_to_category: t
site_contact_username: doudu
embed_by_username: doudu
embed_category: Blog
feed_polling_enabled: t
enable_local_logins: f
=> nil

and run ./launcher rebuild app

Nothing happens.

Have I to rebuild the site?

So, the change didn’t actually take. You should’ve seen something like this:

[7] pry(main)> SiteSetting.enable_local_logins = true
  SiteSetting Load (0.5ms)  SELECT  "site_settings".* FROM "site_settings"  WHERE "site_settings"."name" = 'enable_local_logins' LIMIT 1
   (0.1ms)  BEGIN
  SQL (0.3ms)  INSERT INTO "site_settings" ("created_at", "data_type", "name", "updated_at", "value") VALUES ($1, $2, $3, $4, $5) RETURNING "id"  [["created_at", "2015-02-19 09:41:37.219896"], ["data_type", 5], ["name", "enable_local_logins"], ["updated_at", "2015-02-19 09:41:37.219896"], ["value", "t"]]
   (1.7ms)  COMMIT
=> true
[8] pry(main)>

Try again maybe?

Won’t help, rebuild keeps the database.

1 Like

It works.

Could the team add some notice when somebody do this like me to avoid the same condition.

Many thanks.

Some advice: Could the team add twitter, Facebook, google api login options (use a public or the team maintaince account to verify the login) by default?

So we can just click the box to login with those accounts, avoiding the trouble to create apis step by step.

Unfortunately, that’s a step that’s impossible to remove. Google just removed zero-setup logins in Q3 last year or so.

1 Like

Update to this topic: if anyone finds themselves on this situation, go to /users/admin-login to log in via email.