Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Nextcloud internal server error [MySQL issue] [Solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
tabanus
l33t
l33t


Joined: 11 Jun 2004
Posts: 626
Location: UK

PostPosted: Mon Jan 22, 2018 11:39 pm    Post subject: Nextcloud internal server error [MySQL issue] [Solved] Reply with quote

I had Nextcloud working perfectly with lighttpd and mysql, but after a re-boot it's started to refuse connections.

The web interface says "Internal Server Error".

In the /var/log/lighttpd/error.log I'm getting lots of errors that look like this:

Code:
2018-01-22 22:45:40: (mod_fastcgi.c.2543) FastCGI-stderr: PHP message: {"reqId":"uzUA4itXhxCCbIjFIK4a","level":3,"time":"2018-01-22T22:45:40+00:00","remoteAddr":"x.x.x.x",
"user":"--","app":"PHP","method":"GET","url":"\/nextcloud\/status.php","message":"touch(): Utime failed: Permission denied at \/var\/www\/localhost\/htdocs\/nextcloud\/lib\/private\/Config.php#239","userAgent":"Mozilla\/5.0 (Linux) mirall\/2.3.3 (Nextcloud)","version":""}
2018-01-22 22:45:40: (mod_fastcgi.c.2543) FastCGI-stderr: PHP message: {"reqId":"uzUA4itXhxCCbIjFIK4a","level":3,"time":"2018-01-22T22:45:40+00:00","remoteAddr":"x.x.x.x",
"user":"--","app":"PHP","method":"GET","url":"\/nextcloud\/status.php","message":"fopen(\/var\/www\/localhost\/htdocs\/nextcloud\/config\/config.php): failed to open stream: Permission denied at \/var\/www\/localhost\/htdocs\/nextcloud\/lib\/private\/Config.php#240","userAgent":"Mozilla\/5.0 (Linux) mirall\/2.3.3 (Nextcloud)","version":""}
2018-01-22 22:45:40: (mod_fastcgi.c.2543) FastCGI-stderr: PHP message: {"reqId":"uzUA4itXhxCCbIjFIK4a","level":3,"time":"2018-01-22T22:45:40+00:00","remoteAddr":"x.x.x.x",
"user":"--","app":"PHP","method":"GET","url":"\/nextcloud\/status.php","message":"chmod(): Operation not permitted at \/var\/www\/localhost\/htdocs\/nextcloud\/lib\/private\/Config.php#243","userAgent":"Mozilla\/5.0 (Linux) mirall\/2.3.3 (Nextcloud)","version":""}
2018-01-22 22:45:40: (mod_fastcgi.c.2543) FastCGI-stderr: PHP message: {"reqId":"uzUA4itXhxCCbIjFIK4a","level":4,"time":"2018-01-22T22:45:40+00:00","remoteAddr":"x.x.x.x",
"user":"--","app":"remote","method":"GET","url":"\/nextcloud\/status.php","message":"Can't write into config directory!","userAgent":"Mozilla\/5.0 (Linux) mirall\/2.3.3 (Nextcloud)","version":""}
2018-01-22 22:45:40: (mod_fastcgi.c.2543) FastCGI-stderr: PHP message: {"reqId":"uzUA4itXhxCCbIjFIK4a","level":3,"time":"2018-01-22T22:45:40+00:00","remoteAddr":"x.x.x.x",
"user":"--","app":"PHP","method":"GET","url":"\/nextcloud\/status.php","message":"fopen(\/var\/www\/localhost\/htdocs\/nextcloud\/data\/nextcloud.log): failed to open stream: Permission denied at \/var\/www\/localhost\/htdocs\/nextcloud\/lib\/private\/Log\/File.php#132","userAgent":"Mozilla\/5.0 (Linux) mirall\/2.3.3 (Nextcloud)","version":""}


(I've replaced the ip address with x.x.x.x . This address is the IP of a client trying to connect in).

Maybe a permissions thing, or have I screwed up the connection to mysql somehow?

[Moderator edit: broke long whitespace-free lines in code tags to fix thread layout. -Hu]


Last edited by tabanus on Wed Jan 24, 2018 12:05 pm; edited 2 times in total
Back to top
View user's profile Send private message
toofied
n00b
n00b


Joined: 26 Oct 2016
Posts: 22

PostPosted: Tue Jan 23, 2018 1:04 am    Post subject: Re: Nextcloud internal server error Reply with quote

tabanus wrote:
I had Nextcloud working perfectly with lighttpd and mysql, but after a re-boot it's started to refuse connections.

The web interface says "Internal Server Error".


Permission errors, probably occurred after an update.

Relevant threads:
https://help.nextcloud.com/t/nc-12-stuck-in-upgrade-mode/18863
https://help.nextcloud.com/t/error-updating-to-11-0-3/11769
Back to top
View user's profile Send private message
tabanus
l33t
l33t


Joined: 11 Jun 2004
Posts: 626
Location: UK

PostPosted: Tue Jan 23, 2018 10:53 am    Post subject: Reply with quote

This is a new installation. Was fine until I re-booted.
_________________
Things you might say if you never took Physics: "I'm overweight even though I don't overeat." - Neil deGrasse Tyson
Back to top
View user's profile Send private message
tabanus
l33t
l33t


Joined: 11 Jun 2004
Posts: 626
Location: UK

PostPosted: Tue Jan 23, 2018 5:46 pm    Post subject: Reply with quote

I've isolated the problem to my mysql setup.

Found this in the Nextcloud log:

Code:
An exception occurred while executing 'DELETE FROM `oc_authtoken` WHERE `token` = ?' with params ["db1250623b74e1394098e5c8e1add8d2b2d1d27f0158ea9d75e3068dd6e1c76849723a49b337efa040abc4e4d37262088f82e3c38fe678f061b39c2d982a49ee"]: SQLSTATE[HY000]: General error: 1665 Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED.


I sorted this by logging into mysql and setting the binary log format to ROW, and everything works again.

I know I did this when I set up in the first place, so the question now is: how do I make this persist after a reboot?

The mysql website says

Quote:
You can select the binary logging format explicitly by starting the MySQL server with --binlog-format=type.


I can't see anything in the mysql config files to set this though.
Back to top
View user's profile Send private message
tabanus
l33t
l33t


Joined: 11 Jun 2004
Posts: 626
Location: UK

PostPosted: Wed Jan 24, 2018 12:04 pm    Post subject: Reply with quote

Finally sorted. For anyone else hitting this problem, solved by adding this line to the [mysqld] section of /etc/mysql/my.cnf

Code:
binlog-format                   = ROW


Thanks for your help everyone. :wink:
_________________
Things you might say if you never took Physics: "I'm overweight even though I don't overeat." - Neil deGrasse Tyson
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum