crazy-max / docker-nextcloud

Nextcloud Docker image
MIT License
244 stars 47 forks source link

"Internal Server Error" after updating to the latest docker image #69

Closed georgikoemdzhiev closed 3 years ago

georgikoemdzhiev commented 3 years ago

Behaviour

Hello! First of all thank you for the awesome docker image! It has made using NextCloud a breeze! :)

Steps to reproduce this issue

  1. docker stop image_id
  2. docker rm image_id
  3. docker pull crazymax/nextcloud:latest
  4. docker run --restart=always -d -p 8000:8000 --name nextcloud -v /home/pi/NextCloud/SSD:/data -e DB_PASSWORD=mypass crazymax/nextcloud:latest

Expected behaviour

I am able to access the nextcloud local address (e.g. 192.168.1.207:8000)

Actual behaviour

I am presented with "Internal Server Error" page.

Configuration

Docker info

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Build with BuildKit (Docker Inc., v0.5.1-docker)

Server:
 Containers: 2
  Running: 2
  Paused: 0
  Stopped: 0
 Images: 3
 Server Version: 20.10.2
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 269548fa27e0089a8b8278fc4fc781d7f65a939b
 runc version: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 5.4.83-v7l+
 Operating System: Raspbian GNU/Linux 10 (buster)
 OSType: linux
 Architecture: armv7l
 CPUs: 4
 Total Memory: 3.738GiB
 Name: tinypiserver
 ID: 3Y76:C54N:UPPO:UXIP:Y2AD:SWGO:5UUE:2WLG:VJSL:QSUM:OUYD:EVNA
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
127.0.0.0/8
 Live Restore Enabled: false

WARNING: No memory limit support
WARNING: No swap limit support
WARNING: No kernel memory TCP limit support
WARNING: No oom kill disable support
WARNING: No blkio weight support
WARNING: No blkio weight_device support

Logs

I inspected the contents of the data/nextcloud.log file. I noticed that every time I navigate to the main page (e.g. 192.168.1.207:8000) I get this exception generated in the file:

{
    "reqId": "stxNvRdKjae9FCHhRe4k",
    "level": 3,
    "time": "2071-05-18 05:33:44",
    "remoteAddr": "192.168.1.117",
    "user": "georgi@gmail.com",
    "app": "index",
    "method": "GET",
    "url": "/apps/dashboard/",
    "message": {
        "Exception": "TypeError",
        "Message": "Return value of OC\\Security\\Bruteforce\\Throttler::getCutoffTimestamp() must be of the type int, bool returned",
        "Code": 0,
        "Trace": [
            {
                "file": "/var/www/lib/private/Security/Bruteforce/Throttler.php",
                "line": 243,
                "function": "getCutoffTimestamp",
                "class": "OC\\Security\\Bruteforce\\Throttler",
                "type": "->"
            },
            {
                "file": "/var/www/lib/private/Security/Bruteforce/Throttler.php",
                "line": 270,
                "function": "getAttempts",
                "class": "OC\\Security\\Bruteforce\\Throttler",
                "type": "->"
            },
            {
                "file": "/var/www/lib/private/Security/Bruteforce/Capabilities.php",
                "line": 56,
                "function": "getDelay",
                "class": "OC\\Security\\Bruteforce\\Throttler",
                "type": "->"
            },
            {
                "file": "/var/www/lib/private/CapabilitiesManager.php",
                "line": 72,
                "function": "getCapabilities",
                "class": "OC\\Security\\Bruteforce\\Capabilities",
                "type": "->"
            },
            {
                "file": "/var/www/lib/private/Template/JSConfigHelper.php",
                "line": 183,
                "function": "getCapabilities",
                "class": "OC\\CapabilitiesManager",
                "type": "->"
            },
            {
                "file": "/var/www/lib/private/TemplateLayout.php",
                "line": 211,
                "function": "getConfig",
                "class": "OC\\Template\\JSConfigHelper",
                "type": "->"
            },
            {
                "file": "/var/www/lib/private/legacy/OC_Template.php",
                "line": 183,
                "function": "__construct",
                "class": "OC\\TemplateLayout",
                "type": "->"
            },
            {
                "file": "/var/www/lib/public/AppFramework/Http/TemplateResponse.php",
                "line": 210,
                "function": "fetchPage",
                "class": "OC_Template",
                "type": "->"
            },
            {
                "file": "/var/www/lib/private/AppFramework/Http/Dispatcher.php",
                "line": 172,
                "function": "render",
                "class": "OCP\\AppFramework\\Http\\TemplateResponse",
                "type": "->"
            },
            {
                "file": "/var/www/lib/private/AppFramework/App.php",
                "line": 157,
                "function": "dispatch",
                "class": "OC\\AppFramework\\Http\\Dispatcher",
                "type": "->"
            },
            {
                "file": "/var/www/lib/private/Route/Router.php",
                "line": 302,
                "function": "main",
                "class": "OC\\AppFramework\\App",
                "type": "::"
            },
            {
                "file": "/var/www/lib/base.php",
                "line": 993,
                "function": "match",
                "class": "OC\\Route\\Router",
                "type": "->"
            },
            {
                "file": "/var/www/index.php",
                "line": 37,
                "function": "handleRequest",
                "class": "OC",
                "type": "::"
            }
        ],
        "File": "/var/www/lib/private/Security/Bruteforce/Throttler.php",
        "Line": 109,
        "CustomMessage": "--"
    },
    "userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0",
    "version": "21.0.3.1"
}
crazy-max commented 3 years ago

