Core: Update 8.0 -> 8.0.2 fails due to lack of web server write access

Created on 15 Mar 2015  路  23Comments  路  Source: owncloud/core

Hi,

I am experiencing the following issue. Is there a way to set these rights accordingly?
Cheers

Steps to reproduce

  1. Open the update center from the admin overview
  2. Click Update

    Expected behaviour

The updater should install the new version of ownCloud (8.02) over the current version (8.0)

Actual behaviour

The updater shows the following error message:
"Make sure that your web server has write access to the following files and directories:"
/var/www/owncloud/3rdparty/LICENSE INFO
/var/www/owncloud/3rdparty/PEAR.php
/var/www/owncloud/3rdparty/PEAR5.php
/var/www/owncloud/3rdparty/autoload.php
/var/www/owncloud/3rdparty/bantu
etcetera (and lists every other owncloud folder underneath it)

Server configuration

Operating system:
Ubuntu Server 14.04.1
Web server:
Apache 2.4.7
Database:
MariaDB 5.5.41
PHP version:
PHP5
ownCloud version: (see ownCloud admin page)
8.0
Updated from an older ownCloud or fresh install:
Updated from 7.02
List of activated apps:
Activity
Calendar
Contacts
Deleted files
Documents
First Run Wizard
Full Text Search
Mail Template Editor
Mozilla Sync
News
PDF Viewer
Pictures
Server-side Encryption
Share Files
Tasks
Text Editor
Updater
Versions
Video Viewer
The content of config/config.php:

<?php
$CONFIG = array (
  'instanceid' => 'occ2acd5dbe5',
  'passwordsalt' => 'xxxx',
  'trusted_domains' =>
  array (
    0 => 'x.x.x.x',
    1 => 'x.x.x.x',
    2 => 'x.x.x.x',
  ),
  'datadirectory' => '/var/www/owncloud/data',
  'dbtype' => 'mysql',
  'version' => '8.0.0.7',
  'dbname' => 'owncloud',
  'dbhost' => '127.0.0.1',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'xxxx',
  'dbpassword' => 'xxxx',
  'installed' => true,
  'forcessl' => true,
  'mail_from_address' => 'xxxx',
  'mail_smtpmode' => 'smtp',
  'mail_smtphost' => 'smtp.gmail.com',
  'mail_smtpname' => 'xxxx',
  'mail_smtppassword' => 'xxxx',
  'mail_domain' => 'gmail.com',
  'loglevel' => '0',
  'appstoreenabled' => true,
  'theme' => '',
  'maintenance' => false,
  'mail_smtpsecure' => 'ssl',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => true,
  'mail_smtpport' => '465',
  'secret' => 'xxxx',
  'appcodechecker' => false,
  'forceSSLforSubdomains' => true,
);

Are you using encryption: yes

Client configuration

Browser:
Firefox 36.0.1
Operating system:
Windows 7

Logs

Web server error log

[Fri Mar 13 21:52:06.245081 2015] [:error] [pid 11673] [client 77.163.196.113:63805] PHP Warning:  apc_store(): GC cache entry 'occ2acd5dbe5/AutoloaderOCP\\IDBConnection' was on gc-list for 3603 seconds in /var/www/owncloud/lib/private/memcache/apc.php on line 21
[Sat Mar 14 02:17:24.975177 2015] [core:error] [pid 19499] [client 82.221.105.7:55060] AH00135: Invalid method in request quit

(last entry from yesterday)

ownCloud log (data/owncloud.log)

