# Unable to login into discourse suddenly

**URL:** https://meta.discourse.org/t/unable-to-login-into-discourse-suddenly/115708
**Category:** Support
**Created:** [April 23, 2019, 11:45am UTC](https://meta.discourse.org/t/unable-to-login-into-discourse-suddenly/115708 "2019-04-23T11:45:39Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![Shashikant\_Sharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shashikant_sharma/32/138869_2.png) [@Shashikant\_Sharma](https://meta.discourse.org/u/Shashikant_Sharma)
#### Post date: [April 23, 2019, 11:45am UTC](https://meta.discourse.org/t/unable-to-login-into-discourse-suddenly/115708/1 "2019-04-23T11:45:39Z")

</div>

Hi,

We have been using the discourse for 4 months with no issues. Today suddenly none of our team members is able to login into it with or without SSO.

Here is the screenshot of the error we are facing -

 ![25%20PM](https://global.discourse-cdn.com/meta/original/3X/c/a/ca55b183f7cdb4ec6d5a35383e50f377b8958ffe.png)

 ![00%20PM](https://global.discourse-cdn.com/meta/original/3X/1/6/16031e45a867225b2929ba19fc650346fccd1690.png)

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [April 23, 2019, 12:01pm UTC](https://meta.discourse.org/t/unable-to-login-into-discourse-suddenly/115708/2 "2019-04-23T12:01:48Z")

</div>

Do you have any plugins installed? Are you running the latest version of Discourse?

---

<div class="post-metadata">

### Author: ![Shashikant\_Sharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shashikant_sharma/32/138869_2.png) [@Shashikant\_Sharma](https://meta.discourse.org/u/Shashikant_Sharma)
#### Post date: [April 23, 2019, 12:06pm UTC](https://meta.discourse.org/t/unable-to-login-into-discourse-suddenly/115708/3 "2019-04-23T12:06:47Z")

</div>

Hi @david,

We have only one plugin installed i.e `discourse-chat-integration`. And nothing else. It was working until yesterday. I think when I rebuild the docker image it will automatically fetch the latest version of the discourse right?

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [April 23, 2019, 12:54pm UTC](https://meta.discourse.org/t/unable-to-login-into-discourse-suddenly/115708/4 "2019-04-23T12:54:11Z")

</div>

It looks like you might be missing some recent database migrations. I would suggest trying to rebuild from the command line again

```plaintext
cd /var/discourse
./launcher rebuild app

```

and see whether the problem is resolved. If not, please can you share the `info` and `backtrace` information from the logs.

---

<div class="post-metadata">

### Author: ![Shashikant\_Sharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shashikant_sharma/32/138869_2.png) [@Shashikant\_Sharma](https://meta.discourse.org/u/Shashikant_Sharma)
#### Post date: [April 23, 2019, 1:27pm UTC](https://meta.discourse.org/t/unable-to-login-into-discourse-suddenly/115708/5 "2019-04-23T13:27:25Z")

</div>

Hi @david,

It didnt worked. Here is the log file attached.  
[logs.txt](https://global.discourse-cdn.com/meta/original/3X/f/f/ff12e7fb03d5d54e8eba6f402927217199c983d1.txt) (228.7 KB)

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [April 23, 2019, 1:34pm UTC](https://meta.discourse.org/t/unable-to-login-into-discourse-suddenly/115708/7 "2019-04-23T13:34:31Z")

</div>

Ok, it looks like the rebuild is failing during the database migrations. I would expect that to take your site offline, so I’m not sure how it is still running. You are missing all the database migrations since `20190225133654` (there are lots!)

The migration is getting stuck on `PG::DuplicateTable: ERROR: relation "ignored_users" already exists`

Have you seen this before @Tarek_Khalil? I expect it’s not actually related to the ignore users feature, but just want to check if you’ve seen the same error when working on it?

---

<div class="post-metadata">

### Author: ![Tarek\_Khalil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tarek_khalil/32/125517_2.png) [@Tarek\_Khalil](https://meta.discourse.org/u/Tarek_Khalil)
#### Post date: [April 23, 2019, 1:47pm UTC](https://meta.discourse.org/t/unable-to-login-into-discourse-suddenly/115708/8 "2019-04-23T13:47:19Z")

</div>

Interesting! No, I haven’t David unfortunately 🙁

Though, I have seen cases outside of Discourse where this happen (maybe you experienced it before).

The migration started, reached a particular step, executed that step but then some fault caused a halt. At this point, the migration `version number` wouldn’t be written to the DB but the migration step would be executed.

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [April 23, 2019, 1:59pm UTC](https://meta.discourse.org/t/unable-to-login-into-discourse-suddenly/115708/9 "2019-04-23T13:59:58Z")

</div>

> [@Tarek\_Khalil](#):
>
> The migration started, reached a particular step, executed that step but then some fault caused a hault. At this point, the migration `version number` wouldn’t be written to the DB but the migration step would be executed.

That would explain it! So I guess the best solution is to manually drop the `ignored_users` table (after taking a backup). Then the migration should be able to run successfully.

@Shashikant_Sharma are you using a standard installation from our [install guide](https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md)? If so, please try running

```plaintext
cd /var/discourse
./launcher enter app
su -c 'psql discourse' postgres

```

Then run

```plaintext
SELECT version, name, created_at from schema_migration_details ORDER BY created_at DESC LIMIT 10;

```

---

<div class="post-metadata">

### Author: ![Shashikant\_Sharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shashikant_sharma/32/138869_2.png) [@Shashikant\_Sharma](https://meta.discourse.org/u/Shashikant_Sharma)
#### Post date: [April 23, 2019, 2:12pm UTC](https://meta.discourse.org/t/unable-to-login-into-discourse-suddenly/115708/10 "2019-04-23T14:12:43Z")

</div>

@david:

```plaintext
su -c 'psql discourse' postgres

```

point is - Error response from daemon: Container 5e50b5e604a1ccce34cbedd9802a2cab765a1a2ed337acf9077ef52e9fc57336 is not running

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [April 23, 2019, 2:14pm UTC](https://meta.discourse.org/t/unable-to-login-into-discourse-suddenly/115708/11 "2019-04-23T14:14:00Z")

</div>

Try running `./launcher start app` first:

```plaintext
cd /var/discourse
./launcher start app
./launcher enter app
su -c 'psql discourse' postgres

```

---

<div class="post-metadata">

### Author: ![Shashikant\_Sharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shashikant_sharma/32/138869_2.png) [@Shashikant\_Sharma](https://meta.discourse.org/u/Shashikant_Sharma)
#### Post date: [April 23, 2019, 2:18pm UTC](https://meta.discourse.org/t/unable-to-login-into-discourse-suddenly/115708/12 "2019-04-23T14:18:17Z")

</div>

@david;

```plaintext
su -c 'psql discourse' postgres

```

What is the password for this?

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [April 23, 2019, 2:19pm UTC](https://meta.discourse.org/t/unable-to-login-into-discourse-suddenly/115708/13 "2019-04-23T14:19:55Z")

</div>

There shouldn’t be a password, assuming you followed the standard installation guide.

---

<div class="post-metadata">

### Author: ![Shashikant\_Sharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shashikant_sharma/32/138869_2.png) [@Shashikant\_Sharma](https://meta.discourse.org/u/Shashikant_Sharma)
#### Post date: [April 23, 2019, 2:20pm UTC](https://meta.discourse.org/t/unable-to-login-into-discourse-suddenly/115708/14 "2019-04-23T14:20:02Z")

</div>

Hi @david  
Got it.

 ![23%20PM](https://global.discourse-cdn.com/meta/original/3X/e/3/e36f60f50673a95199c49217291eb34b5b998d70.png)

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [April 23, 2019, 2:35pm UTC](https://meta.discourse.org/t/unable-to-login-into-discourse-suddenly/115708/15 "2019-04-23T14:35:31Z")

</div>

I think that confirms what @Tarek_Khalil suspected. The migration has run, but rails hasn’t recorded it in the scheme\_migration\_details table.

Do you have any backups from before 2018-04-22 05:23? Restoring from a backup would probably be the best thing for the integrity of the database.

---

<div class="post-metadata">

### Author: ![Shashikant\_Sharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shashikant_sharma/32/138869_2.png) [@Shashikant\_Sharma](https://meta.discourse.org/u/Shashikant_Sharma)
#### Post date: [April 23, 2019, 5:18pm UTC](https://meta.discourse.org/t/unable-to-login-into-discourse-suddenly/115708/16 "2019-04-23T17:18:01Z")

</div>

@david, @Tarek_Khalil

Kindly let me know steps-how do I resolve this. Our live users are getting affected because of this. We have to find a workaround for this on an immediate basis. I have old backup `.bak` file, Let me know command to restore it.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [July 30, 2022, 3:10am UTC](https://meta.discourse.org/t/unable-to-login-into-discourse-suddenly/115708/18 "2022-07-30T03:10:30Z")

</div>


