External FTP storage doesn't work with encryption enabled #22286

Closed
DecaTec opened this Issue Feb 10, 2016 · 23 comments

Projects

None yet

8 participants

@DecaTec
DecaTec commented Feb 10, 2016

Steps to reproduce

  1. Enable encryption
  2. Mount FTP as external storage
  3. Upload a file to that external FTP storage (e.g. JPG)

Expected behaviour

The file gets uploaded and is shown with a preview thumbnail (as it's an image). By clicking on it, it should be shown as large version.

Actual behaviour

The file gets uploaded, but no preview is shown. When trying to open the image, only an error message is shown that this file cannot be openend. Also trying to download the file will result in an unreadable file.

Whatever I try, I can't get this to work. Also I can't see anything in the logs which points me in the right direction. The only strange thing are the many error messages about "stream does not support seeking" while the file gets uploaded.

When encryption is disabled for that external storage, everything works as expected.

When using another external storage provider (tested with Google drive), everything works as expected (even with encryption enabled).

Server configuration

Operating system:
Ubuntu server 15.10

Web server:
nginx 1.9.10

Database:
MariaDB 10.0

PHP version:
PHP 5.6

ownCloud version: (see ownCloud admin page)
8.2.2

Updated from an older ownCloud or fresh install:
Updated (initial install was 8.1)

List of activated apps:

Enabled:
  - activity: 2.1.3
  - calendar: 0.8.1
  - contacts: 0.5.0.0
  - encryption: 1.1.0
  - files: 1.2.0
  - files_external: 0.3.0
  - files_pdfviewer: 0.7
  - files_sharing: 0.7.0
  - files_texteditor: 2.0
  - files_trashbin: 0.7.0
  - files_versions: 1.1.0
  - files_videoviewer: 0.1.3
  - firstrunwizard: 1.1
  - gallery: 14.2.0
  - provisioning_api: 0.3.0
  - templateeditor: 0.1
  - updater: 0.6
Disabled:
  - external
  - files_locking
  - notifications
  - user_external
  - user_ldap
  - user_webdavauth

The content of config/config.php:

{
    "system": {
        "instanceid": "oc8f6ktkdj2x",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "111.111.111.111",
            "mycloud.de"
        ],
        "datadirectory": "\/var\/owncloud_data",
        "dbtype": "mysql",
        "version": "8.2.2.2",
        "dbname": "owncloud",
        "dbhost": "localhost",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "Europe\/Berlin",
        "installed": true,
        "memcache.local": "\\OC\\Memcache\\APCu",       
        "theme": "",
        "maintenance": false,
        "loglevel": 3,
        "trashbin_retention_obligation": "auto",
        "filelocking.enabled": "true",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "\/var\/run\/redis\/redis.sock",
            "port": 0,
            "timeout": 0
        }
    }
}

Are you using external storage, if yes which one:
Yes, FTP (option "Secure ftps://" disabled)

Are you using encryption:
Yes

Are you using an external user-backend, if yes which one:
No

Client configuration

Browser:
Doesn't matter (Chrome, Firefox, IE...)

Operating system:
Windows 10

Logs

Web server error log

nginx error.log:

