# Troubleshooting Nextcloud

# trusted domain - Troubleshooting Nextcloud

#### Troubleshooting

\- trusted domain  
\- go to: nextcloud/config and edit the config.php  
\- find: "trusted\_domains" and add the domain you want to trust

```
'trusted_domains' =>
  array (
    0 => 'box.danicus.net',
    1 => '192.168.1.1',    (put in yourown ip address)
```

\- \*\*Note:\*\* it's the domain you GO TO to access NextCloud...not where you're trying to access FROM.

#### Mobel app

Error message   
 "no HTTP connection allowed"  
Go to nextcloud config file, config.php and add   
`'overwriteprotocol' =&gt; 'https', `

---

# Upload failed request entity too large - Troubleshooting Nextcloud

"**Upload failed** request entity too large"

If you have a proxy, go into the config file and change the "client\_max\_body\_size" line. If that line isn't there, add it under the http section.

```bash
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
        worker_connections 768;
        # multi_accept on;
}

http {

        ##
        # Basic Settings
        ##

        client_max_body_size 1000M; #(right here)

        sendfile on;
        tcp_nopush on;
        types_hash_max_size 2048;
        # server_tokens off;

        # server_names_hash_bucket_size 64;
        # server_name_in_redirect off;

        include /etc/nginx/mime.types;
        default_type application/octet-stream;

```

I didn't have a line at all so I just put it in there.

# Docker Container keeps restarting - Troubleshooting Nextcloud

This case, it was already working. Ended up pulling a new image but didnt know it.

First, check docker logs. Run the container and let it keep restarting so that it will give you an error log.

```bash
docker logs <nextcloud_container_name>
```

Error said:  
Initializing nextcloud 31.0.1.2 ...  
Can't start Nextcloud because upgrading from 29.0.0.19 to 31.0.1.2 is not supported.  
It is only possible to upgrade one major version at a time. For example, if you want to upgrade from version 14 to 16, you will have to upgrade from version 14 to 15, then from 15 to 16.

That means files/data is for version 29 and i need to incrementally go up to V31.

Lets get the versions in between to install it correctly.

If the containers are running. stock them.

```bash
docker-compose down
```

#### Check Your Current Data

Your Nextcloud data (files and database) is tied to version 29.0.0.19. Ensure your volumes (<span class="text-sm px-1 rounded-sm !font-mono bg-sunset/10 text-rust dark:bg-dawn/10 dark:text-dawn">./nextcloud</span> and <span class="text-sm px-1 rounded-sm !font-mono bg-sunset/10 text-rust dark:bg-dawn/10 dark:text-dawn">./mariadb</span>) are intact, as they contain your files and database. If you have backups, now’s a good time to confirm they’re ready—just in case.

#### Upgrade Step-by-Step

You’ll need to run intermediate versions of Nextcloud to perform the upgrades. Modify your <span class="text-sm px-1 rounded-sm !font-mono bg-sunset/10 text-rust dark:bg-dawn/10 dark:text-dawn">docker-compose.yml</span> to pull specific versions, starting with the next major version after 29.

#### Upgrade Step-by-Step

- You’ll need to run intermediate versions of Nextcloud to perform the upgrades. Modify your <span class="text-sm px-1 rounded-sm !font-mono bg-sunset/10 text-rust dark:bg-dawn/10 dark:text-dawn">docker-compose.yml</span> to pull specific versions, starting with the next major version after 29.

```yaml
services:
  nextcloud:
    image: nextcloud:30
    # ... rest of your config ...
  mariadb:
    # ... no change needed here ...
```

- Start the containers:

```bash
docker-compose up -d
```

- Check the logs to confirm it’s running:

```bash
docker-compose logs -f
```

- Nextcloud should automatically run the upgrade process for version 30. Wait until it stabilizes (logs should stop showing errors and indicate a successful start).

#### Upgrade to 31.0.x

- Once version 30 is running fine, stop the containers:

```bash
docker-compose down
```

<div id="bkmrk-update-docker-compos">- Update <span class="text-sm px-1 rounded-sm !font-mono bg-sunset/10 text-rust dark:bg-dawn/10 dark:text-dawn">docker-compose.yml</span> to the desired version (31.0.1.2 or latest 31):

</div>```yaml
services:
  nextcloud:
    image: nextcloud:31
    # ... rest of your config ...
```

<div id="bkmrk-restart%3A">- Restart:

</div>```
docker-compose up -d
```

- Check logs again:

```
docker-compose logs -f
```

 The upgrade from 30 to 31 should proceed. Once complete, your Nextcloud should be fully operational on 31.0.1.2.

<div id="bkmrk-"></div>

# Error message : Update needed

Error message; (when loading nextcloud frontend)

<table border="1" id="bkmrk-update-neededplease-" style="border-collapse: collapse; width: 78.4524%; height: 39px;"><colgroup><col style="width: 100%;"></col></colgroup><tbody><tr><td>Update needed  
Please use the command line updater because updating via browser is disabled in your config.php.</td></tr></tbody></table>

After updating Nextcloud to new version, it gave me that error message.

Basically, you need to update the database to work with the new version. Here is how to do that.

#### . Access the Nextcloud Container

<div id="bkmrk-find-your-nextcloud-">- Find your Nextcloud container name or ID: 
    - Find your container name "docker ps"

</div>Look for the container running <span class="text-sm px-1 rounded-sm !font-mono bg-sunset/10 text-rust dark:bg-dawn/10 dark:text-dawn">nextcloud:30 (or whichever version).</span>

<div id="bkmrk-access-the-container">- Access the container’s shell:  
    ```
    docker exec -it <nextcloud_container_name> bash
    ```

</div>#### Run the Updater

<div id="bkmrk-inside-the-container">- Inside the container, switch to the <span class="text-sm px-1 rounded-sm !font-mono bg-sunset/10 text-rust dark:bg-dawn/10 dark:text-dawn">www-data</span> user (Nextcloud’s default user): (this may not work. you may not need it anyway).  
    ```
    su - www-data
    ```
- <div>Navigate to the Nextcloud directory (usually <span class="text-sm px-1 rounded-sm !font-mono bg-sunset/10 text-rust dark:bg-dawn/10 dark:text-dawn">/var/www/html</span>): (you might be there already)  
    </div>```
    cd /var/www/html
    ```
- Run the occ command to perform the update:  
    ```
    php occ upgrade
    ```

</div>If that worked, great! your dont with the update.

The first time I did this, it did not work.   
 You may need to take it off of maintenance mode in order to try it again.

#### Removing maintenance mode:

Inside the docker container, in the /var/www/html directory

```
php occ maintenance:mode --off
```

##### now try the update again.