@georgikoemdzhiev Works fine on my side, don't think that's an issue with the Docker image but Nextcloud itself. Looking at the timestamp in the log "time": "2071-05-18 05:33:44", and your host platform armv7l, you might need at least libseccomp2 2.4.2 (moby/moby#40734):

$ wget https://ftp.debian.org/debian/pool/main/libs/libseccomp/libseccomp2_2.5.1-1_armhf.deb
$ sudo dpkg -i libseccomp2_2.5.1-1_armhf.deb

See also https://help.nextcloud.com/t/nextcloud-20-0-5-2-getcutofftimestamp-must-be-of-the-type-int-bool-returned/104597/12

georgikoemdzhiev commented 3 years ago

Thank you for looking into the issue and pointing out the dependency update.

I did update libseccomp to 2_2.5.1-1 following your steps above. And recreated the container (after a host reboot). However, now the container cannot be started at all after running docker run -d -p 8000:8000 --name nextcloud -v /home/pi/NextCloud/SSD:/data -e DB_PASSWORD=mypass crazymax/nextcloud:latest. It EXITS immediately.

Running `docker logs cont_id results in the following:

sudo docker logs --since=1h c12f3
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
s6-svscan: warning: unable to iopause: Invalid argument
s6-svscan: warning: executing into .s6-svscan/crash
[s6-init] ensuring user provided files have correct perms...s6-svscan panicked! Dropping to a root shell.

/bin/sh: can't access tty; job control turned off
/run/s6/services # 

If this is not a problem with the NextCloud image, would you say at this point I would be better off reinstalling the OS on my Rpi and docker and reattempting to launch the latest image? Not sure what what would be best here, thank you!

crazy-max commented 3 years ago

Yeah something seems flawky on your host. Not sure why. I've just tried on a RPI 4 (aarch64) and it works well. Suggest to switch to Ubuntu Server 20.04.2 LTS (aarch64) instead of Raspbian if you can and install Docker with curl -sSL get.docker.com | sh cmd.

georgikoemdzhiev commented 3 years ago

Will do! Thank you very much for your time and suggestions. Will give Ubuntu Server a try. Closing this issue now. Thank you for the awesome NC docker image once more :)