# כיצד ניתן להריץ שאילתות SQL אם הקונטיינר לא מתחיל? (בנייה מחדש נכשלה)

**URL:** <https://meta.discourse.org/t/how-does-one-run-sql-queries-if-the-container-doesnt-start-rebuild-failed/252126>\
**Category:** Self-hosting\
**Created:** [18 בינואר,‏ 2023,‏ 8:16am UTC](https://meta.discourse.org/t/how-does-one-run-sql-queries-if-the-container-doesnt-start-rebuild-failed/252126 "2023-01-18T08:16:14Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![iamntz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iamntz/32/114670_2.png) [@iamntz](https://meta.discourse.org/u/iamntz)\
**Post date:** [18 בינואר,‏ 2023,‏ 8:16am UTC](https://meta.discourse.org/t/how-does-one-run-sql-queries-if-the-container-doesnt-start-rebuild-failed/252126/1 "2023-01-18T08:16:14Z")

</div>

Hello.

I tried to run updates & rebuild, but I ended up with this beautiful error:

```plaintext
I, [2023-01-18T08:05:48.701709 #1] INFO -- : > cd /var/www/discourse && su discourse -c 'LOAD_PLUGINS=0 bundle exec rake plugin:pull_compatible_all'
I, [2023-01-18T08:05:52.431210 #1] INFO -- :
I, [2023-01-18T08:05:52.431807 #1] INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
2023-01-18 08:05:59.081 UTC [1166] discourse@discourse ERROR: could not create unique index "index_tags_on_name_ccnew_ccnew_ccnew5"
2023-01-18 08:05:59.081 UTC [1166] discourse@discourse DETAIL: Key (name)=(vuejs) is duplicated.
2023-01-18 08:05:59.081 UTC [1166] discourse@discourse STATEMENT: REINDEX INDEX CONCURRENTLY index_tags_on_name_ccnew_ccnew
rake aborted!
StandardError: An error has occurred, all later migrations canceled:

PG::UniqueViolation: ERROR: could not create unique index "index_tags_on_name_ccnew_ccnew_ccnew5"
DETAIL: Key (name)=(vuejs) is duplicated.
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/rack-mini-profiler-3.0.0/lib/patches/db/pg.rb:110:in `exec'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/rack-mini-profiler-3.0.0/lib/patches/db/pg.rb:110:in `async_exec'

```

There are other topics on the forum with similar issues ([1](https://meta.discourse.org/t/cant-restore-due-to-corrupt-indexes-with-some-clues-on-how-to-deal-with-corrupt-indexes/137400/14), [2](https://meta.discourse.org/t/unable-to-restore-backup-data-unique-index-is-duplicated/147588), [3](https://meta.discourse.org/t/update-failed-due-to-primary-key-sequence-error/67852)) but when I try to enter the container I get this:

```plaintext
/var/discourse# ./launcher enter app
x86_64 arch detected.
Error: No such container: app

```

Therefore I’m unable to drop indices manually.

Any other suggestion on what aproach should I take next?

---

_[View the full topic](https://meta.discourse.org/t/how-does-one-run-sql-queries-if-the-container-doesnt-start-rebuild-failed/252126)._
