[Support] Linuxserver.io - Nextcloud


Recommended Posts

I had a server crash and now my NC seems to not get connected to database. 

","app":"remote","method":"GET","url":"/status.php","message":{"Exception":"Doctrine\\DBAL\\DBALException","Message":"Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [2002] Host is unreachable","Code":0,

 

Anyone knows how to fix this? The config and data volumes look to be fine. I have no idea why can't it reach the mariadb...

Link to comment
14 hours ago, KrisMin said:

I had a server crash and now my NC seems to not get connected to database. 


","app":"remote","method":"GET","url":"/status.php","message":{"Exception":"Doctrine\\DBAL\\DBALException","Message":"Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [2002] Host is unreachable","Code":0,

 

Anyone knows how to fix this? The config and data volumes look to be fine. I have no idea why can't it reach the mariadb...

OK, that was an issue with subnet availability.  For some reason the NC could not connect to the database when pointed the database IP and port to it. When I joined the same bridge as the mariadb, the issue disappeared. 

As far as i know this should not be happening, but it somehow did.

Link to comment

How do I reset my admin/user password via the terminal?

 

I had v16 and couldn't access it via the webUI cause of the PHP issue. I was able to update it to v17.0.0.1 and would like to continue to update it via the webUI. But now, when I try to login, it says my username/password is incorrect (even though I know it's right since I used it not too long ago). Thanks!

Link to comment
On 2/5/2021 at 2:36 PM, Danuel said:

Stop nextcloud and letsencrypt

go and edit nextcloud.subdomain.conf

and under line 

include /config/nginx/ssl.conf;

add this line 

add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;";

Thank you Sr! i rebooted the swag container to make it work. Just out of curiosity, what does this setting do? because if you go to a website https://hstspreload.org/ to check it, it says that is not possible because is a subdomain and all that stuff. 

Edited by gacpac
Link to comment
49 minutes ago, gacpac said:

Thank you Sr! i rebooted the swag container to make it work. Just out of curiosity, what does this setting do? because if you go to a website https://hstspreload.org/ to check it, it says that is not possible because is a subdomain and all that stuff. 

that setting was regarding HSTS (HTTP) which is a web security policy, if you search on google HSTS you will find more information.

 

  • Thanks 1
Link to comment

Hello All,

 

So I have the same issue with 7.4 not compatible with 7.3, but i'm running a pretty old version of NC. It's run like a champ without any interference from me, so i've generally left it alone and updated the build as available.... but i digress. Please see below steps i've taken and if there is any hope to salvage my NextCloud.  i'm not well versed on linux containers/commands, but i am trying to read and follow others examples. 

 

 

root@fea7f36c9a57:/# updater.phar
Nextcloud Updater - version: v15.0.7-4-ged74b90

Current version is 15.0.12.

Update to Nextcloud 15.0.12 available. (channel: "stable")
Following file will be downloaded automatically: https://download.nextcloud.com/server/releases/nextcloud-15.0.12.zip

Steps that will be executed:
[✔] Check for expected files
[✔] Check for write permissions
[✔] Create backup
[✔] Downloading
[✔] Verify integrity
[✔] Extracting
[✔] Enable maintenance mode
[✔] Replace entry points
[✔] Delete old files
[✔] Move new files in place
[✔] Done

Continue update? [y/N] y

Info: Pressing Ctrl-C will finish the currently running step and then stops the updater.

[✔] Check for expected files
[✔] Check for write permissions
[✔] Create backup
[✔] Downloading
[✔] Verify integrity
[✔] Extracting
[✔] Enable maintenance mode
[✔] Replace entry points
[✔] Delete old files
[✔] Move new files in place
[✔] Done

Update of code successful.

Should the "occ upgrade" command be executed? [Y/n] y
This version of Nextcloud is not compatible with > PHP 7.3.<br/>You are currently running 7.4.15.
Keep maintenance mode active? [y/N] y
Maintenance mode kept active
root@fea7f36c9a57:/# 

 

 

 

 

Link to comment
On 2/3/2021 at 9:17 PM, Coy said:

Im having issues with a nextcloud update that I just did. It tells me "This version of Nextcloud is not compatible with > PHP 7.3. You are currently running 7.4.14." Im really not sure what to do. Can anyone help me?

 

 

EDIT: I finally figured out how to change versions. I tried 20.0.7,20.0.6,20.0.5. I landed on 20.0.4 and im working again.

 

I had the same problem.

 

