Nextcloud package broken?

I just can’t get nextcloud fired up on fedora server. There is a thread about it in the nextcloud forum:

Several issues arose:

nextcloud is installed in /usr/share/nextcloud, instead of in /var/www/html
The owner of the installed files is root instead of apache.
config.php is installed to /etc/nextcloud and then symlinked instead of being in the installation directory.

None of these seemed to be the problem though, applying the changes suggested in the nextcloud forum did not result in nextcloud running. However, even if they would, such changes should not have to be applied to files installed via the package manager. I’m beginning to doubt that installing an update to the nextcloud package would work, rendering installing nextcloud via the package manager pointless.

Now the basic question is this: Is the nextcloud package actually broken?

If not, and everything is as it should be, I would appreciate some documentation on how to get it to actually run. All documentation I could find both on nextcloud and on fedora is severly outdated and predates the availability of a package for nextcloud. I would also appreciate a rationale of why things are put into different places than seem to be expected.

1 Like

I’m not a nextcloud user, I’m commenting on your dedictions on the packaging choices.

This sound correct. I assume that nextcloud is read-only and executed but never written.

Also sound correct, why allow apache to damage the read only nextcloud files?
All system files are owned by root usually.

config in /etc sounds correct with a symlink becuase nextcloud does not know to look in /etc maybe?

I don’t really care where the files are, as long as the nextcloud server is working. I merely summarized what the people in the nextcloud forum were frowning upon.

Could the maintainer of the package somehow be persuaded to provide proof that the package is actually working? Preferably in the form of a step by step guide to make it work?

1 Like

Nextcloud - Fedora Project Wiki

Just tell us what manual you want to follow and on which step you get errors. Which kind of error you get and what information you found so far. Server version would be interesting too etc.

you on Nextcloud discourse:

I understand that the installation wizard should be run on localhost, however, my server is headless. Can I allow remote access somehow? (I’m on a local network)

Grant access to remote hosts > see wiki link.

Please post the file /etc/nextcloud/config.php

Thank you for the link to the podman article, this sounds interesting. Before trying that though I’ll continue to try to make the native install work.

I’ve seen the other tutorial you’ve linked before, but it seemed too outdated to be taken seriously. But maybe it is still up to date.

First I reverted the changes I made (returning ownership to root and recreated the symlink for the config folder).

I skipped the part for the ssl certificate, but I prepared the database as instructed. That seems to have worked.

The occ command however gave me this error:

The current PHP memory limit is below the recommended value of 512MB.
Cannot write into "apps" directory.
This can usually be fixed by giving the web server write access to the apps directory or disabling the App Store in the config file.

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /usr/share/nextcloud/lib/private/Console/Application.php:166
Stack trace:
#0 /usr/share/nextcloud/console.php(99): OC\Console\Application->loadCommands()
#1 /usr/share/nextcloud/occ(11): require_once('...')
#2 {main}

I have not set any php memory limits; php was installed as a dependency for nextcloud and I have not fiddled with it. Don’t know what this ‘apps’ directory is about.

Oh, and /etc/nextcloud/config.php is empty.
And I’m running on fedora server 37.

Have you read /usr/share/doc/nextcloud/README.fedora?

I got it working. The error about the apps directory not being writeable was easily fixed by

sudo chown -R apache:apache /usr/share/nextcloud/apps

However, after succesfully running occ (which by the way generated the config file), the nextcloud web page displayed the exact same error about the apps directory not being writeable. Huh?

Turns out that I also need to specify an selinux rule for httpd (apache) to be able to access the apps directory:

semanage fcontext -a -t httpd_sys_rw_content_t '/usr/share/nextcloud/apps(/.*)?'
restorecon -Rv '/usr/share/nextcloud/'

And now it works!

Yes, but the solution wasn’t in there.

I was surprised reading the above.

Would you bee so kind add in the Wiki what was missing ? So people see that the date of it changed and they have security that the package is usable.

- Fedora Project Wiki

By the way, I was ironic.

Irony often fails to translate, and can feel like bad intentions even when meant well.

I agree with using a containerized environment for nextcloud and its services, I’m looking at using docker-compose. Generally this seems like the way to use all services on server, for security and ease of supporting software (can have one image that can be used with docker on any distro).

Beware the current nextcloud docker image has at least two issues: it deletes all files from the data directory when it initializes for the first time, and it has to run as a specific UID and also (AFAIR) have privileged access.

And my trust in nextcloud is low: I had database corruption after multiple restarts of my server. This shouldn’t happen, and indicates an issue with nextcloud or the database used - I was using a snap at the time (not recommended as snap isn’t widely used) and don’t recall what database it’s using.

I wasn’t backing things up, as I’m just using it to offload and share personal files.

1 Like

I wanted to add this… If you install latest fedora38, then Nextcloud with dnf install nextcloud, it will install php8.2 for you. After you setup nextcloud and go through some steps (for example using this great page: Nextcloud on Fedora by Rhea Gustavsson, you will end up on the error message “this version of nextcloud does not support php >= 8.2” And I’m stuck there rn.
I am going with the docker-way myself. Docker helps a lot these days when the PHP, etc, versions go so fast. (for example pgadmin4 (python app), nextcloud25 (php app)).

Reported here: rhbz#2169537 – Nextcloud 25 is shipped with wrong PHP version

Seems like the maintainer is non-responsive: rhbz#2103756 – Non-responsive maintainer check for lcts