Server: Nextcloud 14: Uncaught error, Call to a member function getLogger() on null when attempting installation

Created on 19 Sep 2018  ·  37Comments  ·  Source: nextcloud/server

Steps to reproduce

  1. Download and extract Nextcloud 14.0 to docker volume. Chown to www-data:www-data.
  2. Mount volume to both nginx and php-fpm containers and run containers in dedicated subnet (alongside mariadb container) with nginx's port 80 published to host.
  3. Enter host in browser

Expected behaviour

Nextcloud's install page should show up

Actual behaviour

The following text is displayed in browser:

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the webserver log.
<br />
<b>Fatal error</b>:  Uncaught Error: Call to a member function getLogger() on null in /nextcloud/index.php:72
Stack trace:
#0 {main}
  thrown in <b>/nextcloud/index.php</b> on line <b>72</b><br />"

After enabling

php_flag[display_errors] = on

in www.conf, php-fpm output changed from simply reporting http status 500 to reporting 500 AND including the same (but no more) output as above.

The expected behaviour is seen using volumes with older releases:

  • 12.0.11 (albeit with php-fpm 7.1)
  • 13.0.6

A standard phpinfo.php status page inserted into the Nextcloud 14 folder web root is accessible and does display. The status page confirms that all required (https://docs.nextcloud.com/server/14/admin_manual/installation/source_installation.html) modules are installed.

The behaviour of 14.0 does not change with older php-fpm releases (7.1, 7.0)

Server configuration

Operating system:

  • Docker host: Ubuntu 18.04
  • php-fpm container: Debian stretch
  • nginx container: Debian stretch
  • mariadb container: Ubuntu 18.04

Web server: Nginx 1.14 ('nginx:stable')

Database: Mariadb 10.3.9

PHP version: 7.2.10

Nextcloud version: 14.0

Updated from an older Nextcloud/ownCloud or fresh install: No

Where did you install Nextcloud from: https://download.nextcloud.com/server/releases/nextcloud-14.0.0.tar.bz2

Signing status:
Not available

List of activated apps:


App list

Nextcloud is not installed - only a limited number of commands are available


  Command "app:list" is not defined.  

  Did you mean this?                  
      app:check-code                  

Nextcloud configuration:


Config report

The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see http://php.net/manual/en/book.pcntl.php
The current PHP memory limit is below the recommended value of 512MB.
Nextcloud is not installed - only a limited number of commands are available


  There are no commands defined in the "config" namespace.  

Are you using external storage, if yes which one: No

Are you using encryption: On NC files? No. I have a proxy setup on docker host that encrypts traffic to the host and proxy_pass'es request to the container. The results are the same when accessing the container through the proxy (https) and when accessing it directly (http) on the published host port.

Are you using an external user-backend, if yes which one: No

Client configuration

Browser: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/67.0.3396.99 Chrome/67.0.3396.99 Safari/537.36"

Operating system: Ubuntu 17.10

Logs

Web server error log


Web server error log

nc_phpfpm     | [18-Sep-2018 23:42:31] WARNING: [pool www] child 8 said into stderr: "NOTICE: PHP message: PHP Fatal error:  Uncaught Error: Call to a member function getLogger() on null in /nextcloud/index.php:72"
nc_nginx      | 2018/09/18 23:42:31 [error] 7#7: *1 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Call to a member function getLogger() on null in /nextcloud/index.php:72
nc_nginx      | Stack trace:
nc_nginx      | #0 {main}
nc_nginx      |   thrown in /nextcloud/index.php on line 72" while reading upstream, client: 10.0.6.1, server: xxxxx, request: "GET /index.php HTTP/1.1", upstream: "fastcgi://10.0.6.4:9000", host: "xxxxx", referrer: "https://xxxxx/"
nc_phpfpm     | [18-Sep-2018 23:42:31] WARNING: [pool www] child 8 said into stderr: "Stack trace:"
nc_phpfpm     | [18-Sep-2018 23:42:31] WARNING: [pool www] child 8 said into stderr: "#0 {main}"
nc_phpfpm     | 10.0.6.2 -  18/Sep/2018:23:42:31 +0200 "GET " 500
nc_phpfpm     | [18-Sep-2018 23:42:31] WARNING: [pool www] child 8 said into stderr: "  thrown in /nextcloud/index.php on line 72"
nc_nginx      | 10.0.6.1 - - [18/Sep/2018:23:42:31 +0200] "GET /index.php HTTP/1.1" 500 508 "https://xxxxx/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/67.0.3396.99 Chrome/67.0.3396.99 Safari/537.36"

Nextcloud log (data/nextcloud.log)


Nextcloud log

n/a

Browser log


Browser log

Request-URL: https://xxxxx/index.php
Request-metode: GET
Fjern-adresse: xx.xx.xx.xx:443
Statuskode:
500
Version:

Response-headers (225 B)    
Connection  
keep-alive
Content-Type    
text/plain; charset=utf-8
Date    
Wed, 19 Sep 2018 11:11:17 GMT
Server  
nginx/1.14.0 (Ubuntu)
Transfer-Encoding   
chunked
X-Powered-By    
PHP/7.2.10

Request-headers (414 B) 
Accept  
text/html,application/xhtml+xm…plication/xml;q=0.9,*/*;q=0.8
Accept-Encoding 
gzip, deflate, br
Accept-Language 
da,en-US;q=0.7,en;q=0.3
Cache-Control   
max-age=0
Connection  
keep-alive
DNT 
1
Host    
xxxxx
Referer 
https://xxxxx/
Upgrade-Insecure-Requests   
1
User-Agent  
Mozilla/5.0 (Windows NT 10.0; …) Gecko/20100101 Firefox/62.0

0. Needs triage bug needs info stale

Most helpful comment

@axe312ger

to have my nextcloud & data directory mounted via nfs

The problem went away when I started to serve nextcloud from local harddrive and serve the data dir via nfs only

I had a similar problem with Nextcloud being served over NFS. It was resolved by making sure the NFS server was running lockd; in my case, with Ubuntu 18, the commands were:
_sudo systemctl enable rpc-statd
sudo systemctl start rpc-statd_

All 37 comments

GitMate.io thinks possibly related issues are https://github.com/nextcloud/server/issues/6706 (Call to a member function getUID() on null), https://github.com/nextcloud/server/issues/6803 (Nextcloud 12 throwing fatal error: cron - “Call to a member function getFileInfo() on null”), https://github.com/nextcloud/server/issues/10316 (Error: Call to a member function instanceOfStorage() on null), https://github.com/nextcloud/server/issues/3110 (PROPFIND causes Error: Call to a member function getCache() on null), and https://github.com/nextcloud/server/issues/10585 (Error: Call to a member function getMimetype() on boolean).

Methinks the bot is off because
1) Those issues all relate to version < 14; I'm reasonably certain that this issue is clearly and cleanly a v14 issue.
2) The error is uncaught, the others are not. Coming from a Python background maybe I'm putting too much importance on that word? Still, uncaught is not good, right?

I'm getting the same error on a brand new nextcloud 14.0.0 install. I found an error in my config.php and corrected it but still getting the same error internal server error. I've looked at line #72 in the index.php and it does not shed any light on the issue.

My install is using Apache 2, Mariadb, PHP 7.1 on an Ubuntu 18.0.4 Server LTS

I'm getting the same error on a new install of nextcloud 14.0.1 on FreeBSD 12-Current.
I'm using Nginx + PHP-FPM + PostgreSQL

Same here, with nextcloud 14.0.1 with Apache + php7.2 + MariaDB

Same here, also 14.0.1, Apache 2.4.6, PHP 7.2.10, MariaDB 10.2.18 on CentOS 7.

The same - v14.0.3, Centos 7.

Happened to me too during installation after creating config.php manually (you're not expected to do that). Deleted the file, now everything's fine.

Maybe this problem come from php-acpu

Debian testing, after downgrading php-apcu-bc from 1.0.4-3 to 1.0.4-2
and
php-apcu from 5.1.12+4.0.11-2 to 5.1.12+4.0.11-1

nextcloud 14.0.3 is back

same problem, upgrading to 14.0.3 killed my working server, now I'm trying reinstalling and I get this?? And it's been over a month?

This is f'ing bad!

Of course! I cannot reproduce this issue unfortunately. Could you look for this line https://github.com/nextcloud/server/blob/0092e3adece4317cd2eff624e8ee4fab81006299/index.php#L70 and add var_dump($ex); exit(); below?

umm, looks at the ground and kicks dirt. umm, so I had already blown away the container I had installed into. So this morning I just recreated a container and went through the same install. As you might guess, it seems to be working perfectly. I was going to do it again when I realized the one thing I did different, in the original I installed the snap then deleted it (it's probably easy but I needed to change the port to 8443 and I was in a hurry and sleep deprived so I just decided to do a manual reinstall like I have done a hundred times before) but I be the snap installed something then didn't properly get rid of it when I deleted it.

:( sorry for the gruff mood. You guys rock!

Same problem on Arch Linux +Nginx + PHP-FPM + MariaDB running 14.0.3. Fresh install.

2018/10/28 15:02:54 [error] 5313#5313: *15 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to a member function getLogger() on null in /usr/share/nginx/html/index.php:72
Stack trace:

0 {main}

Of course! I cannot reproduce this issue unfortunately. Could you look for this line

server/index.php

Line 70 in 0092e3a
} catch (Error $ex) {
and add var_dump($ex); exit(); below?

@menteb

@danielkesselberg Here you go:

object(Error)#3 (7) {
["message":protected]=>
string(30) "Class 'RedisCluster' not found"
["string":"Error":private]=>
string(0) ""
["code":protected]=>
int(0)
["file":protected]=>
string(39) "/usr/share/nginx/html/config/config.php"
["line":protected]=>
int(1136)
["trace":"Error":private]=>
array(6) {
[0]=>
array(3) {
["file"]=>
string(44) "/usr/share/nginx/html/lib/private/Config.php"
["line"]=>
int(214)
["function"]=>
string(7) "include"
}
[1]=>
array(6) {
["file"]=>
string(44) "/usr/share/nginx/html/lib/private/Config.php"
["line"]=>
int(63)
["function"]=>
string(8) "readData"
["class"]=>
string(9) "OC\Config"
["type"]=>
string(2) "->"
["args"]=>
array(0) {
}
}
[2]=>
array(6) {
["file"]=>
string(34) "/usr/share/nginx/html/lib/base.php"
["line"]=>
int(140)
["function"]=>
string(11) "__construct"
["class"]=>
string(9) "OC\Config"
["type"]=>
string(2) "->"
["args"]=>
array(1) {
[0]=>
string(29) "/usr/share/nginx/html/config/"
}
}
[3]=>
array(6) {
["file"]=>
string(34) "/usr/share/nginx/html/lib/base.php"
["line"]=>
int(591)
["function"]=>
string(9) "initPaths"
["class"]=>
string(2) "OC"
["type"]=>
string(2) "::"
["args"]=>
array(0) {
}
}
[4]=>
array(6) {
["file"]=>
string(34) "/usr/share/nginx/html/lib/base.php"
["line"]=>
int(1068)
["function"]=>
string(4) "init"
["class"]=>
string(2) "OC"
["type"]=>
string(2) "::"
["args"]=>
array(0) {
}
}
[5]=>
array(4) {
["file"]=>
string(31) "/usr/share/nginx/html/index.php"
["line"]=>
int(40)
["args"]=>
array(1) {
[0]=>
string(34) "/usr/share/nginx/html/lib/base.php"
}
["function"]=>
string(12) "require_once"
}
}
["previous":"Error":private]=>
NULL
}

Do you created config.php before running the setup like @choopm? If so please dont ;-) Delete config.php and visit nextcloud. Installer will create config.php for you.

Happened to me too during installation after creating config.php manually (you're not expected to do that). Deleted the file, now everything's fine.

Ah ha! I did that the first time, didn't do it the second.

On October 28, 2018 3:22:18 PM EDT, Daniel Kesselberg notifications@github.com wrote:

Do you created config.php before running the setup like @choopm? If
so please dont ;-) Delete config.php and visit nextcloud. Installer
will create config.php for you.

Happened to me too during installation after creating config.php
manually (you're not expected to do that). Deleted the file, now
everything's fine.

--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/nextcloud/server/issues/11298#issuecomment-433733675

Fresh install: same result

Could you share your config.php (please remove sensitive information) and php -m.

Are they any other files in config folder? Could you post there content?

Got it fixed. Problem now is that I see a massive amount of .js errors in console

How do you fixed it? What kind of js errors?

@danielkesselberg The getlogger() error was due to PEBKAC. Something missing in my web server config. Fixed the .js errors by removing all caches.

Ref https://github.com/nextcloud/server/pull/12198

Linked pr improves error message. Should be easier to find the real reason.

I also had this error on Ubuntu 18.04 LTS 64bit, because I copied config.php from the config.sample.php

The sample is quite "freaky", I tried to make something out of it, but when opening the wizard got the mentioned error:

PHP Fatal error: Uncaught Error: Call to a member function getLogger() on null in /var/www/nextcloud/index.php:72

So I just removed my config.php and started the wizard and it's working great!

Can also confirm, removing the nextcloud/config/config.php resolved the issue.

When I remove config.php, it gets recreated, but this time I get for the first the the blue nextcloud background, but It says "Internal Server Error"

I get those lines in the docker logs, they seem to be important:

[Sat Dec 08 11:01:43.153231 2018] [php7:notice] [pid 29] [client 172.17.0.1:60020] {"reqId":"1xiy2FmvULyreYIlhtUL","level":3,"time":"2018-12-08T11:01:43+00:00","remoteAddr":"172.17.0.1","user":"--","app":"PHP","method":"GET","url":"\\/","message":"fileperms(): stat failed for \\/var\\/www\\/html\\/data\\/nextcloud.log at \\/var\\/www\\/html\\/lib\\/private\\/Log\\/File.php#137","userAgent":"Mozilla\\/5.0 (X11; Fedora; Linux x86_64; rv:63.0) Gecko\\/20100101 Firefox\\/63.0","version":""}


[Sat Dec 08 11:01:43.153266 2018] [php7:notice] [pid 29] [client 172.17.0.1:60020] {"reqId":"1xiy2FmvULyreYIlhtUL","level":3,"time":"2018-12-08T11:01:43+00:00","remoteAddr":"172.17.0.1","user":"--","app":"index","method":"GET","url":"\\/","message":{"Exception":"Exception","Message":"Could not acquire an exclusive lock on the config file \\/var\\/www\\/html\\/config\\/config.php","Code":0,"Trace":[{"file":"\\/var\\/www\\/html\\/lib\\/private\\/Config.php","line":132,"function":"writeData","class":"OC\\\\Config","type":"->","args":[]},{"file":"\\/var\\/www\\/html\\/lib\\/private\\/SystemConfig.php","line":100,"function":"setValue","class":"OC\\\\Config","type":"->","args":["instanceid","ocyg523m80xn"]},{"file":"\\/var\\/www\\/html\\/lib\\/private\\/legacy\\/util.php","line":1170,"function":"setValue","class":"OC\\\\SystemConfig","type":"->","args":["instanceid","ocyg523m80xn"]},{"file":"\\/var\\/www\\/html\\/lib\\/base.php","line":415,"function":"getInstanceId","class":"OC_Util","type":"::","args":[]},{"file":"\\/var\\/www\\/html\\/lib\\/base.php","line":656,"function":"initSession","class":"OC","type":"::","args":[]},{"file":"\\/var\\/www\\/html\\/lib\\/base.php","line":1068,"function":"init","class":"OC","type":"::","args":[]},{"file":"\\/var\\/www\\/html\\/index.php","line":40,"args":["\\/var\\/www\\/html\\/lib\\/base.php"],"function":"require_once"}],"File":"\\/var\\/www\\/html\\/lib\\/private\\/Config.php","Line":258,"CustomMessage":"--"},"userAgent":"Mozilla\\/5.0 (X11; Fedora; Linux x86_64; rv:63.0) Gecko\\/20100101 Firefox\\/63.0","version":""}


[Sat Dec 08 11:01:43.227054 2018] [php7:warn] [pid 29] [client 172.17.0.1:60020] PHP Warning:  fileperms(): stat failed for /var/www/html/data/nextcloud.log in /var/www/html/lib/private/Log/File.php on line 137


[Sat Dec 08 11:01:43.227081 2018] [php7:notice] [pid 29] [client 172.17.0.1:60020] {"reqId":"1xiy2FmvULyreYIlhtUL","level":3,"time":"2018-12-08T11:01:43+00:00","remoteAddr":"172.17.0.1","user":"--","app":"PHP","method":"GET","url":"\\/","message":"fileperms(): stat failed for \\/var\\/www\\/html\\/data\\/nextcloud.log at \\/var\\/www\\/html\\/lib\\/private\\/Log\\/File.php#137","userAgent":"Mozilla\\/5.0 (X11; Fedora; Linux x86_64; rv:63.0) Gecko\\/20100101 Firefox\\/63.0","version":""}


[Sat Dec 08 11:01:43.227107 2018] [php7:notice] [pid 29] [client 172.17.0.1:60020] {"reqId":"1xiy2FmvULyreYIlhtUL","level":3,"time":"2018-12-08T11:01:43+00:00","remoteAddr":"172.17.0.1","user":"--","app":"PHP","method":"GET","url":"\\/","message":"chmod(): No such file or directory at \\/var\\/www\\/html\\/lib\\/private\\/Log\\/File.php#138","userAgent":"Mozilla\\/5.0 (X11; Fedora; Linux x86_64; rv:63.0) Gecko\\/20100101 Firefox\\/63.0","version":""}

Installed NC 15 today and get this error every time cronjob is launched. I also have NC 14 (installed months ago) on the same server, and it works perfectly, so it's surely not server's problem.

I did NOT generate config.php file manually. Struggling with this error for hours, will try to delete and re-install.

@toxpal could you create a new issue for that? thank you!

https://github.com/nextcloud/server/issues/new/choose (please try to add all information requested by the issue template).

Maybe a solution:
My config.php look like this:

<?php
$CONFIG = array (
  'instanceid' => 'xxxxxxxxxxxx',
);
yyyyyyyyyyyyyy',
  'secret' => 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz',
  'trusted_domains' => 
  array (
    0 => 'xxxxxx.xxx',
  ),
…

I juste remove this part:

);
yyyyyyyyyyyyyy',

and now it works perfectly!

@brokkr does this issue still exist?

@kesselb, for me, actually yes.

I ended up with this while setting up nextcloud with:

https://github.com/nextcloud/docker/tree/master/.examples/docker-compose/with-nginx-proxy/mariadb/fpm

and

https://github.com/MatchbookLab/local-persist

to have my nextcloud & data directory mounted via nfs

The problem went away when I started to serve nextcloud from local harddrive and serve the data dir via nfs only

To bad I cant serve the root directory from my NAS but still, having the data on my NAS via nfs and running nextcloud from local NUC harddrive is fine for now.

Hope this might help somebody

@axe312ger please create a new issue with the issue template. This issue is already to crowded.

This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.

@axe312ger

to have my nextcloud & data directory mounted via nfs

The problem went away when I started to serve nextcloud from local harddrive and serve the data dir via nfs only

I had a similar problem with Nextcloud being served over NFS. It was resolved by making sure the NFS server was running lockd; in my case, with Ubuntu 18, the commands were:
_sudo systemctl enable rpc-statd
sudo systemctl start rpc-statd_

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ChristophWurst picture ChristophWurst  ·  3Comments

ThomasLeister picture ThomasLeister  ·  3Comments

MorrisJobke picture MorrisJobke  ·  3Comments

williambargent picture williambargent  ·  3Comments

jancborchardt picture jancborchardt  ·  3Comments