{"action":"created","issue":{"url":"https://api.github.com/repos/owncloud/core/issues/15017","labels_url":"https://api.github.com/repos/owncloud/core/issues/15017/labels{/name}","comments_url":"https://api.github.com/repos/owncloud/core/issues/15017/comments","events_url":"https://api.github.com/repos/owncloud/core/issues/15017/events","html_url":"https://github.com/owncloud/core/issues/15017","id":62806577,"number":15017,"title":"Swift Object Storage doesn't work with Encryption App on 8.0.2","user":{"login":"rvrangel","id":848006,"avatar_url":"https://avatars.githubusercontent.com/u/848006?v=3","gravatar_id":"","url":"https://api.github.com/users/rvrangel","html_url":"https://github.com/rvrangel","followers_url":"https://api.github.com/users/rvrangel/followers","following_url":"https://api.github.com/users/rvrangel/following{/other_user}","gists_url":"https://api.github.com/users/rvrangel/gists{/gist_id}","starred_url":"https://api.github.com/users/rvrangel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rvrangel/subscriptions","organizations_url":"https://api.github.com/users/rvrangel/orgs","repos_url":"https://api.github.com/users/rvrangel/repos","events_url":"https://api.github.com/users/rvrangel/events{/privacy}","received_events_url":"https://api.github.com/users/rvrangel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-18T21:31:25Z","updated_at":"2015-03-19T09:08:58Z","closed_at":null,"body":"### Steps to reproduce\r\n1. Install owncloud 8.0.2\r\n2. Store files in a Swift Object Storage\r\n3. Enable encryption\r\n\r\n### Expected behaviour\r\nFile should be stored correctly with its key.\r\n\r\n### Actual behaviour\r\nIt seems the files are uploaded, but when owncloud tries to create a temporary fileKey, it fails. I don't understand how owncloud does it, but I believe when the encryption app is disabled, the file is saves directly to the **data** dir, but when using swift it has to create a temporary file and update it afterwards.\r\n\r\nIn this case, it tries to **touch** the file **/tmp/oc_tmp_a6b01e156c7a13a8ee28a6c9f68dbcdf.txt/fileKey**, but the folder **/tmp/oc_tmp_a6b01e156c7a13a8ee28a6c9f68dbcdf.txt/** does not exist and it fails. I believe creating the folder before should solve this issue.\r\n\r\n### Server configuration\r\n**Operating system**: Ubuntu 14.04\r\n\r\n**Web server:** lighttpd\r\n\r\n**Database:** SQLite\r\n\r\n**PHP version:** 5.5.9\r\n\r\n**ownCloud version:** 8.0.2\r\n\r\n**Updated from an older ownCloud or fresh install:** fresh install\r\n\r\n**List of activated apps:** files_encryption\r\n\r\n**The content of config/config.php:** \r\n\r\n```\r\n<?php\r\n$CONFIG = array (\r\n  'instanceid' => 'xxx',\r\n  'passwordsalt' => 'xxx',\r\n  'secret' => 'xxx',\r\n  'trusted_domains' => \r\n  array (\r\n    0 => 'xxx',\r\n  ),\r\n  'datadirectory' => '/var/www/owncloud/data',\r\n  'overwrite.cli.url' => 'https://xxx',\r\n  'dbtype' => 'sqlite3',\r\n  'version' => '8.0.2.0',\r\n  'installed' => true,\r\n  'forcessl' => true,\r\n  \r\n  'objectstore' => array(\r\n    'class' => 'OC\\\\Files\\\\ObjectStore\\\\Swift',\r\n    'arguments' => array(\r\n      'username' => 'xxx',\r\n      'password' => 'xxx',\r\n      'container' => 'xxx',\r\n      'autocreate' => false,\r\n      'region' => 'xxx',\r\n      'url' => 'xxx',\r\n      'tenantName' => 'xxx',\r\n      'serviceName' => 'swift',\r\n    ),\r\n  ),\r\n);\r\n\r\n```\r\n\r\n**Are you using external storage, if yes which one:** swift\r\n\r\n**Are you using encryption:** yes\r\n\r\n**Are you using an external user-backend, if yes which one:** no\r\n\r\n### Client configuration\r\n**Browser:** Firefox 36.0\r\n\r\n**Operating system:** Linux\r\n\r\n### Logs\r\n#### Web server error log\r\n```\r\n2015-03-18 21:05:26: (mod_fastcgi.c.2673) FastCGI-stderr: PHP Warning:  fflush(): 186 is not a valid stream resource in /var/www/owncloud/apps/files_encryption/lib/stream.php on line 540\r\n2015-03-18 21:05:26: (mod_fastcgi.c.2673) FastCGI-stderr: PHP Warning:  fclose(): 186 is not a valid stream resource in /var/www/owncloud/apps/files_encryption/lib/stream.php on line 657\r\n2015-03-18 21:05:26: (mod_fastcgi.c.2673) FastCGI-stderr: PHP Fatal error:  Access to undeclared static property: OC_Log::$enabled in /var/www/owncloud/lib/private/legacy/log.php on line 47\r\n\r\n```\r\n\r\n#### ownCloud log (data/owncloud.log)\r\n```\r\n{\"reqId\":\"d84b5dd97fb8f9f87d8447aeb0a76774\",\"remoteAddr\":\"xxx.xxx.xxx.xxx\",\"app\":\"PHP\",\"message\":\"touch(): Unable to create file \\/tmp\\/oc_tmp_a6b01e156c7a13a8ee28a6c9f68dbcdf.txt\\/fileKey because No such file or directory at \\/var\\/www\\/owncloud\\/lib\\/private\\/tempmanager.php#62\",\"level\":3,\"time\":\"2015-03-18T21:05:25+00:00\"}\r\n{\"reqId\":\"d84b5dd97fb8f9f87d8447aeb0a76774\",\"remoteAddr\":\"xxx.xxx.xxx.xxx\",\"app\":\"PHP\",\"message\":\"fopen(\\/tmp\\/oc_tmp_a6b01e156c7a13a8ee28a6c9f68dbcdf.txt\\/fileKey): failed to open stream: No such file or directory at \\/var\\/www\\/owncloud\\/lib\\/private\\/files\\/stream\\/close.php#23\",\"level\":3,\"time\":\"2015-03-18T21:05:25+00:00\"}\r\n{\"reqId\":\"d84b5dd97fb8f9f87d8447aeb0a76774\",\"remoteAddr\":\"xxx.xxx.xxx.xxx\",\"app\":\"PHP\",\"message\":\"fopen(close:\\/\\/\\/tmp\\/oc_tmp_a6b01e156c7a13a8ee28a6c9f68dbcdf.txt\\/fileKey): failed to open stream: &quot;OC\\\\Files\\\\Stream\\\\Close::stream_open&quot; call failed at \\/var\\/www\\/owncloud\\/lib\\/private\\/files\\/objectstore\\/objectstorestorage.php#280\",\"level\":3,\"time\":\"2015-03-18T21:05:25+00:00\"}\r\n{\"reqId\":\"d84b5dd97fb8f9f87d8447aeb0a76774\",\"remoteAddr\":\"xxx.xxx.xxx.xxx\",\"app\":\"PHP\",\"message\":\"fwrite() expects parameter 1 to be resource, boolean given at \\/var\\/www\\/owncloud\\/lib\\/private\\/files\\/storage\\/common.php#155\",\"level\":3,\"time\":\"2015-03-18T21:05:25+00:00\"}\r\n{\"reqId\":\"d84b5dd97fb8f9f87d8447aeb0a76774\",\"remoteAddr\":\"xxx.xxx.xxx.xxx\",\"app\":\"PHP\",\"message\":\"fclose() expects parameter 1 to be resource, boolean given at \\/var\\/www\\/owncloud\\/lib\\/private\\/files\\/storage\\/common.php#156\",\"level\":3,\"time\":\"2015-03-18T21:05:25+00:00\"}\r\n{\"reqId\":\"7ec022f6340f6369c8380640ab849645\",\"remoteAddr\":\"xxx.xxx.xxx.xxx\",\"app\":\"index\",\"message\":\"Exception: {\\\"Message\\\":\\\"Encryption key not found for \\\\\\\"\\\\\\/rvrangel\\\\\\/files\\\\\\/test.txt\\\\\\\" during attempted read via stream\\\",\\\"Code\\\":0,\\\"Trace\\\":\\\"#0 [internal function]: OCA\\\\\\\\Files_Encryption\\\\\\\\Stream->stream_read(8192)\\\\n#1 \\\\\\/var\\\\\\/www\\\\\\/owncloud\\\\\\/lib\\\\\\/private\\\\\\/preview\\\\\\/txt.php(30): stream_get_contents(Resource id #189, 3000)\\\\n#2 \\\\\\/var\\\\\\/www\\\\\\/owncloud\\\\\\/lib\\\\\\/private\\\\\\/preview.php(520): OC\\\\\\\\Preview\\\\\\\\TXT->getThumbnail('\\\\\\/test.txt', 36, 36, true, Object(OC\\\\\\\\Files\\\\\\\\View))\\\\n#3 \\\\\\/var\\\\\\/www\\\\\\/owncloud\\\\\\/lib\\\\\\/private\\\\\\/preview.php(565): OC\\\\\\\\Preview->getPreview()\\\\n#4 \\\\\\/var\\\\\\/www\\\\\\/owncloud\\\\\\/core\\\\\\/ajax\\\\\\/preview.php(44): OC\\\\\\\\Preview->showPreview()\\\\n#5 \\\\\\/var\\\\\\/www\\\\\\/owncloud\\\\\\/lib\\\\\\/private\\\\\\/route\\\\\\/route.php(135) : runtime-created function(1): require_once('\\\\\\/var\\\\\\/www\\\\\\/ownclo...')\\\\n#6 [internal function]: __lambda_func(Array)\\\\n#7 \\\\\\/var\\\\\\/www\\\\\\/owncloud\\\\\\/lib\\\\\\/private\\\\\\/route\\\\\\/router.php(250): call_user_func('?lambda_167', Array)\\\\n#8 \\\\\\/var\\\\\\/www\\\\\\/owncloud\\\\\\/lib\\\\\\/base.php(767): OC\\\\\\\\Route\\\\\\\\Router->match('\\\\\\/core\\\\\\/preview.p...')\\\\n#9 \\\\\\/var\\\\\\/www\\\\\\/owncloud\\\\\\/index.php(36): OC::handleRequest()\\\\n#10 {main}\\\",\\\"File\\\":\\\"\\\\\\/var\\\\\\/www\\\\\\/owncloud\\\\\\/apps\\\\\\/files_encryption\\\\\\/lib\\\\\\/stream.php\\\",\\\"Line\\\":281}\",\"level\":4,\"time\":\"2015-03-18T21:05:26+00:00\"}\r\n\r\n```\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/owncloud/core/issues/comments/83431960","html_url":"https://github.com/owncloud/core/issues/15017#issuecomment-83431960","issue_url":"https://api.github.com/repos/owncloud/core/issues/15017","id":83431960,"user":{"login":"MorrisJobke","id":245432,"avatar_url":"https://avatars.githubusercontent.com/u/245432?v=3","gravatar_id":"","url":"https://api.github.com/users/MorrisJobke","html_url":"https://github.com/MorrisJobke","followers_url":"https://api.github.com/users/MorrisJobke/followers","following_url":"https://api.github.com/users/MorrisJobke/following{/other_user}","gists_url":"https://api.github.com/users/MorrisJobke/gists{/gist_id}","starred_url":"https://api.github.com/users/MorrisJobke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MorrisJobke/subscriptions","organizations_url":"https://api.github.com/users/MorrisJobke/orgs","repos_url":"https://api.github.com/users/MorrisJobke/repos","events_url":"https://api.github.com/users/MorrisJobke/events{/privacy}","received_events_url":"https://api.github.com/users/MorrisJobke/received_events","type":"User","site_admin":false},"created_at":"2015-03-19T09:08:58Z","updated_at":"2015-03-19T09:08:58Z","body":"cc @schiesbn @icewind1991 "}}