2016/02/10 09:55:12 [notice] 1589#1589: using inherited sockets from "6;7;8;"
2016/02/10 11:23:01 [warn] 846#846: no resolver defined to resolve ocsp.int-x1.letsencrypt.org while requesting certificate status, responder: ocsp.int-x1.letsencrypt.org
2016/02/10 11:25:45 [warn] 850#850: no resolver defined to resolve ocsp.int-x1.letsencrypt.org while requesting certificate status, responder: ocsp.int-x1.letsencrypt.org
2016/02/10 11:26:49 [warn] 847#847: no resolver defined to resolve ocsp.int-x1.letsencrypt.org while requesting certificate status, responder: ocsp.int-x1.letsencrypt.org
2016/02/10 11:41:02 [warn] 847#847: *86 a client request body is buffered to a temporary file /var/cache/nginx/client_temp/0000000001, client: 111.111.111.111, server: mycloud.de, request: "POST /owncloud/index.php/apps/files/ajax/upload.php HTTP/2.0", host: "mycloud.de"
2016/02/10 12:14:21 [error] 847#847: *268 access forbidden by rule, client: 111.111.111.111, server: mycloud.de, request: "GET /owncloud/data/htaccesstest.txt HTTP/1.1", host: "mycloud.de"
2016/02/10 12:15:15 [error] 847#847: *287 access forbidden by rule, client: 111.111.111.111, server: mycloud.de, request: "GET /owncloud/data/htaccesstest.txt HTTP/1.1", host: "mycloud.de"
2016/02/10 12:15:40 [warn] 847#847: *243 a client request body is buffered to a temporary file /var/cache/nginx/client_temp/0000000002, client: 111.111.111.111, server: mycloud.de, request: "POST /owncloud/index.php/apps/files/ajax/upload.php HTTP/2.0", host: "mycloud.de"
2016/02/10 12:16:00 [error] 847#847: *314 access forbidden by rule, client: 111.111.111.111, server: mycloud.de, request: "GET /owncloud/data/htaccesstest.txt HTTP/1.1", host: "mycloud.de"
2016/02/10 12:20:34 [error] 847#847: *329 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 111.111.111.111, server: mycloud.de, request: "GET /owncloud/index.php/apps/gallery/preview/4043?width=2000&height=2000&c=56bb1be5c76bb&requesttoken=YyoHShs1bGYaUCMZfzogdWsIEipHQzACOSIrMA0R%3A0sIelgX5o7Uo0NtG2KAhr6RMAWhQKF HTTP/2.0", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "mycloud.de"

ownCloud log (data/owncloud.log)

