Moving Data directory to another disk cause update failure

Ask all your questions regarding OC 6.x Please read the Support Forum Rules
Forum rules
Before you post; make sure you are using at least PHP Version 5.3.x - Also read Support Forum - Read this before posting

Moving Data directory to another disk cause update failure

Postby kasak » Tue Mar 04, 2014 1:15 pm

i'm sorry i don't know how to post bugs, and even don't know is this a bug or a feature.
I have one of "those" servers where we have 1 small ssd disk for system and huge hdd for data. So I have owncloud with Data directory moved to that huge disk by this option in owncloud config.php
Code: Select all
'datadirectory' => '/srv/ftp/owncloud/'


My HDD mounted on /srv and so owncloud data directory placed on hdd.

When i'm trying to update, i receive this error:
Code: Select all
rename(/var/www/owncloud/3rdparty/Archive,/srv/ftp/owncloud/updater_backup/tmp/3rdparty/Archive): Invalid cross-device link at /var/www/owncloud/apps/updater/lib/helper.php#27


And after this update fails.
The problem is that owncloud updater first trying to hardlink directory to backup place, and after that remove it. It is good and secure, but hardlinks only can be created on same filesystem, not on another.
So this good feature causes some problems on updating :(
Maybe developers can do some switch that can disable backup on update, or switching between real move and hardlinking
Thanks!
P.S. Sorry for my english
kasak
Newbie
 
Posts: 6
Joined: Sun Aug 05, 2012 11:56 am
Location: Russia/Moscow
ownCloud version: 6.0.1
Webserver: Apache
Database: MySQL
OS: Linux

Re: Moving Data directory to another disk cause update failu

Postby pfonseca » Tue Mar 04, 2014 1:28 pm

Hi,

I've the same problem here. When I try to update I receive the message "Unable to move /usr/local/www/owncloud/3rdparty/Archive to /usr/local/www/owncloud/data/updater_backup/tmp/3rdparty/Archive"

I'm a FeeNAS box v9.2.2.2 own cloud running on a Jail, nginx v1.4.4.x, php v5.5.x. My data directory is mounted on a volume outside the jail. Everything works fine, except updater:(

Any idea? Every time we have an update, i Have to do it manually. As far as I remember, this doesn't happen on v5.

Regards,
pfonseca
Newbie
 
Posts: 7
Joined: Wed Feb 19, 2014 3:21 pm
ownCloud version: 6.0.1
Webserver: nginx
Database: SQLite
PHP version: 5.5

Re: Moving Data directory to another disk cause update failu

Postby Laurens » Tue Mar 04, 2014 2:26 pm

I'm experiencing the same thing, with my data directory on a seperate ZFS store...

@kasak: You seem to understand the problem well. Do you also have any solution to it as to how we can still proceed with the update, other than a complete manual install?
Laurens
Newbie
 
Posts: 2
Joined: Thu Mar 14, 2013 2:50 pm
ownCloud version: 4.5.7
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 5

Re: Moving Data directory to another disk cause update failu

Postby sks1024 » Tue Mar 04, 2014 2:40 pm

I have the exact same issue here. One way to get around this (temporarily) is to change the data directory path in the config file back to the default just for the upgrade. Problem with that is the clients that are syncing see new folders and delete all of the content stored locally. Learned that the hard way.

Is the a bug and can it be fixed?
sks1024
Newbie
 
Posts: 3
Joined: Tue Mar 04, 2014 2:36 pm
ownCloud version: 7.0.1
Webserver: Apache
Database: MySQL
PHP version: 5.3

Re: Moving Data directory to another disk cause update failu

Postby kasak » Tue Mar 04, 2014 2:45 pm

Laurens wrote:I'm experiencing the same thing, with my data directory on a seperate ZFS store...

@kasak: You seem to understand the problem well. Do you also have any solution to it as to how we can still proceed with the update, other than a complete manual install?


nope :( unfortunately, I only see why the problem exists, but I can't do anything to solve it.
Posting this thread I was hoping that developers take note about this problem and maybe find some way to fix it.
kasak
Newbie
 
Posts: 6
Joined: Sun Aug 05, 2012 11:56 am
Location: Russia/Moscow
ownCloud version: 6.0.1
Webserver: Apache
Database: MySQL
OS: Linux

Re: Moving Data directory to another disk cause update failu

Postby Plugit » Tue Mar 04, 2014 3:06 pm

Confirmed in my logs, directory redirected to /home/owncloud with exact same messages.
Plugit
Beginner
 
Posts: 42
Joined: Tue Feb 11, 2014 12:30 pm
ownCloud version: 7.0.1
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 5.4.4-14+deb7u11

Re: Moving Data directory to another disk cause update failu

Postby kasak » Tue Mar 04, 2014 6:50 pm

I have discovered some new information about error.
Looks like problem in this code
public static function move($src, $dest) {
if (!rename($src, $dest)) {
throw new \Exception("Unable to move $src to $dest");
}
}

from file apps/updater/lib/helper.php

the reason is that "rename" function in php can't move directories across filesystems. It can move only files.
Maybe there is workaround like this:
public static function move($src, $dest) {
if (! (copy ($src, $dest); && unlink ($src) ; ) ) {
throw new \Exception("Unable to move $src to $dest");
}
}


But i'm not coder so I don't know will it really works or not :(
kasak
Newbie
 
Posts: 6
Joined: Sun Aug 05, 2012 11:56 am
Location: Russia/Moscow
ownCloud version: 6.0.1
Webserver: Apache
Database: MySQL
OS: Linux

Re: Moving Data directory to another disk cause update failu

Postby ..... » Tue Mar 04, 2014 7:28 pm

Hi,

please report such stuff directly to the developers at the github bugtracker.
*inactive*
.....
OwnCloud master
 
Posts: 8599
Joined: Sat May 26, 2012 3:00 pm

Re: Moving Data directory to another disk cause update failu

Postby RandolphCarter » Tue Mar 04, 2014 7:49 pm

There already is an issue for that: https://github.com/owncloud/apps/issues/1561

And as far as I understand the comments there, a fix for it will unfortunately not come until ownCloud 6.0.3
90 % of all forum questions could be solved if posters did what
90 % of those posting answers to their questions are doing: enter their question into google and read...

-- shamelessly copied/translated from user xxMuahdibxx in computerbase.de forums
RandolphCarter
Inventory
 
Posts: 4530
Joined: Wed May 30, 2012 8:42 am
ownCloud version: 7.0.2
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 5.5.x

Re: Moving Data directory to another disk cause update failu

Postby Plugit » Wed Mar 05, 2014 11:11 am

Thank you for your digging on github. So, I read no web updater for us who have moved their data directory to another partition, until 6.0.3.

Well, luckily I installed OwnCloud with apt on Debian and simply upgraded it this way. I just wanted to test that web update but I guess I should anyway let apt update what apt installed in the first place...
Plugit
Beginner
 
Posts: 42
Joined: Tue Feb 11, 2014 12:30 pm
ownCloud version: 7.0.1
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 5.4.4-14+deb7u11


Return to ownCloud Community Edition 6.x

Who is online

Users browsing this forum: No registered users and 10 guests