# User.find\_by(id: 123) يفشل: لا يوجد تسجيل دخول، ولا إدارة

**URL:** <https://meta.discourse.org/t/user-find-by-id-123-fails-no-login-no-adminstration/117176>\
**Category:** Self-hosting\
**Created:** [8 مايو 2019، 2:01م UTC](https://meta.discourse.org/t/user-find-by-id-123-fails-no-login-no-adminstration/117176 "2019-05-08T14:01:32Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)\
**Post date:** [8 مايو 2019، 2:13م UTC](https://meta.discourse.org/t/user-find-by-id-123-fails-no-login-no-adminstration/117176/2 "2019-05-08T14:13:08Z")

</div>

This makes me think that your postgres indices are corrupt.

I would recommend first following the steps listed on [Corruption - PostgreSQL wiki](https://wiki.postgresql.org/wiki/Corruption) to preserve your data.

After you’ve made a copy if you run the postgres CLI and try that same underlying query you should results like:

```plaintext
discourse_development=# SELECT "users"."id", "users"."username" FROM "users" WHERE "users"."id" = 2 LIMIT 1;
 id | username 
----+-------------
  2 | juanettedoe
(1 row)

discourse_development=# SELECT "users"."id", "users"."username" FROM "users" WHERE "users"."username_lower" = 'juanettedoe' LIMIT 1;
 id | username 
----+-------------
  2 | juanettedoe
(1 row)

```

---

_[View the full topic](https://meta.discourse.org/t/user-find-by-id-123-fails-no-login-no-adminstration/117176)._
