I used to have a working Nextcloud 12 install.
It didn’t open earlier today, I think I got a blank page upon login, which I used to solve by removing the cookies.
Since I still couldn’t access after this, and I didn’t update my server for a long time, I decided to update, and due to the incompatibility between PHP 7.2 and Nextcloud 12, I installed Nextcloud 13.
The upgrade process from Nextcloud 12 to 13 didn’t work from the web interface, but it went uneventfully using occ command.
Right now I can open the Nextcloud Log in page, I cannot log in with the “Log in” button (it remains on the Log in page), but I can log in by ticking “Stay logged in”.
If I do that, I get to the Files page, which remains empty and enters a refresh loop with the message “Problem loading page, reloading in 5 seconds”.
From there, I can access most Settings pages, except Logging, which remains on the loading animation. Also Basic settings says: “Error occurred while checking server setup”.
The pages Apps and Users enter a refresh loop too.
Last symptom, if I load the site again, it goes to a blank page, and I need to remove the cookies to be able to access the Log in page.
The only app that I enabled before is Contacts, I tried to disable it, it didn’t help.
I ran occ maintenance:repair, which completed without any message that seemed notable.
Last word: it may make sense to post on github rather than here, let me know if that’s the case.
My system:
- I tried nextcloud-testing (13.0.0beta3) and nextcloud-git (13.0.0beta3.r49.gcfd116b5f9) from Arch Linux AUR
- nginx 1.12.2
- PHP 7.2
- PostgreSQL 10.1
Config files:
Nexcloud config.php
<?php
$CONFIG = array (
'instanceid' => 'oca8598edaf8',
'passwordsalt' => 'xxx',
'trusted_domains' =>
array (
0 => 'files.mydomain.net',
),
'apps_paths' =>
array (
0 =>
array (
'path' => '/usr/share/webapps/nextcloud/apps',
'url' => '/apps',
'writable' => false,
),
1 =>
array (
'path' => '/usr/share/webapps/nextcloud/apps2',
'url' => '/apps2',
'writable' => true,
),
),
'datadirectory' => '/usr/share/webapps/nextcloud/data',
'dbtype' => 'pgsql',
'version' => '13.0.0.8',
'dbname' => 'owncloud',
'dbhost' => 'localhost',
'dbtableprefix' => 'oc_',
'dbuser' => 'owncloud',
'dbpassword' => '',
'installed' => true,
'theme' => '',
'maintenance' => false,
'secret' => 'xxx',
'overwriteprotocol' => 'https',
'loglevel' => 0,
'trashbin_retention_obligation' => '10',
'htaccess.RewriteBase' => '/',
'memcache.local' => '\\OC\\Memcache\\APCu',
'overwrite.cli.url' => 'https://files.mydomain.net',
);
nginx nextcloud.conf
# Path to the root of your installation
root /usr/share/webapps/nextcloud/;
# ACME challenge
include conf.d/letsencrypt.conf;
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
# The following 2 rules are only needed for the user_webfinger app.
# Uncomment it if you're planning to use this app.
#rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
#rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json
# last;
location = /.well-known/carddav {
return 301 $scheme://$host/remote.php/dav;
}
location = /.well-known/caldav {
return 301 $scheme://$host/remote.php/dav;
}
# set max upload size
client_max_body_size 4000M;
fastcgi_read_timeout 600;
fastcgi_buffers 64 4K;
# Enable gzip but do not remove ETag headers
gzip on;
gzip_vary on;
gzip_comp_level 4;
gzip_min_length 256;
gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;
gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;
# Uncomment if your server is build with the ngx_pagespeed module
# This module is currently not supported.
#pagespeed off;
location / {
rewrite ^ /index.php$uri;
}
#location / {
# try_files $uri $uri/ /index.php;
#}
location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
deny all;
}
location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
deny all;
}
location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|core/templates/40[34])\.php(?:$|/) {
#fastcgi_split_path_info ^(.+\.php)(/.*)$;
#include fastcgi_params;
#fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
#fastcgi_param PATH_INFO $fastcgi_path_info;
#fastcgi_param HTTPS on;
##Avoid sending the security headers twice
#fastcgi_param modHeadersAvailable true;
#fastcgi_param front_controller_active true;
#fastcgi_pass php-handler;
#fastcgi_intercept_errors on;
#fastcgi_request_buffering off;
include uwsgi_params;
uwsgi_modifier1 14;
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
#uwsgi_pass 127.0.0.1:3001;
uwsgi_pass unix:/run/uwsgi/nextcloud.sock;
}
location ~ ^/(?:updater|ocs-provider)(?:$|/) {
try_files $uri/ =404;
index index.php;
}
# Adding the cache control header for js and css files
# Make sure it is BELOW the PHP block
location ~* \.(?:css|js|woff|svg|gif)$ {
try_files $uri /index.php$uri$is_args$args;
add_header Cache-Control "public, max-age=7200";
# Optional: Don't log access to assets
access_log off;
}
location ~* \.(?:png|html|ttf|ico|jpg|jpeg)$ {
try_files $uri /index.php$uri$is_args$args;
# Optional: Don't log access to other assets
access_log off;
}
uwsgi nextcloud.ini
[uwsgi]
; load the required plugins
plugins = php
; force the sapi name to 'apache', this will enable the opcode cache
php-sapi-name = apache
; set master process name and socket
; '%n' refers to the name of this configuration file without extension
procname-master = uwsgi %n
master = true
socket = /run/uwsgi/%n.sock
; drop privileges
uid = http
gid = http
umask = 027
; run with at least 1 process but increase up to 4 when needed
processes = 4
cheaper = 1
; reload whenever this config file changes
; %p is the full path of the current config file
touch-reload = %p
; disable uWSGI request logging
;disable-logging = true
; enforce a DOCUMENT_ROOT
php-docroot = /usr/share/webapps/%n
; limit allowed extensions
php-allowed-ext = .php
; and search for index.php if required
php-index = index.php
; set php configuration for this instance of php, no need to edit global php.ini
php-set = date.timezone=Etc/UTC
;php-set = open_basedir=/tmp/:/usr/share/webapps/nextcloud:/etc/webapps/nextcloud:/dev/urandom
php-set = expose_php=false
; avoid security risk of leaving sessions in world-readable /tmp
;php-set = session.save_path=/usr/share/webapps/nextcloud/data
php-set = session.save_path=/var/lib/php/sessions
; port of php directives set upstream in /usr/share/webapps/nextcloud/.user.ini for use with PHP-FPM
php-set = upload_max_filesize=513M
php-set = post_max_size=513M
php-set = memory_limit=512M
php-set = output_buffering=off
; load all extensions only in this instance of php, no need to edit global php.ini
;; required core modules
php-set = extension=gd
php-set = extension=iconv
;php-set = extension=zip # enabled by default in global php.ini
;; database connectors
;; uncomment your selected driver
;php-set = extension=pdo_sqlite
;php-set = extension=pdo_mysql
php-set = extension=pdo_pgsql
;; recommended extensions
;php-set = extension=curl # enabled by default in global php.ini
php-set = extension=bz2
php-set = extension=intl
;; required for specific apps
;php-set = extension=ldap # for LDAP integration
;php-set = extension=ftp # for FTP storage / external user authentication
;php-set = extension=imap # for external user authentication, requires php-imap
;; recommended for specific apps
;php-set = extension=exif # for image rotation in pictures app, requires exiv2
;php-set = extension=gmp # for SFTP storage
;; for preview generation
;; provided by packages in AUR
; php-set = extension=imagick
; opcache
php-set = zend_extension=opcache
; user cache
; provided by php-acpu, to be enabled **either** here **or** in /etc/php/conf.d/apcu.ini
;php-set = extension=apcu
; per https://github.com/krakjoe/apcu/blob/simplify/INSTALL
php-set = apc.ttl=7200
php-set = apc.enable_cli=1
cron2 = minute=-15,unique=1 /usr/bin/php -f /usr/share/webapps/nextcloud/cron.php 1>/dev/null
Logs:
The following logs are from a click on the “Log in” button
Nextcloud log (loglevel=0)
{"reqId":"kJErNTjC3zLSBD3qw5uT","level":0,"time":"2017-12-19T15:13:17+00:00","remoteAddr":"127.0.0.1","user":"--","app":"no app in context","method":"GET","url":"\/index.php\/apps\/files\/","message":"Current user is not logged in","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":"13.0.0.8"}
{"reqId":"pWWU7pwghFUPuhMFflcs","level":0,"time":"2017-12-19T15:13:17+00:00","remoteAddr":"127.0.0.1","user":"--","app":"core","method":"GET","url":"\/index.php\/login?redirect_url=\/index.php\/apps\/files\/","message":"Scss is disabled for \/usr\/share\/webapps\/nextcloud\/core\/css\/jquery-ui-fixes.scss, ignoring","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":"13.0.0.8"}
{"reqId":"pWWU7pwghFUPuhMFflcs","level":0,"time":"2017-12-19T15:13:17+00:00","remoteAddr":"127.0.0.1","user":"--","app":"core","method":"GET","url":"\/index.php\/login?redirect_url=\/index.php\/apps\/files\/","message":"Scss is disabled for \/usr\/share\/webapps\/nextcloud\/core\/css\/server.scss, ignoring","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":"13.0.0.8"}
{"reqId":"pWWU7pwghFUPuhMFflcs","level":0,"time":"2017-12-19T15:13:17+00:00","remoteAddr":"127.0.0.1","user":"--","app":"core","method":"GET","url":"\/index.php\/login?redirect_url=\/index.php\/apps\/files\/","message":"Scss is disabled for \/usr\/share\/webapps\/nextcloud\/core\/css\/share.scss, ignoring","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":"13.0.0.8"}
{"reqId":"pWWU7pwghFUPuhMFflcs","level":0,"time":"2017-12-19T15:13:17+00:00","remoteAddr":"127.0.0.1","user":"--","app":"core","method":"GET","url":"\/index.php\/login?redirect_url=\/index.php\/apps\/files\/","message":"Scss is disabled for \/usr\/share\/webapps\/nextcloud\/core\/css\/jquery.ocdialog.scss, ignoring","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":"13.0.0.8"}
nginx access.log
127.0.0.1 - - [20/Dec/2017:00:05:19 +0800] "POST /index.php/login HTTP/1.1" 303 5 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0"
127.0.0.1 - - [20/Dec/2017:00:05:19 +0800] "GET /index.php/apps/files/ HTTP/1.1" 303 5 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0"
127.0.0.1 - - [20/Dec/2017:00:05:19 +0800] "GET /index.php/login?redirect_url=/index.php/apps/files/ HTTP/1.1" 200 3167 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0"
uwsgi log
uwsgi[222]: [pid: 273|app: -1|req: -1/378] 127.0.0.1 () {48 vars in 1233 bytes} [Wed Dec 20 00:07:39 2017] POST /index.php/login?redirect_url=/index.php/apps/files/ => generated 0 bytes in 138 msecs (HTTP/1.1 303) 13 headers in 843 bytes (0 switches on core 0)
uwsgi[222]: [pid: 273|app: -1|req: -1/379] 127.0.0.1 () {44 vars in 1057 bytes} [Wed Dec 20 00:07:39 2017] GET /index.php/apps/files/ => generated 0 bytes in 25 msecs (HTTP/1.1 303) 12 headers in 771 bytes (0 switches on core 0)
uwsgi[222]: [pid: 273|app: -1|req: -1/380] 127.0.0.1 () {44 vars in 1116 bytes} [Wed Dec 20 00:07:39 2017] GET /index.php/login?redirect_url=/index.php/apps/files/ => generated 10222 bytes in 45 msecs (HTTP/1.1 200) 12 headers in 723 bytes (0 switches on core 0)
uwsgi[222]: [pid: 273|app: -1|req: -1/381] 127.0.0.1 () {48 vars in 1012 bytes} [Wed Dec 20 00:07:41 2017] PROPFIND /remote.php/dav/files/li/ => generated 510 bytes in 38 msecs (HTTP/1.1 207) 13 headers in 758 bytes (0 switches on core 0)