{"reqId":"JTvwHwK9qSfCdb1Hy4Km","remoteAddr":"111.111.111.111","app":"PHP","message":"Array to string conversion at \/var\/www\/public\/owncloud\/lib\/private\/template\/functions.php#36","level":3,"time":"2016-02-10T12:14:16+01:00"}
{"reqId":"mnyfeerO\/LJyk4hFW82p","remoteAddr":"111.111.111.111","app":"PHP","message":"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","level":3,"time":"2016-02-10T12:15:07+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files_external\/userstorages"}
{"reqId":"bwLxXLmTS6EM6nVdAWGB","remoteAddr":"111.111.111.111","app":"PHP","message":"Array to string conversion at \/var\/www\/public\/owncloud\/lib\/private\/template\/functions.php#36","level":3,"time":"2016-02-10T12:15:10+01:00","method":"GET","url":"\/owncloud\/index.php\/settings\/admin"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:46+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:46+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:46+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:46+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:46+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:46+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:46+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:46+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:46+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:46+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:46+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:46+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:46+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:46+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:46+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:46+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:46+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:47+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:47+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:47+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:47+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:47+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:47+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:47+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:47+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:47+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:47+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:47+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:47+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:47+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:47+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:47+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:47+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:47+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:47+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:47+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:47+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:47+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:47+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:47+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:47+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:47+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:47+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:47+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"+CPKtMmeDyN+l9aqkxnX","remoteAddr":"111.111.111.111","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-10T12:15:47+01:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"UaxGdpf3V1fI6oxdouwO","remoteAddr":"111.111.111.111","app":"core","message":"Generating preview for \"\/FTP\/vvv.jpg\" with \"OC\\Preview\\JPEG\"","level":0,"time":"2016-02-10T12:15:52+01:00","method":"GET","url":"\/owncloud\/index.php\/core\/preview.png?file=%2FFTP%2Fvvv.jpg&c=56bb1be5c76bb&x=48&y=48&forceIcon=0"}
{"reqId":"UaxGdpf3V1fI6oxdouwO","remoteAddr":"111.111.111.111","app":"PHP","message":"fclose(): FTP server error 426:426 Transfer aborted. Data connection closed\r\n at \/var\/www\/public\/owncloud\/lib\/private\/files\/storage\/wrapper\/encryption.php#637","level":3,"time":"2016-02-10T12:15:53+01:00","method":"GET","url":"\/owncloud\/index.php\/core\/preview.png?file=%2FFTP%2Fvvv.jpg&c=56bb1be5c76bb&x=48&y=48&forceIcon=0"}
{"reqId":"UaxGdpf3V1fI6oxdouwO","remoteAddr":"111.111.111.111","app":"PHP","message":"fclose(): FTP server error 426:426 Transfer aborted. Data connection closed\r\n at \/var\/www\/public\/owncloud\/lib\/private\/files\/storage\/wrapper\/encryption.php#637","level":3,"time":"2016-02-10T12:15:54+01:00","method":"GET","url":"\/owncloud\/index.php\/core\/preview.png?file=%2FFTP%2Fvvv.jpg&c=56bb1be5c76bb&x=48&y=48&forceIcon=0"}
{"reqId":"UaxGdpf3V1fI6oxdouwO","remoteAddr":"111.111.111.111","app":"PHP","message":"fclose(): FTP server error 426:426 Transfer aborted. Data connection closed\r\n at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#108","level":3,"time":"2016-02-10T12:15:55+01:00","method":"GET","url":"\/owncloud\/index.php\/core\/preview.png?file=%2FFTP%2Fvvv.jpg&c=56bb1be5c76bb&x=48&y=48&forceIcon=0"}
{"reqId":"+mQRnG0JjXdA+pVuuzfO","remoteAddr":"111.111.111.111","app":"PHP","message":"Array to string conversion at \/var\/www\/public\/owncloud\/lib\/private\/template\/functions.php#36","level":3,"time":"2016-02-10T12:15:56+01:00","method":"GET","url":"\/owncloud\/index.php\/settings\/admin"}
{"reqId":"oH1qFPo8RPJeXSdRka9j","remoteAddr":"111.111.111.111","app":"core","message":"Generating preview for \"\/FTP\/vvv.jpg\" with \"OC\\Preview\\JPEG\"","level":0,"time":"2016-02-10T12:20:30+01:00","method":"GET","url":"\/owncloud\/index.php\/core\/preview.png?file=%2FFTP%2Fvvv.jpg&c=56bb1be5c76bb&x=48&y=48&forceIcon=0"}
{"reqId":"oH1qFPo8RPJeXSdRka9j","remoteAddr":"111.111.111.111","app":"PHP","message":"fclose(): FTP server error 426:426 Transfer aborted. Data connection closed\r\n at \/var\/www\/public\/owncloud\/lib\/private\/files\/storage\/wrapper\/encryption.php#637","level":3,"time":"2016-02-10T12:20:31+01:00","method":"GET","url":"\/owncloud\/index.php\/core\/preview.png?file=%2FFTP%2Fvvv.jpg&c=56bb1be5c76bb&x=48&y=48&forceIcon=0"}
{"reqId":"1p9JvnUltkYCC9pWL2RO","remoteAddr":"111.111.111.111","app":"core","message":"Generating preview for \"FTP\/vvv.jpg\" with \"OC\\Preview\\JPEG\"","level":0,"time":"2016-02-10T12:20:32+01:00","method":"GET","url":"\/owncloud\/index.php\/apps\/gallery\/preview\/4043?width=2000&height=2000&c=56bb1be5c76bb&requesttoken=YyoHShs1bGYaUCMZfzogdWsIEipHQzACOSIrMA0R%3A0sIelgX5o7Uo0NtG2KAhr6RMAWhQKF"}
{"reqId":"oH1qFPo8RPJeXSdRka9j","remoteAddr":"111.111.111.111","app":"PHP","message":"fclose(): FTP server error 426:426 Transfer aborted. Data connection closed\r\n at \/var\/www\/public\/owncloud\/lib\/private\/files\/storage\/wrapper\/encryption.php#637","level":3,"time":"2016-02-10T12:20:32+01:00","method":"GET","url":"\/owncloud\/index.php\/core\/preview.png?file=%2FFTP%2Fvvv.jpg&c=56bb1be5c76bb&x=48&y=48&forceIcon=0"}
{"reqId":"1p9JvnUltkYCC9pWL2RO","remoteAddr":"111.111.111.111","app":"PHP","message":"fclose(): FTP server error 426:426 Transfer aborted. Data connection closed\r\n at \/var\/www\/public\/owncloud\/lib\/private\/files\/storage\/wrapper\/encryption.php#637","level":3,"time":"2016-02-10T12:20:32+01:00","method":"GET","url":"\/owncloud\/index.php\/apps\/gallery\/preview\/4043?width=2000&height=2000&c=56bb1be5c76bb&requesttoken=YyoHShs1bGYaUCMZfzogdWsIEipHQzACOSIrMA0R%3A0sIelgX5o7Uo0NtG2KAhr6RMAWhQKF"}
{"reqId":"oH1qFPo8RPJeXSdRka9j","remoteAddr":"111.111.111.111","app":"PHP","message":"fclose(): FTP server error 426:426 Transfer aborted. Data connection closed\r\n at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#108","level":3,"time":"2016-02-10T12:20:33+01:00","method":"GET","url":"\/owncloud\/index.php\/core\/preview.png?file=%2FFTP%2Fvvv.jpg&c=56bb1be5c76bb&x=48&y=48&forceIcon=0"}
{"reqId":"1p9JvnUltkYCC9pWL2RO","remoteAddr":"111.111.111.111","app":"PHP","message":"fclose(): FTP server error 426:426 Transfer aborted. Data connection closed\r\n at \/var\/www\/public\/owncloud\/lib\/private\/files\/storage\/wrapper\/encryption.php#637","level":3,"time":"2016-02-10T12:20:33+01:00","method":"GET","url":"\/owncloud\/index.php\/apps\/gallery\/preview\/4043?width=2000&height=2000&c=56bb1be5c76bb&requesttoken=YyoHShs1bGYaUCMZfzogdWsIEipHQzACOSIrMA0R%3A0sIelgX5o7Uo0NtG2KAhr6RMAWhQKF"}
{"reqId":"1p9JvnUltkYCC9pWL2RO","remoteAddr":"111.111.111.111","app":"gallery","message":"Exception: Preview generation has failed","level":3,"time":"2016-02-10T12:20:34+01:00","method":"GET","url":"\/owncloud\/index.php\/apps\/gallery\/preview\/4043?width=2000&height=2000&c=56bb1be5c76bb&requesttoken=YyoHShs1bGYaUCMZfzogdWsIEipHQzACOSIrMA0R%3A0sIelgX5o7Uo0NtG2KAhr6RMAWhQKF"}
{"reqId":"O8V6N08ADEZQGD0ImTuX","remoteAddr":"111.111.111.111","app":"core","message":"Generating preview for \"\/FTP\/vvv.jpg\" with \"OC\\Preview\\JPEG\"","level":0,"time":"2016-02-10T12:20:36+01:00","method":"GET","url":"\/owncloud\/index.php\/core\/preview.png?file=%2FFTP%2Fvvv.jpg&c=56bb1be5c76bb&x=48&y=48&forceIcon=0"}
{"reqId":"O8V6N08ADEZQGD0ImTuX","remoteAddr":"111.111.111.111","app":"PHP","message":"fclose(): FTP server error 426:426 Transfer aborted. Data connection closed\r\n at \/var\/www\/public\/owncloud\/lib\/private\/files\/storage\/wrapper\/encryption.php#637","level":3,"time":"2016-02-10T12:20:37+01:00","method":"GET","url":"\/owncloud\/index.php\/core\/preview.png?file=%2FFTP%2Fvvv.jpg&c=56bb1be5c76bb&x=48&y=48&forceIcon=0"}
{"reqId":"paYJJRpQMOM0QTV2i3CZ","remoteAddr":"111.111.111.111","app":"PHP","message":"Array to string conversion at \/var\/www\/public\/owncloud\/lib\/private\/template\/functions.php#36","level":3,"time":"2016-02-10T12:20:37+01:00","method":"GET","url":"\/owncloud\/index.php\/settings\/admin"}
{"reqId":"O8V6N08ADEZQGD0ImTuX","remoteAddr":"111.111.111.111","app":"PHP","message":"fclose(): FTP server error 426:426 Transfer aborted. Data connection closed\r\n at \/var\/www\/public\/owncloud\/lib\/private\/files\/storage\/wrapper\/encryption.php#637","level":3,"time":"2016-02-10T12:20:39+01:00","method":"GET","url":"\/owncloud\/index.php\/core\/preview.png?file=%2FFTP%2Fvvv.jpg&c=56bb1be5c76bb&x=48&y=48&forceIcon=0"}
{"reqId":"O8V6N08ADEZQGD0ImTuX","remoteAddr":"111.111.111.111","app":"PHP","message":"fclose(): FTP server error 426:426 Transfer aborted. Data connection closed\r\n at \/var\/www\/public\/owncloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#108","level":3,"time":"2016-02-10T12:20:39+01:00","method":"GET","url":"\/owncloud\/index.php\/core\/preview.png?file=%2FFTP%2Fvvv.jpg&c=56bb1be5c76bb&x=48&y=48&forceIcon=0"}
{"reqId":"peBGifzFltGn1sTIz8MD","remoteAddr":"","app":"DeleteOrphanedSharesJob","message":"0 orphaned share(s) deleted","level":0,"time":"2016-02-10T12:30:01+01:00","method":"--","url":"--"}
@PVince81
Collaborator