{"reqId":"b1089259c981280b36c57a0a4cb6cad7","remoteAddr":"77.163.196.113","app":"OC\\Files\\Cache\\Scanner","message":"!!! Path 'files\/Photo's and Video's\/2011 - 2015\/2014\/Met het mes op tafel - Peter Stikvoort\/IMG_20141023_230800.jpg' is not accessible or present !!!","level":0,"time":"2015-03-15T19:42:20+00:00","method":"PUT","url":"\/owncloud\/remote.php\/webdav\/Photo's%20and%20Video's\/2011%20-%202015\/2014\/Met%20het%20mes%20op%20tafel%20-%20Peter%20Stikvoort\/IMG_20141023_230800.jpg"}
{"reqId":"dfe2cfe42e15a4251abb9f9a80f789c5","remoteAddr":"77.163.196.113","app":"OC\\Files\\Cache\\Scanner","message":"!!! Path 'files\/Photo's and Video's\/2011 - 2015\/2014\/Marocco\/WD_0147.jpeg' is not accessible or present !!!","level":0,"time":"2015-03-15T19:42:22+00:00","method":"PUT","url":"\/owncloud\/remote.php\/webdav\/Photo's%20and%20Video's\/2011%20-%202015\/2014\/Marocco\/WD_0147.jpeg"}
{"reqId":"7661662664cbe58ec118f1472630df68","remoteAddr":"77.163.196.113","app":"OC\\Files\\Cache\\Scanner","message":"!!! Path 'files\/Photo's and Video's\/2011 - 2015\/2014\/Ouders Sabrine bezoek Voorthuizen\/20140816_144208_HDR.jpg' is not accessible or present !!!","level":0,"time":"2015-03-15T19:43:01+00:00","method":"PUT","url":"\/owncloud\/remote.php\/webdav\/Photo's%20and%20Video's\/2011%20-%202015\/2014\/Ouders%20Sabrine%20bezoek%20Voorthuizen\/20140816_144208_HDR.jpg"}
{"reqId":"27ea7f72a2b5033eee4b82f105a3b69e","remoteAddr":"77.163.196.113","app":"OC\\Files\\Cache\\Scanner","message":"!!! Path 'files\/Photo's and Video's\/2011 - 2015\/2014\/Ouders Sabrine bezoek Voorthuizen\/20140816_152222_HDR.jpg' is not accessible or present !!!","level":0,"time":"2015-03-15T19:44:08+00:00","method":"PUT","url":"\/owncloud\/remote.php\/webdav\/Photo's%20and%20Video's\/2011%20-%202015\/2014\/Ouders%20Sabrine%20bezoek%20Voorthuizen\/20140816_152222_HDR.jpg"}
{"reqId":"31ddf1ac85a2acc8a97c615255cf284c","remoteAddr":"","app":"PHP","message":"Undefined index: REQUEST_URI at \/var\/www\/owncloud\/apps\/calendar\/appinfo\/app.php#41","level":3,"time":"2015-03-15T19:45:11+00:00","method":"--","url":"--"}
{"reqId":"31ddf1ac85a2acc8a97c615255cf284c","remoteAddr":"","app":"search_lucene","message":"background job optimizing index for arnomuhren","level":0,"time":"2015-03-15T19:45:22+00:00","method":"--","url":"--"}
{"reqId":"31ddf1ac85a2acc8a97c615255cf284c","remoteAddr":"","app":"search_lucene","message":"deleting status for (0) ","level":0,"time":"2015-03-15T19:45:27+00:00","method":"--","url":"--"}
{"reqId":"31ddf1ac85a2acc8a97c615255cf284c","remoteAddr":"","app":"search_lucene","message":"found 0 hits for file id 0","level":0,"time":"2015-03-15T19:45:30+00:00","method":"--","url":"--"}
{"reqId":"31ddf1ac85a2acc8a97c615255cf284c","remoteAddr":"","app":"search_lucene","message":"removed 0 files from index","level":0,"time":"2015-03-15T19:45:30+00:00","method":"--","url":"--"}
{"reqId":"31ddf1ac85a2acc8a97c615255cf284c","remoteAddr":"","app":"search_lucene","message":"background job optimizing index for admin","level":0,"time":"2015-03-15T19:45:30+00:00","method":"--","url":"--"}
{"reqId":"31ddf1ac85a2acc8a97c615255cf284c","remoteAddr":"","app":"search_lucene","message":"removed 0 files from index","level":0,"time":"2015-03-15T19:45:30+00:00","method":"--","url":"--"}
{"reqId":"31ddf1ac85a2acc8a97c615255cf284c","remoteAddr":"","app":"search_lucene","message":"background job indexing 43 files for arnomuhren","level":0,"time":"2015-03-15T19:45:30+00:00","method":"--","url":"--"}
{"reqId":"d2d252efe57366f135f0d3892ad6f469","remoteAddr":"77.163.196.113","app":"webdav","message":"Exception: {\"Message\":\"expected filesize 20971520 got 7749632\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/connector\\\/sabre\\\/file.php(74): OC_Connector_Sabre_File->createFileChunked(Resource id #140)\\n#1 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/connector\\\/sabre\\\/directory.php(84): OC_Connector_Sabre_File->put(Resource id #140)\\n#2 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/Sabre\\\/DAV\\\/Server.php(1647): OC_Connector_Sabre_Directory->createFile('20140927_172944...', Resource id #140)\\n#3 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/Sabre\\\/DAV\\\/Server.php(900): Sabre\\\\DAV\\\\Server->createFile('Photo's and Vid...', Resource id #140, NULL)\\n#4 [internal function]: Sabre\\\\DAV\\\\Server->httpPut('Photo's and Vid...')\\n#5 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/Sabre\\\/DAV\\\/Server.php(474): call_user_func(Array, 'Photo's and Vid...')\\n#6 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/Sabre\\\/DAV\\\/Server.php(214): Sabre\\\\DAV\\\\Server->invokeMethod('PUT', 'Photo's and Vid...')\\n#7 \\\/var\\\/www\\\/owncloud\\\/apps\\\/files\\\/appinfo\\\/remote.php(61): Sabre\\\\DAV\\\\Server->exec()\\n#8 \\\/var\\\/www\\\/owncloud\\\/remote.php(54): require_once('\\\/var\\\/www\\\/ownclo...')\\n#9 {main}\",\"File\":\"\\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/connector\\\/sabre\\\/file.php\",\"Line\":288}","level":4,"time":"2015-03-15T19:46:03+00:00","method":"PUT","url":"\/owncloud\/remote.php\/webdav\/Photo's%20and%20Video's\/2011%20-%202015\/2014\/Mitsubishi%20Sabrine\/20140927_172944.mp4-chunking-1854157766-9-0"}
{"reqId":"6089e77d8060f40b1ee34326f5de9889","remoteAddr":"77.163.196.113","app":"OC\\Files\\Cache\\Scanner","message":"!!! Path 'files\/Photo's and Video's\/2011 - 2015\/2014\/Paddestoelen zoeken - Sabrine\/20140831_163327.jpg' is not accessible or present !!!","level":0,"time":"2015-03-15T19:46:03+00:00","method":"PUT","url":"\/owncloud\/remote.php\/webdav\/Photo's%20and%20Video's\/2011%20-%202015\/2014\/Paddestoelen%20zoeken%20-%20Sabrine\/20140831_163327.jpg"}
{"reqId":"6089e77d8060f40b1ee34326f5de9889","remoteAddr":"77.163.196.113","app":"PHP","message":"Undefined index: fileid at \/var\/www\/owncloud\/lib\/private\/files\/cache\/cache.php#368","level":3,"time":"2015-03-15T19:46:05+00:00","method":"PUT","url":"\/owncloud\/remote.php\/webdav\/Photo's%20and%20Video's\/2011%20-%202015\/2014\/Paddestoelen%20zoeken%20-%20Sabrine\/20140831_163327.jpg"}
{"reqId":"6089e77d8060f40b1ee34326f5de9889","remoteAddr":"77.163.196.113","app":"webdav","message":"Exception: {\"Message\":\"expected filesize 4977340 got 4440064\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/connector\\\/sabre\\\/directory.php(84): OC_Connector_Sabre_File->put(Resource id #140)\\n#1 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/Sabre\\\/DAV\\\/Server.php(1647): OC_Connector_Sabre_Directory->createFile('20140831_163327...', Resource id #140)\\n#2 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/Sabre\\\/DAV\\\/Server.php(900): Sabre\\\\DAV\\\\Server->createFile('Photo's and Vid...', Resource id #140, NULL)\\n#3 [internal function]: Sabre\\\\DAV\\\\Server->httpPut('Photo's and Vid...')\\n#4 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/Sabre\\\/DAV\\\/Server.php(474): call_user_func(Array, 'Photo's and Vid...')\\n#5 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/Sabre\\\/DAV\\\/Server.php(214): Sabre\\\\DAV\\\\Server->invokeMethod('PUT', 'Photo's and Vid...')\\n#6 \\\/var\\\/www\\\/owncloud\\\/apps\\\/files\\\/appinfo\\\/remote.php(61): Sabre\\\\DAV\\\\Server->exec()\\n#7 \\\/var\\\/www\\\/owncloud\\\/remote.php(54): require_once('\\\/var\\\/www\\\/ownclo...')\\n#8 {main}\",\"File\":\"\\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/connector\\\/sabre\\\/file.php\",\"Line\":130}","level":4,"time":"2015-03-15T19:46:05+00:00","method":"PUT","url":"\/owncloud\/remote.php\/webdav\/Photo's%20and%20Video's\/2011%20-%202015\/2014\/Paddestoelen%20zoeken%20-%20Sabrine\/20140831_163327.jpg"}
{"reqId":"8a1846053ca682fbd33ef9fd189acb57","remoteAddr":"77.163.196.113","app":"webdav","message":"Exception: {\"Message\":\"No basic authentication headers were found\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/connector\\\/sabre\\\/auth.php(123): Sabre\\\\DAV\\\\Auth\\\\Backend\\\\AbstractBasic->authenticate(Object(OC_Connector_Sabre_Server), 'ownCloud')\\n#1 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/connector\\\/sabre\\\/auth.php(103): OC_Connector_Sabre_Auth->auth(Object(OC_Connector_Sabre_Server), 'ownCloud')\\n#2 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/Sabre\\\/DAV\\\/Auth\\\/Plugin.php(108): OC_Connector_Sabre_Auth->authenticate(Object(OC_Connector_Sabre_Server), 'ownCloud')\\n#3 [internal function]: Sabre\\\\DAV\\\\Auth\\\\Plugin->beforeMethod('PROPFIND', '')\\n#4 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/Sabre\\\/DAV\\\/Server.php(433): call_user_func_array(Array, Array)\\n#5 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/Sabre\\\/DAV\\\/Server.php(455): Sabre\\\\DAV\\\\Server->broadcastEvent('beforeMethod', Array)\\n#6 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/Sabre\\\/DAV\\\/Server.php(214): Sabre\\\\DAV\\\\Server->invokeMethod('PROPFIND', '')\\n#7 \\\/var\\\/www\\\/owncloud\\\/apps\\\/files\\\/appinfo\\\/remote.php(61): Sabre\\\\DAV\\\\Server->exec()\\n#8 \\\/var\\\/www\\\/owncloud\\\/remote.php(54): require_once('\\\/var\\\/www\\\/ownclo...')\\n#9 {main}\",\"File\":\"\\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/Sabre\\\/DAV\\\/Auth\\\/Backend\\\/AbstractBasic.php\",\"Line\":73}","level":0,"time":"2015-03-15T19:46:17+00:00","method":"PROPFIND","url":"\/owncloud\/remote.php\/webdav"}
{"reqId":"02bd8083fb04bf71512eae2769763ce7","remoteAddr":"77.163.196.113","app":"OC\\Files\\Cache\\Scanner","message":"!!! Path 'files\/Photo's and Video's\/2011 - 2015\/2014\/Paddestoelen zoeken - Sabrine\/20140831_163327.jpg' is not accessible or present !!!","level":0,"time":"2015-03-15T19:49:52+00:00","method":"PUT","url":"\/owncloud\/remote.php\/webdav\/Photo's%20and%20Video's\/2011%20-%202015\/2014\/Paddestoelen%20zoeken%20-%20Sabrine\/20140831_163327.jpg"}

