Trouble migrating ownCloud to a new server

php
help
webserver_issue

#1

Template

Please help us by providing the following info. Before posting please also check the pinned "Known issues" threads and make sure that you're running the latest available version for your oC release: https://owncloud.org/changelog/

Steps to reproduce
1. n/a
2.
3.

Expected behaviour
ownCloud should work, or at least complain about what doesn't work

Actual behaviour
It locks up, uses 100% of one CPU, and then eventually I get a 504 Gateway Time-out from NginX

Server configuration
Operating system: Ubuntu Server 16.04 (was Ubuntu Server 15.10)
Web server: NginX + PHP7.1-FPM (was NginX + PHP7.0-FPM)
Database: SQLite
PHP version: 7.1.0beta2
ownCloud version (see ownCloud admin page): One patch from the latest version I think (can't check obviously)
Updated from an older ownCloud or fresh install: not during this migration process
ownCloud log (data/owncloud.log, see https://central.owncloud.org/t/how-to-find-webserver-or-oc-logfile-enable-php-logfile/808):

Nothing new

Special configuration (external storage, external authentication, reverse proxy, server-side-encryption): Reverse proxy: Nginx sits in front of PHP7.1-FPM.

Integrity status for oC9+

Sorry, can't check this.

Login as admin user into your ownCloud and access
http://example.com/index.php/settings/integrity/failed
paste the results here.

Actual post

I'm performing a server migration, and while I've been moving ownCloud I've hit upon a snag. After setting up NginX and PHP7.1-FPM and moving across the NginX and PHP FPM config files, ownCloud now locks up, uses 100% of one of my CPUs, and times out eventually.

Can anyone help me please?

Thanks.


#2

The current php-packages on Ubuntu 16.04 are 7.0.8-0ubuntu0.16.04.2. Did you even install php7 from external sources? Does your php run (put a test script with <?php phpinfo(); ?> in your DocumentRoot).

Gateway timeout could indicate a general php settings error, or an error between nginx<->php. Please enable php-logging (see you php.ini-files) and you webserver logs for more details.


#3

Yes, before reporting such issues make sure that you're running a stable release of PHP. No one can guarantee that this is not a bug in the beta PHP release...

THIS IS A DEVELOPMENT PREVIEW - DO NOT USE IT IN PRODUCTION!

http://php.net/archive/2016.php#id2016-08-04-1


#4

Here's the apt sources line I'm using:

deb http://ppa.launchpad.net/ondrej/php/ubuntu xenial main

I didn't even realise that PHP 7.1 is still in beta. I tried a test script, and it's working perfectly (see it here: https://owncloud.starbeamrainbowlabs.com/test.php).

I have error logging enabled already.

Here's a snippet from /var/log/php7.1-fpm.log:

[13-Aug-2016 12:40:20] NOTICE: fpm is running, pid 10754
[13-Aug-2016 12:40:20] NOTICE: ready to handle connections
[13-Aug-2016 12:40:20] NOTICE: systemd monitor interval set to 10000ms
[13-Aug-2016 12:42:33] WARNING: [pool www] child 10760, script '/srv/owncloud/index.php' (request: "GET /index.php") execution timed out (101.401888 sec), terminating
[13-Aug-2016 12:42:33] WARNING: [pool www] child 10756, script '/srv/owncloud/index.php' (request: "GET /index.php") execution timed out (105.732425 sec), terminating
[13-Aug-2016 12:42:33] WARNING: [pool www] child 10755, script '/srv/owncloud/index.php' (request: "GET ") execution timed out (111.172861 sec), terminating
[13-Aug-2016 12:43:06] WARNING: [pool www] child 10761, script '/srv/owncloud/index.php' (request: "GET /index.php") execution timed out (127.502038 sec), terminating
[13-Aug-2016 12:43:06] WARNING: [pool www] child 10760, script '/srv/owncloud/index.php' (request: "GET /index.php") execution timed out (134.735091 sec), terminating
[13-Aug-2016 12:43:06] WARNING: [pool www] child 10756, script '/srv/owncloud/index.php' (request: "GET /index.php") execution timed out (139.065628 sec), terminating
[13-Aug-2016 12:43:06] WARNING: [pool www] child 10755, script '/srv/owncloud/index.php' (request: "GET ") execution timed out (144.506064 sec), terminating

I seem to remember I've had this issue before, but I can't remember what I did to fix it.


#5

Please downgrade to PHP 7.0.8/7.0.9 as no support for beta versions of PHP can be given here.


#6

Why don't you use the original ubuntu packages? If you want to use beta-packages, you should do this on a test system.


#7

I'll try downgrading and report back.


#8

I've downgraded and I'm still getting a 504 Gateway Time-out. Here's my new system information:

PHP Version: PHP Version 7.0.9-1+deb.sury.org~xenial+1
PHP Info URL: https://owncloud.starbeamrainbowlabs.com/test.php
php7.0 -m: https://starbeamrainbowlabs.com/bin/prud


#9

Ok, then you can start debugging your webserver config / PHP setup by following tutorials like:

https://www.scalescale.com/tips/nginx/504-gateway-time-out-using-nginx/


#10

Umm all the config files I'm using are identical to the ones I used on the previous server. I don't understand why raising the max execution time on this (better and faster) server would solve the problem, as I didn't need to do it on the old server (I think it's set to about 60 seconds currently).


#11

Ok so raising one of those timeouts solved the problem. But why? The page took nowhere near that amount of time to load, so it really should have caused an issue. I'm rather worried now.


#12

You could use tools such as blackfire to analyze which part of the code is responsible for the delay. You might want to contact a developer if you need help.

Judging on your configuration, the use of a real database and a filecache (Redis/APCU) do improve the overall performance considerably.


#14

Please create a new thread for the reasons explained here:


#15

Sorry! I didn't see that post. I'll delete the above and make a new post.


Can't upgrade ownCloud using the web interface
#16

No need to say sorry, you can't know every single post here :slight_smile:

To partly answer this question:

Ok so raising one of those timeouts solved the problem. But why? The page took nowhere near that amount of time to load, so it really should have caused an issue. I'm rather worried now.

You probably only moved the nginx and php configs. However there could be a lot of other components in between (down to the kernel) which could cause such issues. As the migration was done between two releases (15.10 to 16.04) different defaults could be also responsible.


#17

The kernel being the issue sounds very plausible! I had a rubbish kernel that I couldn't change on my old VPS. For giggles, here's uname -a:

Linux starbeamrainbowlabs.com 2.6.32-042stab111.12 #1 SMP Thu Sep 17 11:38:20 MSK 2015 x86_64 x86_64 x86_64 GNU/Linux