@DecaTec thanks for the detailed report.

Make sure that your FTP server doesn't have a limit on incoming connections. When encryption is enabled, ownCloud might open more connections to the server than without. Or it doesn't close it properly ?

Not sure, I just vaguely remember. @schiesbn @icewind1991

@PVince81 PVince81 added this to the 9.0-current milestone Feb 10, 2016
@PVince81 PVince81 added the bug label Feb 10, 2016
@DecaTec
DecaTec commented Feb 11, 2016

@PVince81 thanks for the info!
I've tried it with another FTP server yesterday (in case that it's the FTP server's fault). But got exactly the same problem.
Of course, I've read the documentation about encryption and external storage, but couldn't find a hint about problems due to limited incoming connections. Where can I find concrete figures about how many connections are needed when encryption is enabled?

Edit: Is ownCloud using the PASV mode when connecting to an FTP server?

@PVince81
Collaborator

There aren't any figures, it's just something I remembered from debugging FTP + encryption more than a year ago.

ownCloud is using the PHP FTP API so I think it is using PASV mode.

@christianWilling

it is the same problem when using SMB/CIFS

@PVince81
Collaborator

@christianWilling are you seeing the exact same error messages in your logs ? Please post them.

I just saw this "stream does not support seeking" in the logs, could be related to icewind1991/Streams#2