If anyone else needs a fix for now, edit the docker container and change the repository to linuxserver/nextcloud:20.0.2-ls107, this has got my Nextcloud working again.

Link to comment

Hi All, 

 

I'm trying to get my nextcloud container setup for use with reverse proxy + duck dns. I've followed SpaceInvaderOne's video tutorial but I'm running into a curious issue where the reverse proxy doesn't seem to be able to access the container correctly; it simply pulls up swag's default 'Welcome to our server' message. I have Sonarr and Radarr setup via a similar means and those are working correctly without issue. I'm not sure if I have a misconfiguration in my config.php file or what the issue might be. Not seeing anything in the logs for either nextcloud or swag. Hoping someone has run into something similar and can point me in the right direction. 

 

Thanks

 

unknown.png.5ac3df692c2b1a592a964f377d660250.png

 

1885964519_Screenshot2021-02-08211743.png.b20c9a9eacea379a26ec8f0f6e98ec99.png

 

 

Link to comment

Looks like your overwrite.cli.url might be wrong. 

 

<?php
$CONFIG = array (
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'datadirectory' => '/data',
  'instanceid' => 'something',
  'passwordsalt' => 'klsjsadhflkasjdhflakshf',
  'secret' => 'lkashdjflaskjhdflakshdflka',
  'trusted_domains' => 
  array (
    0 => '192.168.1.151:444',
    1 => 'something.something.duckdns.org',
  ),
  'dbtype' => 'mysql',
  'version' => '20.0.7.1',
  'overwrite.cli.url' => 'https://something.something.duckdns.org:443',
  'dbname' => 'nextcloud',
  'dbhost' => '192.168.1.151:3306',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'oc_admin',
  'dbpassword' => 'klasdhgflkashflashf',
  'installed' => true,
  'theme' => '',
  'loglevel' => 2,
  'maintenance' => false,
  'twofactor_enforced' => 'false',
  'twofactor_enforced_groups' => 
  array (
  ),
  'twofactor_enforced_excluded_groups' => 
  array (
  ),
  'mail_from_address' => 'myuser',
  'mail_smtpmode' => 'smtp',
  'mail_smtphost' => 'mail.server.ca',
  'mail_smtpport' => '25',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'server.ca',
  'preview_max_x' => '2048',
  'preview_max_y' => '2048',
  'jpeg_quality' => '60',
  'updater.release.channel' => 'stable',
  'has_rebuilt_cache' => true,
  'app_install_overwrite' => 
  array (
    0 => 'passman',
  ),
);

 

Subdomain conf:

server {
    listen 443 ssl;
    listen [::]:443 ssl;

    #HTTP Strict Transport Security for NextCloud
    add_header Strict-Transport-Security "max-age=15552000; includeSubDomains" always;
    server_name cloud.*;

    include /config/nginx/ssl.conf;

    client_max_body_size 0;

    location / {
        include /config/nginx/proxy.conf;
        resolver 127.0.0.11 valid=30s;
        set $upstream_nextcloud 192.168.1.151;
        proxy_max_temp_file_size 2048m;
        proxy_pass https://$upstream_nextcloud:444;
    }
}

 

Note I use the static ip of my server not the internal docker names or IPs, I find those rarely work. 

 

Then you make sure that in your nginx.conf the following line...