Most helpful comment

Man you can not use "chmod -R 777". It`s a serious threat to the security of owncloud service. Especially if you host it on a server connected to internet. This is not a good solution

All 23 comments

hmm. I think the problem is exactly as reported. The permissions are not correct so that ownCloud can update itself. Have you tried to fix this and try again?

That's correct, the question I'm asking is what steps to take in order to have the correct permissions set for ownCloud. I haven't changed any permissions, so my guess is that the upgrade from 7 to 8 has done something. Is there a way to fix this via the interface? Or occ? Or a specific command?

I had the same issue, I am running ownCloud on Freenas I issued the command

chown -R www:www /usr/local/www/owncloud

but also chmod -R 777 /usr/local/www/owncloud

this has sorted the issue

Man you can not use "chmod -R 777". It`s a serious threat to the security of owncloud service. Especially if you host it on a server connected to internet. This is not a good solution

@Astraltrooper I agree with you, what should the permission be?

I'm working on it. I have the same problem as the author of the topic

Hi @mredlancelot,
Thanks, what I have done is the following from your recommendation (mine is ubuntu server):
chown -R www-data:www-data /var/www/owncloud

Fortunately this already allowed me to perform the upgrade and all is running well now.
My environment is running on the internet, so I am curious whether this action has any security consequences. I wouldn't think so myself, for only the owner has changed now(?)
Maybe just this change would be enough to get your environment up-and-running again too @Astraltrooper?

