Error updating to 11.0.3

I am now conducting a new clean installā€¦ less stressā€¦

And as mentioned above I am running Original NC Scripts from Adminā€™s manual - it simply doesnā€™t work.

Sometimes thatā€™s easier than trying to figure out what went wrong! Then you know everything is correct and donā€™t have to worry about issues later on.
In case you didnā€™t know, you can save your config, database, etc and only overwrite the nextcloud files manually (excluding the data directory).

Iā€™m not sure what else to try at this point. Maybe take the approach that jakobssystems is taking and manually reinstalling (really not any more work than what youā€™ve already been doing).

Unless you really want to know where things went wrong, you need to look more closely at your nextcloud.log file and work your way back.

Hi linucksrox,
no chance to upgrade after changing to the update permissions. Iā€™ve the same issues like odooo.

Hope, there is a solution ā€¦

Upgrading from 11.0.1.2 to 11.0.2.7 run without any problem.

Thanks for helping.
soyo

Itā€™s starting to sound like thereā€™s a bug in the updater, but I donā€™t know what else to look for. If thatā€™s the case, it seems to be related to certain apps (in this case Iā€™m seeing files_antivirus and files_markdown).

Maybe you guys should post an issue on github and see if anyone else can investigate deeper. Make sure you provide more details than whatā€™s here, like the nextcloud log and specifically which package is installed (from source, snap, package, etc).

Hi linucksrox,
to disable apps may be a good hint. Iā€™ll try it an come back.

soyo

I may do this, cause this is just my own - sorry next - cloud. All my project files are on external storages, my Onlyoffice and Rocketchat are on seperate servers. Only my notes and newsfeeds are on same nextcloud server. But if this host would be a customer the best advice would be NOT to install. But this canā€™t be the solution in terms of security.

Just for reference, Iā€™ve had the same problem with some files because in some time I had enabled the Encryption module, then I disabled it.
The update script from the Admins Manual worked for me like a charm.

Hi linusrocks,
your hint was right: I changed the rights for the shown apps ā€˜markdownā€™ and ā€˜documentsā€™ from -rā€“r--r-- in each of the folders /var/www/nextcloud/apps/(app)/.git/objects/pack via chmod +rwx to the *.idx and *.pack.

The update run without problems.
After update in the config-file has to be changed from maintainance => true to false.

File rights changed to
-rwxr-xr-x 1 www-data www-data 612620 Apr 3 07:24 pack-87d37fe55537ad8929f0c5a3dbbe6541c71c0403.idx
-rwxr-xr-x 1 www-data www-data 19015997 Apr 3 07:24 pack-87d37fe55537ad8929f0c5a3dbbe6541c71c0403.pack

Question to you: Why in 11.0.2 -rā€“r--r-- and in 11.0.3 -rwx-xr-x??? Hope you can give me some infos.

After upgrade I changed the secure rights, shown in the script above ā€¦

After that I enable the apps ā€¦

11.0.3 runs faster ā€¦

I hope, it helps ā€¦

soyo

Ah, I think Iā€™m seeing what the problem might be. Because the permissions were set to read only within those apps, that tells me that you probably installed those manually, perhaps copying them over using sudo? In that case, even after running either script (set strong permissions or set updater permissions) only root would be able to modify those files, causing that error (because www-data would not be able to overwrite those files even as the owner).

My first thought is oops, you accidentally copied the apps over with the wrong permissions. But even so, wouldnā€™t it be nice if the update permission script corrected these issues? I think we need to get this updated in the documentation to avoid this problem. I may work on this in the near future.

In the meantime, along with the updater permissions script, we should also be executing this part again:

find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640
find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750

Hi linuchsrox, thanks for your answer:-)
you are right, I installed some apps (exept ā€˜documentsā€™) via ssh terminal as root. That may be was my mistake, without knowing, that further updates after 11.0.2 will consider this.

Thanks for your help!

soyo

1 Like

Thanks for your feedback soyo, I was starting to get a little discouraged about this problem because I couldnā€™t figure out why the permissions were still wrong in some cases.

Iā€™m going to add this issue to the documentation in github and hopefully send a pull request soon.

I donā€™t know if this actually helps @odooo or @jakobssystems, but if theyā€™re still willing to try Iā€™m curious.

Me too ā€¦

THANK YOU
this worked for me

Thanks @soyo and @linucksrox !

I did:
sudo find /wwwroot/nextcloud -name ā€œ.pack" -o -name ".idxā€ | xargs ls | xargs chmod +rwx

I had two results: ā€œnotesā€ and ā€œfiles_external_siaā€.

I think I installed ā€œ./apps/notes/ā€ manually, but strangely, I thought ./apps/files_external_sia/ was installed by appstoreā€¦

Same here. Since moving from ownCloud to Nextcloud the updater doesnā€™t work. I always get this error message:

Check for write permissions
SplFileInfo::isDir(): open_basedir restriction in effect. File(/home/webpages/hoster-name/user-
name/nextcloud/updater/../..) is not within the allowed path(s): (/tmp:/home/webpages/tmp:/dev
/urandom:/home/webpages/hoster-name/user-name/nextcloud)

Updating actually only worked once or twice smoothly for me while still using ownCloud. Thus I always make a new install using the setup-nextcloud-vXY.php script and move the old data and config directories to the new installation. That worked fine for me until now. But maybe there the problem with the not working updater comes from. I actually used the same procedure for updating from ownCloud to nextcloud. Furthermore I had moved the ownCloud installation from my old hoster to a new one by just copying all files via FTP and editing the config files to make some adjustments in respect to the directories.

After reading this thread I checked the owner and group settings and the permission and saw that the data and the config directory and everything below have a different group number than the rest of the installation. The owner is the same. Can this be the reason for not being able to update using the updater?

BTW, Iā€™m on a shared hoster and have no ssh access. Thus there is no way to execute any scripts or change the groups easily. But if this is the reason I would file a help ticket asking the hoster to change them for me.

Knut

Hi odooo,
it was teamwork ā€¦ and ā€œfood for thoughtā€ came from linucksrox ā€¦ so I pass your THANKS to him;-)

For the next update we know which we have to care of: never install an app manually without checking the rights afterwards to avoid the next problems with updatesā€¦

Greets & congratulations to your/our successful update
soyo

2 Likes

Hi King-knut,
I tried to install nextcloud on my shared hoster package, and it did not work without difficulties, which I wanted to avoid.
And https cost money ā€¦ So I decided to make it my own with an old netbook. So I have maximum of access, freedom and responsibility, SSH inclusive. Https via letsencrypt. The only handycap: the upload rate ā€¦ I donā€™t mind ā€¦

It is no solution, but might be a possibility to think about.
soyo

BTW: Knut is like a German name ā€¦ we can talk German too;-)

I did not see before that you have to weaken your permissions, then harden them.

I really think that is not good design. Maybe the folder structure should be different to both provide secure permissions and enable updates. Maybe we should study what Wordpress does.

I opened an issue before I read that

I could be able to help with this but first I would like to know what the current idea the devs have. I am sure that this has been discussed and is the way it is for a reason.

2 Likes

Hi Soyo,

my hoster is lima-city. They offer letsencrypt and many other cool services. And they charge little money since somehow this works a bit like a community project. Installing my nextcloud on a computer back home is no option. I do not see a way to host my domain there and make it accessible to the outside world.

Well, youā€™re right Iā€™m German. But Knut actually is a Scandinavian name. Anyhow, I prefer English to German in the forum, since you canā€™t that everybody here understands German.

Greetings

Knut