# Index missing in the DB

**URL:** <https://help.nextcloud.com/t/index-missing-in-the-db/179230>\
**Category:** ℹ️ Support\
**Tags:** nc28, truenas, setup\_warning\
**Created:** [January 17, 2024, 9:47am UTC](https://help.nextcloud.com/t/index-missing-in-the-db/179230 "2024-01-17T09:47:26Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rayman](https://help.nextcloud.com/letter_avatar/rayman/32/6_22734026db12803ebb3e059622ac3534.png) [@Rayman](https://help.nextcloud.com/u/Rayman)\
**Post date:** [January 17, 2024, 9:47am UTC](https://help.nextcloud.com/t/index-missing-in-the-db/179230/1 "2024-01-17T09:47:26Z")

</div>

Hello everyone  
I just install Nextcloud with Truecharts in my Truenas Scale server.  
I see in the dashboard that I have missing index “fs\_storage\_path\_prefix” for table “filecache”.

I try to execute the command “occ db:add-missing-indices” but does not work, I guess i need to be in the right folder.  
In this topic : [Some indices are missing in the database! How to add them manually - #2 by castillo92](https://help.nextcloud.com/t/some-indices-are-missing-in-the-database-how-to-add-them-manually/37852/2)  
I see the file “cd /var/www/nextcloud”  
But it does not exist. I have var/www/ but only a file html/ and no nextcloud

Is someone using truenas scale can help me ?  
Thank you !

System info :  
Nextcloud version : 28.0.1  
Operating system and version : TrueNAS-SCALE-23.10.1

---

<div class="post-metadata">

**Author:** ![jtr](https://help.nextcloud.com/letter_avatar/jtr/32/6_22734026db12803ebb3e059622ac3534.png) [@jtr](https://help.nextcloud.com/u/jtr)\
**Post date:** [January 17, 2024, 6:20pm UTC](https://help.nextcloud.com/t/index-missing-in-the-db/179230/2 "2024-01-17T18:20:59Z")

</div>

`./occ whatever`

As long as you’re in `/var/www/html`

Or see the official docs for `occ` in TrueCharts[1] for a more thorough guide.

[1] [Nextcloud Migration Guide | TrueCharts](https://truecharts.org/charts/stable/nextcloud/migration-guide#nextcloud-occ-commands)

---

<div class="post-metadata">

**Author:** ![Mornsgrans](https://help.nextcloud.com/user_avatar/help.nextcloud.com/mornsgrans/32/40386_2.png) [@Mornsgrans](https://help.nextcloud.com/u/Mornsgrans)\
**Post date:** [January 17, 2024, 7:28pm UTC](https://help.nextcloud.com/t/index-missing-in-the-db/179230/3 "2024-01-17T19:28:02Z")

</div>

In the latest Nextcloud versions occ is not an executable anymore.

`sudo php /path/to/nextcloud/occ db:add-missing-indices`  
Depending on your installation Nextcloud has been installed in a docker container or a different folder f.e. /var/www/html

If you get a result after “sudo docker ps” with “Nextcloud” in the output lines, Nextcloud is in a docker container.

If in a docker container, use  
`sudo docker exec -u www-data php /var/www/html/occ db:add-missing-indices`  
(the path may be different)

---

<div class="post-metadata">

**Author:** ![jtr](https://help.nextcloud.com/letter_avatar/jtr/32/6_22734026db12803ebb3e059622ac3534.png) [@jtr](https://help.nextcloud.com/u/jtr)\
**Post date:** [January 17, 2024, 8:47pm UTC](https://help.nextcloud.com/t/index-missing-in-the-db/179230/4 "2024-01-17T20:47:49Z")

</div>

> [@Mornsgrans](#):
>
> In the latest Nextcloud versions occ is not an executable anymore.

Which Nextcloud versions would that be? Some of the third-party Docker images maybe?

```auto
xxx@node2:~/src/infrastructure/test/test-nc28$ docker compose exec -u33 app /var/www/html/occ status
  - installed: true
  - version: 28.0.1.1
  - versionstring: 28.0.1
  - edition: 
  - maintenance: false
  - needsDbUpgrade: false
  - productname: Nextcloud
  - extendedSupport: false
xxx@node2:~/src/infrastructure/test/test-nc28$ docker compose exec -u33 app ./occ status
  - installed: true
  - version: 28.0.1.1
  - versionstring: 28.0.1
  - edition: 
  - maintenance: false
  - needsDbUpgrade: false
  - productname: Nextcloud
  - extendedSupport: false
xxx@node2:~/src/infrastructure/test/test-nc28$ 

```

---

<div class="post-metadata">

**Author:** ![Mornsgrans](https://help.nextcloud.com/user_avatar/help.nextcloud.com/mornsgrans/32/40386_2.png) [@Mornsgrans](https://help.nextcloud.com/u/Mornsgrans)\
**Post date:** [January 17, 2024, 9:07pm UTC](https://help.nextcloud.com/t/index-missing-in-the-db/179230/5 "2024-01-17T21:07:00Z")

</div>

> [@jtr](#):
>
> Which Nextcloud versions would that be?

Starting with Nextcloud 25, if I am right.

But more imporant:  
As result of posting your instruction occ is in folder

```auto
/var/www/html/occ

```

(see docker compose instruction)

So the command  
`docker exec -u www-data php /var/www/html/occ db:add-missing-indices`  
should work

---

<div class="post-metadata">

**Author:** ![Rayman](https://help.nextcloud.com/letter_avatar/rayman/32/6_22734026db12803ebb3e059622ac3534.png) [@Rayman](https://help.nextcloud.com/u/Rayman)\
**Post date:** [January 18, 2024, 7:31am UTC](https://help.nextcloud.com/t/index-missing-in-the-db/179230/6 "2024-01-18T07:31:23Z")

</div>

> [@Mornsgrans](#):
>
> If you get a result after “sudo docker ps” with “Nextcloud” in the output lines, Nextcloud is in a docker container.

the command docker does not exist.  
Also /var/www/html/occ doens not exist  
 ![Screenshot 2024-01-18 083036](https://help.nextcloud.com/uploads/default/original/3X/2/f/2f2f27285c7e3dbe5b775f17f651eec65651dd4d.png)

should i mount the pvc and try to execute the occ in it ?

Thank you for your replies

---

<div class="post-metadata">

**Author:** ![Mornsgrans](https://help.nextcloud.com/user_avatar/help.nextcloud.com/mornsgrans/32/40386_2.png) [@Mornsgrans](https://help.nextcloud.com/u/Mornsgrans)\
**Post date:** [January 18, 2024, 4:07pm UTC](https://help.nextcloud.com/t/index-missing-in-the-db/179230/7 "2024-01-18T16:07:27Z")

</div>

Did you look on the linked [Truecharts-page](https://truecharts.org/charts/stable/nextcloud/migration-guide#nextcloud-occ-commands), as jtr posted it in posting #2?

Because I do not know the Nextcloud package for NAS, I cannot help you more.

---

<div class="post-metadata">

**Author:** ![Rayman](https://help.nextcloud.com/letter_avatar/rayman/32/6_22734026db12803ebb3e059622ac3534.png) [@Rayman](https://help.nextcloud.com/u/Rayman)\
**Post date:** [January 19, 2024, 12:24pm UTC](https://help.nextcloud.com/t/index-missing-in-the-db/179230/8 "2024-01-19T12:24:26Z")

</div>

Ho yes i see. I should use the shell in the pod.  
It works thx.  
I thought this would speed up nextcloud but this is not the case. I will investigate more (but this is an other problem for this topic).  
I think about my speed connection.

Thx a lot !

---

<div class="post-metadata">

**Author:** ![system](https://help.nextcloud.com/user_avatar/help.nextcloud.com/system/32/29333_2.png) [@system](https://help.nextcloud.com/u/system)\
**Post date:** [January 27, 2024, 12:24pm UTC](https://help.nextcloud.com/t/index-missing-in-the-db/179230/9 "2024-01-27T12:24:33Z")

</div>

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.
