Error uploading file ... internal Server error

Ask all your questions regarding OC 9.0 Please read the Support Forum Rules
Forum rules
The forums were migrated over to https://central.owncloud.org which is based on the forum software Discourse. The forums here is put into read-only mode starting from today.

More background information about this move and the reasoning behind it is available in this blogpost:

https://daniel.molkentin.net/2016/07/20 ... d-central/
pedropt
Beginner
Posts: 45
Joined: Wed Dec 16, 2015 12:19 am
ownCloud version: 9.0.2
Webserver: nginx
Database: MySQL
OS: Linux
PHP version: 5.6.22

Error uploading file ... internal Server error

Postby pedropt » Tue Jul 12, 2016 11:41 pm

Owncloud Version 9.0.3
PHP : 5.6.22
OS : Debian 8 Jessie

I already checked out every config in PHP FPM and in owncloud config and everything is the way it should be , bu i still receive an error when i try to upload any file with a superior size than 1G !!!

When i start php5-fpm and nginx i get no errors , i go to owncloud admin to check logs and everything is clean .
Then i drop a file bigger than 1G to web interface to start the upload , in the end i receive the message that :

Code: Select all

Error uploading file "name of the file" Internal Server Error


When i go to log there is no errors .

Then i try using webdav interface to do the same operation and i am unable to upload any file also superior to 1G .
In the end of uploading using webdav (cyberduck) , i get the message :

Code: Select all

Upload "filename" failed , software caused connection abort:socket write error.The connection attempt was rejected. Server may be down , or your network may not be properly configured


and if i check the logs after this error , i still get nothing there to inform where is the issue .

my php.ini in FPM

Code: Select all

max_execution_time = 60
memory_limit = 512M
sys_temp_dir = "/media/f98e4c76-c05b-44e7-8ada-bce115197b6c/temp"
upload_tmp_dir = /media/f98e4c76-c05b-44e7-8ada-bce115197b6c/temp
upload_max_filesize = 16G


Then my pool.d i have my owncloud.conf file with this setting :

Code: Select all

[owncloud]
user = www-data
group = www-data

listen = /var/run/owncloud.sock
listen.owner = www-data
listen.group = www-data
listen.mode = 0600

pm = ondemand
pm.max_children = 25
pm.process_idle_timeout = 10s

chdir = /

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ownCloud php.ini settings ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; Paths and Directories
php_value[include_path] = ".:/usr/share/php:/var/www/owncloud"

; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
php_value[upload_max_filesize] = 16G

; Maximum size of POST data that PHP will accept.
; http://php.net/post-max-size
php_value[post_max_size] = 16G

; Do not expose to the world that PHP is installed on the server.
; http://php.net/expose-php
php_value[expose_php] = Off

; Name of the session (used as cookie name).
; http://php.net/session.name
php_value[session.name] = OWNCLOUDSESSID

; Default timeout for socket based streams (seconds)
; http://php.net/default-socket-timeout
php_value[default_socket_timeout] = 3600
; http://php.net/default-socket-timeout
php_value[default_socket_timeout] = 3600

; Maximum execution time of each script, in seconds
; http://php.net/max-execution-time
; Note: This directive is hardcoded to 0 for the CLI SAPI
php_value[max_execution_time] = 3600
php_value[max_input_time]= 3600

; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
; http://php.net/upload-tmp-dir
php_value[upload_tmp_dir] = /media/f98e4c76-c05b-44e7-8ada-bce115197b6c/temp/
env[PATH] = /usr/local/bin:/usr/bin:/bin


Anyone have some pointers for me to follow ?

RealRancor
ownCloud master
Posts: 17381
Joined: Sat May 26, 2012 3:00 pm
ownCloud version: 9.0.2
Webserver: nginx
Database: MySQL
OS: Linux
PHP version: 7.0.x

Re: Error uploading file ... internal Server error

Postby RealRancor » Wed Jul 13, 2016 5:33 am

Hi,

could you also try to enable logging in PHP:

https://davidwinter.me/enable-php-error-logging/

for fpm you might need to do additional stuff:

https://stackoverflow.com/questions/867 ... -error-log

An internal server error is just a generic error which contains no information if shown. But it definitely will be logged in one of your logfiles (nginx, php, owncloud.log).

Without the matching log entry to this error its nearly impossible to guess whats wrong here.
*gone*

pedropt
Beginner
Posts: 45
Joined: Wed Dec 16, 2015 12:19 am
ownCloud version: 9.0.2
Webserver: nginx
Database: MySQL
OS: Linux
PHP version: 5.6.22

Re: Error uploading file ... internal Server error

Postby pedropt » Wed Jul 13, 2016 9:48 am

thanks fro the reply .
Incredible as it may be , i did not get any errors yet on the log of php .
However , owncloud reported something in its log now :

Code: Select all

Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. at Unknown#0


The php.ini inside /php5/fpm have that configuration set that way by default , so no change was needed .

In php5/fpm/pool.d , my owncloud config did not had that setting , i am adding it there to to see what happens .

update :
adding that line in pool.d does not allow me to restart php5-fpm , so i remove it as it was before .

RealRancor
ownCloud master
Posts: 17381
Joined: Sat May 26, 2012 3:00 pm
ownCloud version: 9.0.2
Webserver: nginx
Database: MySQL
OS: Linux
PHP version: 7.0.x

Re: Error uploading file ... internal Server error

Postby RealRancor » Wed Jul 13, 2016 10:29 am

pedropt wrote:Incredible as it may be , i did not get any errors yet on the log of php


Thats really bad as it is not possible to know whats wrong without the logentry of the internal server error.
*gone*

pedropt
Beginner
Posts: 45
Joined: Wed Dec 16, 2015 12:19 am
ownCloud version: 9.0.2
Webserver: nginx
Database: MySQL
OS: Linux
PHP version: 5.6.22

Re: Error uploading file ... internal Server error

Postby pedropt » Wed Jul 13, 2016 10:49 am

i know how to fix this , but i am trying to avoid it .
Witch is reinstalling the OS from scratch again .

i start to have more errors when i installed php7 to get redis working , then i was unable to start redis because people usually on the web always complicate when they give tips .

No problem , i can fix this , i just remove the OS and install debian again , maybe this time i will install wheezy distro , instead jessie , i like wheezy more .

tflidd
Forum Moderator
Posts: 7159
Joined: Sat Dec 07, 2013 7:27 pm
ownCloud version: 8.2.3
Webserver: Apache
Database: MySQL
OS: Linux

Re: Error uploading file ... internal Server error

Postby tflidd » Wed Jul 13, 2016 4:11 pm

Wheezy is already end of life (I know there is kind of LTS support).

I use owncloud on debian jessie with php7 packages from dotdeb.org. It works quite well, they even provide the packages for redis and apcu. But I am using apache and mod_php. I have also tested raspbian (jessie-based) with OC 8.2 and 9.0 on nginx and php 5.6-fpm (normal debian packages). I can't report any major problem.

pedropt
Beginner
Posts: 45
Joined: Wed Dec 16, 2015 12:19 am
ownCloud version: 9.0.2
Webserver: nginx
Database: MySQL
OS: Linux
PHP version: 5.6.22

Re: Error uploading file ... internal Server error

Postby pedropt » Wed Jul 13, 2016 9:08 pm

Installed debian 7 , i like more this version .
Also installed owncloud 9.0.3 and upgraded php to 5.6.23 .
Now i got a error uploading , "file was partially uploaded" , in the past i solved this issue by giving more time to php to handle the job , but right now it is not working .
I also was watching on github related issues and none of them fixed this problem .
So right now what happens is :

if file upload => 1,2G then upload ok
if file upload < 1,2G then "Error uploading file , file was partially uploaded."

log say :

Code: Select all

Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. at Unknown#0


Update :
activated that line in php.ini under /etc/php5/fpm