include /config/nginx/site-confs/*;

...is not commented.

Edited by exist2resist
HTTP STS
Link to comment
11 hours ago, exist2resist said:

Actually there is a file you need to purge as per their github.

image.png.1a40d88c02df825e5d4cb64cad00bbb0.png

 

 

Not after every update. There is a date on top of the file so you can check it yours is up to date or not. We might also have added a check that outputs any outdated files in the log. Not sure if we added it to nextcloud or its only in swag.

  • Thanks 1
Link to comment

I believe that my upgrade broke something with the Photo viewer and I am getting error 404 for previews. 

The photo tab intermittently displays the photos. I tried all kinds of occ commands. 

 

What table do I look in to find fileID and corresponding file loaction?

Also can someone shine some light on how to clear the file cache and the file cache table, is this recommended?

Screenshot 2021-02-10 191146.png

Edited by exist2resist
Add pic
Link to comment
17 hours ago, exist2resist said:

I believe that my upgrade broke something with the Photo viewer and I am getting error 404 for previews. 

The photo tab intermittently displays the photos. I tried all kinds of occ commands. 

 

What table do I look in to find fileID and corresponding file loaction?

Also can someone shine some light on how to clear the file cache and the file cache table, is this recommended?

Screenshot 2021-02-10 191146.png

Try first to do this

Right click on the docker and select console

 

"occ preview:repair"

"occ preview:delete_old"

"occ preview:generate-all"

 

This might fix it
 

  • Thanks 1
Link to comment
5 hours ago, skois said:

Try first to do this

Right click on the docker and select console

 

"occ preview:repair"

"occ preview:delete_old"

"occ preview:generate-all"

 

This might fix it
 

It was the preview folder and database file locations that didn't add up. 

I purged the appdata_xxxxxxxxx/preview folder, ran file scan and regenerated the previews from scratch.

Ran a bunch of occ repairs on the file system, database stuff, etc. 

 

Realistically I just need to migrate to a new and clean instance. 

All these upgrades from version 15 left too much stuff behind. 

 

 

Edited by exist2resist
Link to comment

[SOLVED]

 

Hey all,

 

I'm still trying to setup swag and nextcloud, to my liking. I know nextcloud has some burteforce protection (25 second timeout) on login attempts, but i want ban those ips. So, use fail2ban, since it already in swag. I found a some information about it, and basically you want to pass the nginx log on nextcloud to fail2ban in the swag container. In fail2ban you would configure a filter for that logfile on which it triggers. (see linked post) 

The problem is what gets written in the access log of nextcloud "\nextcloud\log\nginx\access.log". If i make a couple of wrong login attempts from an outside ip, I kind of expected something like "login failed" but it doenst mention anything like that. The nexcloud documentation, also shows a filter looking at "login. failed" https://docs.nextcloud.com/server/19/admin_manual/installation/harden_server.html?highlight=fail2ban

 

Thanks,

 

Edit: wrong log file, I needed nextcloud.log located in host pasth 2 I set in the config.

Thank you, Glasti

Edited by ZekerPixels
Link to comment

Hi suddenly could not longer access my nextcloud. both remote and local is unavailable

 

When entering the server there was loads and loads of error messages regarding the cache disk. It is an intel SSD and for some reason it had plenty of read errors.

This might cause the entire nextcloud to go down, I do not know. 

 

I will see if changing the ssd can fix the issue, but I guess that there is more to it than that.

 

The error message i get is:

 

Internal Server Error

The server was unable to complete your request.

If this happens again, please send the technical details below to the server administrator.

More details can be found in the server log.

 

Technical details

Remote Address: 192.168.0.92

Request ID: gAiXEogaBirsFLW0AM59

 

Not sure why it is referring to 92 when I am using 100. I have checked the server and the router and it is both confirming that the server is at 100. I also use 100 when logging into the server so where the 92 is comming from is unknown for me

Link to comment
On 2/4/2021 at 8:17 AM, Coy said:

Im having issues with a nextcloud update that I just did. It tells me "This version of Nextcloud is not compatible with > PHP 7.3. You are currently running 7.4.14." Im really not sure what to do. Can anyone help me?

 

 

EDIT: I finally figured out how to change versions. I tried 20.0.7,20.0.6,20.0.5. I landed on 20.0.4 and im working again.

I got the same error, how do you change the version?

Link to comment

which version of onlyoffice I should use to connect with this nextcloud docker. I am on the latest NC 20.0.7 (fresh install) using reverse proxy, using my own subdoamin and able to access from Local and external network.

 

I see that official onlyoffice docker is no longer in the app store, that is why I am checking here.

 

TIA!

Edited by GGabs
Link to comment

I am still getting the X-Frame-Options error in my Nextcloud Overview:

 

https://i.imgur.com/1dowoxG.png

 

I have tried all the fixes I've found online, including the ones in this thread, and none have worked

 

Here is my \appdata\swag\nginx\ssl.conf file:

 

## Version 2020/10/29 - Changelog: https://github.com/linuxserver/docker-swag/commits/master/root/defaults/ssl.conf

### Mozilla Recommendations
# generated 2020-06-17, Mozilla Guideline v5.4, nginx 1.18.0-r0, OpenSSL 1.1.1g-r0, intermediate configuration
# https://ssl-config.mozilla.org/#server=nginx&version=1.18.0-r0&config=intermediate&openssl=1.1.1g-r0&guideline=5.4

ssl_session_timeout 1d;
ssl_session_cache shared:MozSSL:10m;  # about 40000 sessions
ssl_session_tickets off;

# intermediate configuration
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers [removed];
ssl_prefer_server_ciphers off;

# OCSP stapling
ssl_stapling on;
ssl_stapling_verify on;


### Linuxserver.io Defaults

# Certificates
ssl_certificate /config/keys/letsencrypt/fullchain.pem;
ssl_certificate_key /config/keys/letsencrypt/privkey.pem;
# verify chain of trust of OCSP response using Root CA and Intermediate certs
ssl_trusted_certificate /config/keys/letsencrypt/fullchain.pem;

# Diffie-Hellman Parameters
ssl_dhparam /config/nginx/dhparams.pem;

# Resolver
resolver 127.0.0.11 valid=30s; # Docker DNS Server

# Enable TLS 1.3 early data
ssl_early_data on;

# HSTS, remove # from the line below to enable HSTS
#add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;

# Optional additional headers
#add_header Cache-Control "no-transform" always;
#add_header Content-Security-Policy "upgrade-insecure-requests; frame-ancestors 'self'";
#add_header Referrer-Policy "same-origin" always;
#add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "SAMEORIGIN" always;
#add_header X-UA-Compatible "IE=Edge" always;
#add_header X-XSS-Protection "1; mode=block" always;

 

and here is my nextcloud.subdomain.conf file:

 

## Version 2020/12/09
# make sure that your dns has a cname set for nextcloud
# assuming this container is called "swag", edit your nextcloud container's config
# located at /config/www/nextcloud/config/config.php and add the following lines before the ");":
#  'trusted_proxies' => ['swag'],
#  'overwrite.cli.url' => 'https://nextcloud.your-domain.com/',
#  'overwritehost' => 'nextcloud.your-domain.com',
#  'overwriteprotocol' => 'https',
#
# Also don't forget to add your domain name to the trusted domains array. It should look somewhat like this:
#  array (
#    0 => '192.168.0.1:444', # This line may look different on your setup, don't modify it.
#    1 => 'nextcloud.your-domain.com',
#  ),

server {
    listen 443 ssl;
    listen [::]:443 ssl;

    server_name nextcloud.*;
	
	add_header X-Frame-Options "SAMEORIGIN" always;

    include /config/nginx/ssl.conf;

    client_max_body_size 0;


    location / {
        include /config/nginx/proxy.conf;
        resolver 127.0.0.11 valid=30s;
        set $upstream_app nextcloud;
        set $upstream_port 443;
        set $upstream_proto https;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;

        proxy_max_temp_file_size 2048m;
    }
}

 

Edited by Stubbs
Link to comment
On 2/13/2021 at 6:31 AM, mrvilla said:

Hi suddenly could not longer access my nextcloud. both remote and local is unavailable

 

When entering the server there was loads and loads of error messages regarding the cache disk. It is an intel SSD and for some reason it had plenty of read errors.

This might cause the entire nextcloud to go down, I do not know. 

 

I will see if changing the ssd can fix the issue, but I guess that there is more to it than that.

 

The error message i get is:

 

Internal Server Error

The server was unable to complete your request.

If this happens again, please send the technical details below to the server administrator.

More details can be found in the server log.

 

Technical details

Remote Address: 192.168.0.92

Request ID: gAiXEogaBirsFLW0AM59

 

Not sure why it is referring to 92 when I am using 100. I have checked the server and the router and it is both confirming that the server is at 100. I also use 100 when logging into the server so where the 92 is comming from is unknown for me

What is at 92 on your network? It sounds like something is requesting from that address - I'd say look at see if anything is mapped to that IP. Also I think you are right about the SSD, swap it out and see if that makes any improvement.

Edited by Rick_Sanchez
Link to comment
17 hours ago, GGabs said:

which version of onlyoffice I should use to connect with this nextcloud docker. I am on the latest NC 20.0.7 (fresh install) using reverse proxy, using my own subdoamin and able to access from Local and external network.

 

I see that official onlyoffice docker is no longer in the app store, that is why I am checking here.

 

TIA!

Anyone?

Link to comment

@skois@whitedwarf

 

Update on the situation.

I ended up buying Ubiquiti's UniFi USG, setting our Huawei modem to work in Bridge mode, so that the USG is the main router, and after the basic setup, everything just worked.

 

NAT Loopback finally works, I can access my server through the domain name within the same network, and with that, OpenOffice connected with NextCloud without any issues at all.

 

I can finally breath!

  • Like 2
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.