From what I see, "chown -R www-data:www-data/var/ www/owncloud/" also works for me. But it think that not all files in a ownclud directory should have such owner. I'm not sure how serious security threat is that.

can someone else advise on what the permissions should be for the www/ownclod folder and subfolders. I'm thinking

chmod -R 554

does that sound good?

secure chown commands are explain on owncloud docs

https://doc.owncloud.org/server/7.0/admin_manual/installation/installation_source.html#setting-secure-directory-permissions

@vetsolution Magic!!! and I guess for chmod owner and group 7 the rest, none?

I thing is rigth but not sure

p.s.:
/path/to/owncloud/data/.htaccess dont exist on my server
and i have do do a
chown -R : /path/to/owncloud/config/
too

term
@mredlancelot As for me some of the files have chmod 755 and some have chmod 644

when I give
chown -R root:root /path/to/owncloud/

if get "Forbiden", when accessing the login page

I had to revert to
chown -R http_user:http_user /path/to/owncloud/

try this
chown -R http_user:http_user /path/to/owncloud/config/

on my debian server with apache2 i put this command BEFORE update

chown -R www-data:www-data /path/to/owncloud/

And thes AFTER update

chown -R root:root /path/to/owncloud/
chown -R www-data:www-data /path/to/owncloud/config/
chown -R www-data:www-data /path/to/owncloud/data/
chown www-data:www-data /path/to/owncloud/apps/

