text file truncated via SMB share
I have an odd problem with a linux txt file. I accessed this via the built-in text editor in owncloud. It resides on an SMB share The file is 588 lines but owncloud only shows 288 lines. What's worse is when I made an edit it saved the truncated file.
Same file does not do this in the native owncloud area.
Are you using encryption ?
Can you please use the issue template https://raw.github.com/owncloud/core/master/issue_template.md ? Would be good to see if there is something in the log. (and also know what version you are using)
No encryption
Steps to reproduce
- mount an smb share
- open a text file on that share in owncloud
- save it
Expected behaviour
See the whole file edit and save the whole file
Actual behaviour
Got 288 lines of 588 and only saved 288 lines
Server configuration
Operating system: Ubuntu 12.04.4 LTS
Web server: Apache2
Database: mysql 5.5.35 PHP version: 5.3.10-1ubuntu3.9 ownCloud version: (see ownCloud admin page) 6.0.2
Updated from an older ownCloud or fresh install: Updated
List of activated apps: Activity Contacts Deleted files Documents External Storage First Run Wiz, Full text search, LDAP user and group PDF VIewer Pictures Share Files, Text Editor, Updater, Versions, Video Viewer The content of config/config.php:
<?php
$CONFIG = array (
'instanceid' => 'oc24e5689b8d',
'passwordsalt' => '*** Removed for security reasons',
'datadirectory' => '/var/www/owncloud/data',
'dbtype' => 'mysql',
'version' => '6.0.2.2',
'dbname' => 'owncloud',
'dbhost' => 'localhost',
'dbtableprefix' => 'oc_',
'dbuser' => 'owncloud',
'dbpassword' => '',
'installed' => true,
'ldapIgnoreNamingRules' => false,
'loglevel' => '0',
'forcessl' => false,
'theme' => '',
'maintenance' => false,
);
Are you using external storage, if yes which one: local/smb/sftp/... SMB Are you using encryption: yes/no NO
Client configuration
Browser: Firefox/Safari Operating system: OSX
Logs
Web server error log
Insert your webserver log here
error_log:
[Thu Mar 27 13:23:31 2014] [error] [client 10.10.0.15] client denied by server configuration: /var/www/owncloud/data/htaccesstest.txt
[Thu Mar 27 13:23:31 2014] [error] [client 10.10.0.15] File does not exist: /var/www/core
[Thu Mar 27 13:28:44 2014] [error] [client 10.10.0.15] client denied by server configuration: /var/www/owncloud/data/htaccesstest.txt
[Thu Mar 27 13:28:44 2014] [error] [client 10.10.0.15] File does not exist: /var/www/core
sh: 1: rsvg-convert: not found
access_log:
10.10.0.85 - - [27/Mar/2014:13:33:46 -0400] "GET /owncloud/index.php/apps/files HTTP/1.1" 200 4289 "http://cluster.pcc.com/owncloud/index.php/apps/files?dir=/tom" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.74.9 (KHTML, like Gecko) Version/7.0.2 Safari/537.74.9"
10.10.0.85 - - [27/Mar/2014:13:33:46 -0400] "GET /owncloud/remote.php/core.css?v=da54dd5a0398011cdfa50d559c2c0ef8 HTTP/1.1" 304 238 "http://cluster.pcc.com/owncloud/index.php/apps/files?dir=/tom" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.74.9 (KHTML, like Gecko) Version/7.0.2 Safari/537.74.9"
10.10.0.85 - - [27/Mar/2014:13:33:46 -0400] "GET /owncloud/index.php/apps/files/css/files.css?v=da54dd5a0398011cdfa50d559c2c0ef8 HTTP/1.1" 304 239 "http://cluster.pcc.com/owncloud/index.php/apps/files?dir=/tom" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.74.9 (KHTML, like Gecko) Version/7.0.2 Safari/537.74.9"
10.10.0.85 - - [27/Mar/2014:13:33:46 -0400] "GET /owncloud/index.php/apps/files/css/upload.css?v=da54dd5a0398011cdfa50d559c2c0ef8 HTTP/1.1" 304 239 "http://cluster.pcc.com/owncloud/index.php/apps/files?dir=/tom" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.74.9 (KHTML, like Gecko) Version/7.0.2 Safari/537.74.9"
10.10.0.85 - - [27/Mar/2014:13:33:46 -0400] "GET /owncloud/index.php/core/js/config.js?v=da54dd5a0398011cdfa50d559c2c0ef8 HTTP/1.1" 200 1443 "http://cluster.pcc.com/owncloud/index.php/apps/files" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.74.9 (KHTML, like Gecko) Version/7.0.2 Safari/537.74.9"
10.10.0.85 - - [27/Mar/2014:13:33:46 -0400] "GET /owncloud/remote.php/core.js?v=da54dd5a0398011cdfa50d559c2c0ef8 HTTP/1.1" 304 239 "http://cluster.pcc.com/owncloud/index.php/apps/files?dir=/tom" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.74.9 (KHTML, like Gecko) Version/7.0.2 Safari/537.74.9"
10.10.0.85 - - [27/Mar/2014:13:33:47 -0400] "GET /owncloud/index.php/core/routes.json HTTP/1.1" 304 238 "http://cluster.pcc.com/owncloud/index.php/apps/files?dir=/tom" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.74.9 (KHTML, like Gecko) Version/7.0.2 Safari/537.74.9"
10.10.0.85 - - [27/Mar/2014:13:33:47 -0400] "GET /owncloud/cron.php HTTP/1.1" 200 437 "http://cluster.pcc.com/owncloud/index.php/apps/files" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.74.9 (KHTML, like Gecko) Version/7.0.2 Safari/537.74.9"
10.10.0.85 - - [27/Mar/2014:13:33:47 -0400] "POST /owncloud/index.php/apps/documents/ajax/mimes.php HTTP/1.1" 200 448 "http://cluster.pcc.com/owncloud/index.php/apps/files" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.74.9 (KHTML, like Gecko) Version/7.0.2 Safari/537.74.9"
10.10.0.85 - - [27/Mar/2014:13:33:47 -0400] "POST /owncloud/index.php/core/ajax/translations.php HTTP/1.1" 200 492 "http://cluster.pcc.com/owncloud/index.php/apps/files" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.74.9 (KHTML, like Gecko) Version/7.0.2 Safari/537.74.9"
10.10.0.85 - - [27/Mar/2014:13:33:47 -0400] "POST /owncloud/index.php/core/ajax/translations.php HTTP/1.1" 200 492 "http://cluster.pcc.com/owncloud/index.php/apps/files" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.74.9 (KHTML, like Gecko) Version/7.0.2 Safari/537.74.9"
10.10.0.85 - - [27/Mar/2014:13:33:47 -0400] "GET /owncloud/index.php/core/ajax/share.php?fetch=getItemsSharedStatuses&itemType=file HTTP/1.1" 200 447 "http://cluster.pcc.com/owncloud/index.php/apps/files" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.74.9 (KHTML, like Gecko) Version/7.0.2 Safari/537.74.9"
10.10.0.85 - - [27/Mar/2014:13:33:47 -0400] "GET /owncloud/index.php/avatar/1a644ec2-e5f4-102c-84a2-c0e47d519f65/32?requesttoken=298d1433b84679d49a97 HTTP/1.1" 200 470 "http://cluster.pcc.com/owncloud/index.php/apps/files?dir=/tom" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.74.9 (KHTML, like Gecko) Version/7.0.2 Safari/537.74.9"
10.10.0.85 - - [27/Mar/2014:13:33:47 -0400] "GET /owncloud/index.php/avatar/1a644ec2-e5f4-102c-84a2-c0e47d519f65/128?requesttoken=298d1433b84679d49a97 HTTP/1.1" 200 470 "http://cluster.pcc.com/owncloud/index.php/apps/files?dir=/tom" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.74.9 (KHTML, like Gecko) Version/7.0.2 Safari/537.74.9"
10.10.0.85 - - [27/Mar/2014:13:33:47 -0400] "POST /owncloud/index.php/core/ajax/translations.php HTTP/1.1" 200 492 "http://cluster.pcc.com/owncloud/index.php/apps/files" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.74.9 (KHTML, like Gecko) Version/7.0.2 Safari/537.74.9"
10.10.0.85 - - [27/Mar/2014:13:33:47 -0400] "GET /owncloud/index.php/apps/files/ajax/scan.php?force=false&dir=&requesttoken=298d1433b84679d49a97 HTTP/1.1" 200 461 "http://cluster.pcc.com/owncloud/index.php/apps/files" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.74.9 (KHTML, like Gecko) Version/7.0.2 Safari/537.74.9"
10.10.0.85 - - [27/Mar/2014:13:33:48 -0400] "GET /owncloud/index.php/apps/files/ajax/getstoragestats.php?dir=%2F HTTP/1.1" 200 538 "http://cluster.pcc.com/owncloud/index.php/apps/files" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.74.9 (KHTML, like Gecko) Version/7.0.2 Safari/537.74.9"
#### ownCloud log (data/owncloud.log)
{"app":"PHP","message":"json_encode(): Invalid UTF-8 sequence in argument at \/var\/www\/owncloud\/lib\/private\/log\/owncloud.php#73","level":3,"time":"2014-03-27T17:32:32+00:00"}
{"app":"core","message":null,"level":0,"time":"2014-03-27T17:32:32+00:00"}
{"app":"core","message":"OC_Image->loadFromBase64, couldn't load","level":0,"time":"2014-03-27T17:32:32+00:00"}
{"app":"core","message":"OC_Image->fixOrientation() No readable file path set.","level":0,"time":"2014-03-27T17:32:32+00:00"}
{"app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2014-03-27T17:32:32+00:00"}
{"app":"PHP","message":"json_encode(): Invalid UTF-8 sequence in argument at \/var\/www\/owncloud\/lib\/private\/log\/owncloud.php#73","level":3,"time":"2014-03-27T17:32:32+00:00"}
{"app":"core","message":null,"level":0,"time":"2014-03-27T17:32:32+00:00"}
{"app":"core","message":"OC_Image->loadFromBase64, couldn't load","level":0,"time":"2014-03-27T17:32:32+00:00"}
{"app":"core","message":"OC_Image->fixOrientation() No readable file path set.","level":0,"time":"2014-03-27T17:32:32+00:00"}
{"app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2014-03-27T17:32:32+00:00"}
{"app":"PHP","message":"json_encode(): Invalid UTF-8 sequence in argument at \/var\/www\/owncloud\/lib\/private\/log\/owncloud.php#73","level":3,"time":"2014-03-27T17:32:32+00:00"}
{"app":"core","message":null,"level":0,"time":"2014-03-27T17:32:32+00:00"}
{"app":"core","message":"OC_Image->fixOrientation() No readable file path set.","level":0,"time":"2014-03-27T17:32:32+00:00"}
{"app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2014-03-27T17:32:32+00:00"}
{"app":"PHP","message":"json_encode(): Invalid UTF-8 sequence in argument at \/var\/www\/owncloud\/lib\/private\/log\/owncloud.php#73","level":3,"time":"2014-03-27T17:32:32+00:00"}
{"app":"core","message":null,"level":0,"time":"2014-03-27T17:32:32+00:00"}
{"app":"core","message":"OC_Image->fixOrientation() No readable file path set.","level":0,"time":"2014-03-27T17:32:32+00:00"}
{"app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2014-03-27T17:32:32+00:00"}
{"app":"PHP","message":"json_encode(): Invalid UTF-8 sequence in argument at \/var\/www\/owncloud\/lib\/private\/log\/owncloud.php#73","level":3,"time":"2014-03-27T17:32:32+00:00"}
{"app":"core","message":null,"level":0,"time":"2014-03-27T17:32:32+00:00"}
{"app":"core","message":"OC_Image->loadFromBase64, couldn't load","level":0,"time":"2014-03-27T17:32:32+00:00"}
{"app":"core","message":"OC_Image->fixOrientation() No readable file path set.","level":0,"time":"2014-03-27T17:32:32+00:00"}
{"app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2014-03-27T17:32:32+00:00"}
{"app":"core","message":"Generating preview for \"\/tom\/Fax00000058.TIF\" with \"OC\\Preview\\Image\"","level":0,"time":"2014-03-27T17:32:47+00:00"}
{"app":"PHP","message":"file_get_contents(\/var\/www\/owncloud\/data\/1a644ec2-e5f4-102c-84a2-c0e47d519f65\/files\/tmp\/c7455c9b1a39638d25707908f3d5924a.TIF): failed to open stream: No such file or directory at \/var\/www\/owncloud\/lib\/private\/files\/storage\/local.php#150","level":3,"time":"2014-03-27T17:32:47+00:00"}
{"app":"PHP","message":"imagecreatefromstring(): Empty string or invalid image at \/var\/www\/owncloud\/lib\/private\/image.php#499","level":3,"time":"2014-03-27T17:32:47+00:00"}
{"app":"core","message":"OC_Image->loadFromFile, Default","level":0,"time":"2014-03-27T17:32:47+00:00"}
{"app":"core","message":"Generating preview for \"\/tom\/Fax00000058.TIF\" with \"OC\\Preview\\Unknown\"","level":0,"time":"2014-03-27T17:32:47+00:00"}
{"app":"core","message":"unable to open file `\/tmp\/magick-sVIFJVmw': @ error\/constitute.c\/ReadImage\/571","level":0,"time":"2014-03-27T17:32:47+00:00"}
#### Browser log
Insert your browser log here, this could for example include:
a) The javascript console log b) The network log c) ...
Just tried it and indeed, the file is truncated at line 215 in the embedded text editor.
But if I download the file using the download action, the file appears complete.
It only happens on SMB, on the local storage it works fine.
I'll debug this in the file_get_contents function and see what happens.
Looks it's this issue: https://bugs.php.net/bug.php?id=30936 @icewind1991 seems we'll need to use a loop in "file_get_contents()" when a file is bigger than 8192 bytes. This might happen for all stream wrappers, which means "quota" and other external storages might be affected :frowning:
I'll prepare a PR with a loop that reads until we got all data.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.