SMB + encryption works for me in v8.2.2. Uploaded an image in the web UI, downloaded it again. Image can be opened.

@christianWilling
{"reqId":"uNIufwtg1rJAegQtU3P7","remoteAddr":"62.214.70.35","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/cloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-18T11:22:32+00:00"}
{"reqId":"20SrtAkKIAt5ILXuQfZh","remoteAddr":"62.214.70.35","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/cloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-18T11:25:33+00:00"}
{"reqId":"FOQ+0aa4qv6WBcdomR0j","remoteAddr":"62.214.70.35","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/cloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-18T11:27:02+00:00"}
{"reqId":"Wd+YKYI4fa1frEvIXw0G","remoteAddr":"62.214.70.35","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/cloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-18T11:30:03+00:00"}
{"reqId":"qwmoBTTL9Ywhh\/s1PwUv","remoteAddr":"62.214.70.35","app":"PHP","message":"fseek(): stream does not support seeking at \/var\/www\/cloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-02-18T11:33:32+00:00"}

this is my log id don't use encryption i only use samba

@PVince81 PVince81 added the sev2-high label Mar 9, 2016
@schiessle schiessle was assigned by PVince81 Mar 9, 2016
@DevWurm
DevWurm commented Mar 13, 2016

Same problem with external WebDav storage. Uploaded files can't even be deleted.

@schiessle
Member

