Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
brokkr opened this issue Sep 19, 2018 · 38 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug needs info stale Ticket or PR with no recent activity

Comments

@brokkr
Copy link

brokkr commented Sep 19, 2018

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
@nextcloud-bot
Copy link
Member

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

@brokkr
Copy link
Author

brokkr commented Sep 20, 2018

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?

@cswank73
Copy link

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

@hexop
Copy link

hexop commented Oct 4, 2018

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

@hcharbonnier
Copy link

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

@Woefdram
Copy link

Woefdram commented Oct 9, 2018

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

@wpplayer
Copy link

The same - v14.0.3, Centos 7.

@choopm
Copy link

choopm commented Oct 22, 2018

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.

@marillat
Copy link

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

@captainwasabi

This comment has been minimized.

@kesselb
Copy link
Contributor

kesselb commented Oct 27, 2018

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

} catch (Error $ex) {
and add var_dump($ex); exit(); below?

@captainwasabi

This comment has been minimized.

@menteb
Copy link

menteb commented Oct 28, 2018

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}

@kesselb
Copy link
Contributor

kesselb commented Oct 28, 2018

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

@menteb
Copy link

menteb commented Oct 28, 2018

@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
}

@kesselb
Copy link
Contributor

kesselb commented Oct 28, 2018

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.

@captainwasabi
Copy link

captainwasabi commented Oct 28, 2018 via email

@menteb
Copy link

menteb commented Oct 28, 2018

Fresh install: same result

@kesselb
Copy link
Contributor

kesselb commented Oct 28, 2018

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

@menteb
Copy link

menteb commented Oct 29, 2018

Here you go:

php_modules.txt
config.txt

@kesselb
Copy link
Contributor

kesselb commented Oct 29, 2018

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

@menteb
Copy link

menteb commented Oct 29, 2018

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

@kesselb
Copy link
Contributor

kesselb commented Oct 29, 2018

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

@menteb
Copy link

menteb commented Oct 30, 2018

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

@kesselb
Copy link
Contributor

kesselb commented Nov 4, 2018

Ref #12198

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

@tomasz-lasko
Copy link

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!

@Taurolyon
Copy link

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

@Preisschild
Copy link

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"

@Preisschild
Copy link

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":""}

@toxpal
Copy link

toxpal commented Dec 12, 2018

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.

@kesselb
Copy link
Contributor

kesselb commented Dec 12, 2018

@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).

@Bredt
Copy link

Bredt commented Feb 15, 2019

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!

@skjnldsv skjnldsv added the 0. Needs triage Pending check for reproducibility or if it fits our roadmap label Jun 12, 2019
@kesselb
Copy link
Contributor

kesselb commented Jun 29, 2019

@brokkr does this issue still exist?

@axe312ger
Copy link

@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

@kesselb
Copy link
Contributor

kesselb commented Jul 2, 2019

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

@ghost
Copy link

ghost commented Aug 1, 2019

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.

@ghost ghost added the stale Ticket or PR with no recent activity label Aug 1, 2019
@ghost ghost closed this as completed Aug 15, 2019
@PeterTonoli
Copy link

@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

@megabert
Copy link

megabert commented Jun 8, 2021

I came here by googling the text in the issue header.

My issue was: Syntax error in the config file. So I just ran php on config.php on the command line and it showed me the error line, where the syntax error was.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug needs info stale Ticket or PR with no recent activity
Projects
None yet
Development

No branches or pull requests