You must enter all commands from the list.

chown -R root:root /usr/local/www/owncloud
chown www:www /usr/local/www/owncloud/config
chown www:www /usr/local/www/owncloud/config.php
chown -R www:www /usr/local/www/owncloud/data/
chown root:root /usr/local/www/owncloud/.htaccess
chown www:www /usr/local/www/owncloud/apps/

If this does not work then this is a problem with the level of access to the files. You used unnecessarily the "chmod 777" earlier.

Maybe there is some way to reset to default ownCloud permissions for @mredlancelot . I saw some suggestions of .occ files:scan --all in other issues related to permission issues; however I do not know whether it defaults the OC files back to default.

I will manually set the permissions for each file/dir as per the screenshot by @Astraltrooper I appreciate that I compromised the security by using chmod 777, and I really appreciate all your help, really some other forums would not be as forgiving, so once again, thank you.

On my FreeNAS 9.3 system I have had this situation (specifically, the Make sure that your web server has write access to the following files and directories error) when attempting to use the GUI to upgrade from 8.0.3 to the latest. To make the process work, inside the Owncloud plugin jail I had to resort to doing the following within /usr/pbi/owncloud-amd64/www/owncloud:

chown -R www:www *
chmod -R u+w *

I'm not particularly experienced when it comes to file permissions, so could anyone please advise me whether what I've done is appropriate, and whether it is safe to leave these permissions as they are now, or if I should revert them back to something else? Presumably, leaving the www group write access to everything within that directory could be a vulnerability, but I'm worried removing write permission for everything again might break functionality.

On owncloud 8.1, I used the script here to set the permissions :
https://doc.owncloud.org/server/8.1/admin_manual/installation/installation_wizard.html#setting-strong-directory-permissions
but the updater still asks me for write permission of the whole oc directory.
Will chmod 777 for the update and then run the script again, but why is this happening ?

I just changed in the script lines

find ${ocpath}/ -type f -print0 | xargs -0 chmod 0770
find ${ocpath}/ -type d -print0 | xargs -0 chmod 0770
chmod 0744 ${ocpath}/.htaccess

After successful install, I run the original script again for correct permissions.

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.

Was this page helpful?
0 / 5 - 0 ratings