I can repeat it randomly. With a small text file which only contain the string "hello world". What I discover is that sometimes we don't read the complete header aka first block of the file (8192byte) but only (1448byte). This can be observed here: #23108 In this case the calculation of the signature fails because we end up with the wrong payload.

I think the same happens for larger files also within the payload, that we don't always read the complete block. @PVince81 I remember that you fixed this for google drive but it seems to be a more general issue and also affect other external storages. I will try to fix our stream wrapper to make sure to always read 8192bytes, hope we can do this without to much changes.

@schiessle
Member

For larger files it seems like already the write operation fails, it only writes the first few bytes and stops then.

This is what my log file shows during the write operation:

{"reqId":"3u2LNIPVgk5EdtJg1Vo\/","remoteAddr":"::1","app":"PHP","message":"fseek(): stream does not support seeking at \/home\/src\/owncloud\/server\/master\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#58","level":3,"time":"2016-03-16T11:29:52+00:00"}
{"reqId":"Ia5zDhXRmeQR2ZCU+SPZ","remoteAddr":"::1","app":"PHP","message":"fclose(): FTP server error 426:426 Failure writing network stream.\r\n at \/home\/src\/owncloud\/server\/master\/lib\/private\/files\/storage\/wrapper\/encryption.php#815","level":3,"time":"2016-03-16T11:29:54+00:00"}

continue debugging...

@PVince81
Collaborator

@schiesbn argh, this #22286 (comment) sounds like the issue we had also with GDrive.
When using PHP's fopen on URLs, a fread isn't guaranteed to always return the number of requested bytes. One needs to repeat the call.

The workaround we used there was to use a temporary file, see https://github.com/owncloud/core/blob/v9.0.0/apps/files_external/lib/google.php#L446, see #22590

Of course, ideally we should be able to properly read data.

Are you saying that fwrite also behaves the same and doesn't always write all bytes ??

@schiessle
Member

@PVince81 yes, it seems like there are also issues with fwrite... still debugging...

@icewind1991
Member

@schiesbn could you try adding https://github.com/icewind1991/Streams/blob/05a6f6127f76cb6ba38e235b5c4a312ebceaf7cc/src/RetryWrapper.php

And then wrap the fopen result from ftp with RetryWrapper::wrap

@schiessle
Member

@icewind1991 I will try it, code looks promising

@schiessle
Member

@icewind1991 I'm still struggling to get it working. I always get this error message but can't really see why:

PHP Fatal error:  Call to undefined method Icewind\\Streams\\Wrapper::wrapSource() in /home/src/owncloud/server/master/3rdparty/icewind/streams/src/RetryWrapper.php on line 27
@icewind1991
Member

right, you probably need to update the entire library to https://github.com/icewind1991/Streams/tree/retry

@icewind1991
Member

I will do the whole, tagging release, updating 3rdparty, etc, once we know this fixes the issue

@schiessle
Member

right, you probably need to update the entire library to https://github.com/icewind1991/Streams/tree/retry

That's what I did, set the version in composer.json to "dev-retry" and run composer update && composer install. But I still get the error mentioned above

@icewind1991
Member

it might be conflicting between the lib included in files_external 3rdparty and core 3rdparty, will make a pr to remove the one from files_external

@icewind1991
Member
@schiessle
Member

it might be conflicting between the lib included in files_external 3rdparty and core 3rdparty, will make a pr to remove the one from files_external

Yes, this was the issue. Didn't know that we had two copies of it. After updating the copy in file_externals as well it worked and the the bug here was solved. So it would be great if you could create a new release of your stream wrapper and dump our 3rdparty dependencies.

@PVince81
Collaborator

As discussed with @schiesbn, here's the plan for 9.0.1:

  1. Update Icewind/Streams library in both 3rdparty and files_external/3rdparty to avoid composer issues from #23314
  2. Check the diff of the Icewind/Streams to find out other unrelated affected code paths that might require regression testing
  3. Apply the RetryWrapper only on the FTP storage for now, so that's the only storage that needs retesting (up and download with/without encryption)

@schiesbn @icewind1991 @DeepDiver1975 @LukasReschke

@icewind1991
Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment