Dietpi: Nextcloud cannot be installed, again

Created on 4 Nov 2018  ยท  13Comments  ยท  Source: MichaIng/DietPi

I'm here again. Trying to install Nextcloud with dietpi_userspace on another drive, throws me this error. To save time, I also send a bug report just in case: f489c9d1-7964-4348-b501-c2de9bd420e1

Details:

  • Date | Sun 4 Nov 12:37:10 CET 2018
  • Bug report | N/A
  • DietPi version | v6.18.2 (Fourdee/beta)
  • Img creator | DietPi Core Team
  • Pre-image | Raspbian Lite
  • SBC device | RPi 3 Model B (armv7l) (index=3)
  • Kernel version | #1145 SMP Fri Sep 21 15:38:35 BST 2018
  • Distro | stretch (index=4)
  • Command | ncc maintenance:install
  • Exit code | 1
  • Software title | DietPi-Software

Steps to reproduce:

  1. Plug an USB storage
  2. Make that USB a drive (formatting or mounting)
  3. Point dietpi_userspace to it using dietpi-drive_manager
  4. Open dietpi-software
  5. Install Nextcloud

Expected behaviour:

  • Nextcloud should be installed without problems using the external drive

Actual behaviour:

  • Installation crashes, maybe by a lack of symlink support

Extra details:

  • The external drive is a USB stick formatted to F2FS

Additional logs:

Log file contents:

In Local.php line 387:

  Following symlinks is not allowed  


maintenance:install [--database DATABASE] [--database-name DATABASE-NAME] [--database-host DATABASE-HOST] [--database-port DATABASE-PORT] [--database-user DATABASE-USER] [--database-pass [DATABASE-PASS]] [--database-table-prefix [DATABASE-TABLE-PREFIX]] [--database-table-space [DATABASE-TABLE-SPACE]] [--admin-user ADMIN-USER] [--admin-pass ADMIN-PASS] [--data-dir DATA-DIR]
Beta Bug External Bug

Most helpful comment

Also my error because I didn't read my own bug report, just fill the fields and clicked send xD

All 13 comments

@enolp

Thanks for the report ๐Ÿ‘

We have a known issue with Nextcloud install in v6.17 (https://github.com/Fourdee/DietPi/pull/2186), fixed in our beta:
https://github.com/Fourdee/DietPi/blob/beta/BRANCH_SYSTEM.md

F2FS "should" support symlinks:
https://unix.stackexchange.com/questions/323155/does-f2fs-support-permissions-and-symlinks/323156

We'll look into it.

Ooops @Fourdee, I forgot to mention that I was using the beta branch. My apologizes

@enolp

I forgot to mention that I was using the beta branch.

DietPi version | v6.18.2 (Fourdee/beta)

You did mention it ๐Ÿ‘ My error ๐Ÿ˜„

Also my error because I didn't read my own bug report, just fill the fields and clicked send xD

@MichaIng

PHP not being installed in dev branch.

๐Ÿˆฏ๏ธ Works fine if manual install dietpi-software install 89 114
๐Ÿˆฏ๏ธ https://github.com/Fourdee/DietPi/commit/feac1235caade36db2898fa7ee9cf6120033b8fc

aSOFTWARE_REQUIRES_PHP[$software_id]=1 missing from lots of software.

image

๐Ÿˆฏ๏ธ C2:

root@DietPi:/mnt/ssd# ln -sf test /mnt/ssd/test2
root@DietPi:/mnt/ssd# ls -lha
total 28K
drwxr-xr-x 2 root root 4.0K Nov  4 13:07 .
drwxr-xr-x 8 root root 4.0K Nov  4 13:06 ..
-rw-r--r-- 1 root root    2 Nov  4 13:07 test
lrwxrwxrwx 1 root root    4 Nov  4 13:07 test2 -> test

Issue is OC/NC disabled support for symlinked data dir due to "security" concerns:
https://github.com/nextcloud/server/issues/1257#issuecomment-245314285

However, as DietPi controls, manages and installs to symlink only if userdata is located on external drive as per user requirements, and www-data permissions correctly set on the NC/OC data dir, there is no security concern and we will re-enable this feature.

@enolp

Install fixed in Beta update:

dietpi-update

Then run the installation again for NC

@Fourdee
Jep I fixed the missing PHP in the open PR, recognized as well. Will compare solutions later and make it ready for merge.

The same is for desktops and xserver.

We marked PHP through webserver dependency, but with single loop the webserver ID could have already passed when being marked. My fix was to fake PHP dependency for current loop ID: https://github.com/Fourdee/DietPi/commit/ee2cc65f9f1b8b5a89ac7e7876a5f1888fc026dd

Anyway I planned a new dependency system, storing dependency IDs in a new single array, to have everything in a single system instead of some via own array, some via manual making etc.

And you need to revert the symlink fix. This is still possible. Manual changing Nextcloud files would lead to integrity check issues, breaking updates and manual updates would override the fix. I believe the symlink issue is due to missing PHP modules and/or manual disabling in webserver config. Will check later.

@MichaIng

And you need to revert the symlink fix.

Fails without it ๐Ÿ˜•

image

@Fourdee
Strange, symbolic links inside the data dir are not supported or let's say not followed. But symbolic links of the data directory itself or it's parents are definitely supported, as this is a common method to move it after install, part of my how-to on Nextcloud forum and so many users following and reporting back it's working, including my own tests not long ago. If it's not working anymore then this must be a very recent change and Nextcloud forum should be flooded with related issues, which is not. I will tested, there must be another issue.

Testing:
Okay, ncc maintenance:install throws an error, but if this is ignored, the instance works fine, uploading new files work and they are placed as expected etc. config.php is fully configured with /mnt/dietpi_userdata/nextcloud_dada with dietpi_userdata being a symlink.
What is missing, is the skeleton directory, so data dir will be empty then. But actually this is anyway how I like it more...

So we could revert to ignoring ncc maintenance:install error code. Not ideal though. I think I open a Nextcloud GitHub issue. Also the comment within the settings code and the 2016 commit/issue clearly states that it is about symlink INSIDE data dir pointing OUTSIDE of data dir. But this is not the case if data dir itself or even parent folder is a symlink. This is handled incorrectly.

โ‚ฌ: Issue opened: https://github.com/nextcloud/server/issues/12247
๐Ÿˆฏ๏ธ This is no issue on Jessie (NC 13.0.7), so error due to recent changes.

@Fourdee
Reworked the workaround: https://github.com/Fourdee/DietPi/commit/c35b4bbbdf2dbc82942fceca03a2aebeef5beccd

  • This preserves Nextcloud integrity and also the reasonable security feature, if a symlink is placed inside the data dir. Otherwise external users could upload a symlink, pointing to sensitive system data somewhere else to have at least read access in most cases!
  • Now check for Stretch+ (no issue on Jessie) + datadir path containing a symlink, then skip error handling and manually move datadir.

Retesting:

  • [x] Stretch ๐Ÿˆฏ๏ธ
  • [x] Jessie ๐Ÿˆฏ๏ธ
  • [x] ownCloud does not need workaround, it's only NC 14.0.X issue. ๐Ÿˆฏ๏ธ

Little fix: https://github.com/Fourdee/DietPi/commit/c45888d6c58935b38528448d465f54ab7930d96e

@MichaIng

Legend ๐Ÿ‘ Thank you.

Was this page helpful?
0 / 5 - 0 ratings