Update 1
Uploading a 1.6G file under webdav gets in the end an error , but after a few minutes i refresh the folder where that file was uploaded and file is stored .

Uploading a 2.9G file under web interface got me an error of : "File partially uploaded"
log says : Error files Upload error: 3 - The uploaded file was only partially uploaded

Uploading same file under webdav connection , i get an error at the end and in log of owncloud i get this :

Code: Select all

Exception: {"Message":"HTTP\/1.1 400 expected filesize 3041926263 got 2147483647","Exception":"Sabre\\DAV\\Exception\\BadRequest","Code":0,"Trace":"#0 \/var\/www\/owncloud\/apps\/dav\/lib\/connector\/sabre\/directory.php(134): OCA\\DAV\\Connector\\Sabre\\File->put(Resource id #17)\n#1 \/var\/www\/owncloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(1036): OCA\\DAV\\Connector\\Sabre\\Directory->createFile('last.holly...', Resource id #17)\n#2 \/var\/www\/owncloud\/3rdparty\/sabre\/dav\/lib\/DAV\/CorePlugin.php(523): Sabre\\DAV\\Server->createFile('disk2\/videos\/last...', Resource id #17, NULL)\n#3 [internal function]: Sabre\\DAV\\CorePlugin->httpPut(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#4 \/var\/www\/owncloud\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\n#5 \/var\/www\/owncloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(459): Sabre\\Event\\EventEmitter->emit('method:PUT', Array)\n#6 \/var\/www\/owncloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(248): Sabre\\DAV\\Server->invokeMethod(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#7 \/var\/www\/owncloud\/apps\/dav\/appinfo\/v1\/webdav.php(55): Sabre\\DAV\\Server->exec()\n#8 \/var\/www\/owncloud\/remote.php(138): require_once('\/var\/www\/ownclo...')\n#9 {main}","File":"\/var\/www\/owncloud\/apps\/dav\/lib\/connector\/sabre\/file.php","Line":149,"User":"pedro"}


any tips ?

In mean while , searching on the web and i found this :
https://forum.owncloud.org/viewtopic.php?f=17&t=32517

- Changing output buffering to OFF in php.ini

doing some tests
Last edited by pedropt on Wed Jul 13, 2016 9:53 pm, edited 1 time in total.

RealRancor
ownCloud master
Posts: 17381
Joined: Sat May 26, 2012 3:00 pm
ownCloud version: 9.0.2
Webserver: nginx
Database: MySQL
OS: Linux
PHP version: 7.0.x

Re: Error uploading file ... internal Server error

Postby RealRancor » Wed Jul 13, 2016 9:52 pm

Unfortunately that "expected filesize" error has no single solution but we have tried to collect the known ones here:

viewtopic.php?f=17&t=32517
*gone*

pedropt
Beginner
Posts: 45
Joined: Wed Dec 16, 2015 12:19 am
ownCloud version: 9.0.2
Webserver: nginx
Database: MySQL
OS: Linux
PHP version: 5.6.22

Re: expected filesize xxx got yyy/0

Postby pedropt » Wed Jul 13, 2016 9:54 pm

Setting outputbuffer to OFF in php did not solve the issue for now .

how to add this setting from apache in nginx ?
SSLRenegBufferSize 10486000
Last edited by pedropt on Wed Jul 13, 2016 10:12 pm, edited 1 time in total.

RealRancor
ownCloud master
Posts: 17381
Joined: Sat May 26, 2012 3:00 pm
ownCloud version: 9.0.2
Webserver: nginx
Database: MySQL
OS: Linux
PHP version: 7.0.x

Re: expected filesize xxx got yyy/0

Postby RealRancor » Wed Jul 13, 2016 9:59 pm

If that is known it should have been added there. So this is something you probably should ask at:

http://nginx.org/en/support.html

if there is a similar setting in nginx.
*gone*


  • Similar Topics
    Replies
    Views
    Last post

Return to “ownCloud Server 9.0”

Who is online

Users browsing this forum: No registered users and 1 guest