-
-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nextcloud module: changing config doesn't propagate to the module #49783
Comments
@Ekleog that's a bit tough. We have a We use the This CLI generates The script checks the presence of If you now change configuration from the module, we won't run the install command again, as the config file already exists, and |
Hmm… Maybe it would be possible to generate the Now, I don't really know what |
I don't recommend to do this, I just tried that (after upgrading one of my personal systems) and this tries to recreate a database schema which can end in very bad results.
Unfortunately I doubt that this will work properly, nextcloud wants to merge this during the runtime. E.g. it adds a I'm using this as well now and hitting these issues, unfortunately I don't have useful ideas either ATM, but I'm happy to discuss better solutions :) |
Nextcloud edits it's |
That's certainly a good thing to do. If nobody else wants to take over, I'd volunteer to do this during the next week as investing time on improving the nextcloud module is one item on my todo list :) @flokli I was aware of |
…t upgrading issues Part of NixOS#49783. NextCloud tracks in its `config.php` the application's state which makes it hard for the module to modify configurations during upgrades. It will take time until the issue is properly fixed, therefore we decided to warn about this in the manual. This PR addresses two things: * Adding a basic example for nextcloud. I figured it to be helpful to add some basic usage instructions when adding a new manual entry. Advanced documentation may follow later. For now this document actively links to the service options, so users are guided to the remaining options that can be helpful in certain cases. * Add a warning about upgrades and manual changes in `/var/lib/nextcloud`. This will be fixed in the future, but it's definetely helpful to document the current issues in the manual (as proposed in NixOS#49783 (comment)).
…t upgrading issues Part of NixOS#49783. NextCloud tracks in its `config.php` the application's state which makes it hard for the module to modify configurations during upgrades. It will take time until the issue is properly fixed, therefore we decided to warn about this in the manual. This PR addresses two things: * Adding a basic example for nextcloud. I figured it to be helpful to add some basic usage instructions when adding a new manual entry. Advanced documentation may follow later. For now this document actively links to the service options, so users are guided to the remaining options that can be helpful in certain cases. * Add a warning about upgrades and manual changes in `/var/lib/nextcloud`. This will be fixed in the future, but it's definetely helpful to document the current issues in the manual (as proposed in NixOS#49783 (comment)). (cherry picked from commit 216a954)
…t upgrading issues Part of #49783. NextCloud tracks in its `config.php` the application's state which makes it hard for the module to modify configurations during upgrades. It will take time until the issue is properly fixed, therefore we decided to warn about this in the manual. This PR addresses two things: * Adding a basic example for nextcloud. I figured it to be helpful to add some basic usage instructions when adding a new manual entry. Advanced documentation may follow later. For now this document actively links to the service options, so users are guided to the remaining options that can be helpful in certain cases. * Add a warning about upgrades and manual changes in `/var/lib/nextcloud`. This will be fixed in the future, but it's definetely helpful to document the current issues in the manual (as proposed in #49783 (comment)). (cherry picked from commit 216a954)
In the light of this issue, what's the correct way to upgrade nextcloud to a new major version? Do I just pull a newer |
The As long as you let Nextcloud do its job, you shouldn't get that much issues. IMHO the actual problem here is the configuration of the software within Nix(OS). |
just a simple question (could not come to a conclusion after the lengthy thread) but I recently updated my nextcloud via nixops deploy and the update disabled the calendar module. Did I mess up or is that expected ? any way to configure this from nix ? |
Assuming that you installed the calendar module via the UI, it is installed in
So in principle nextcloud can edit the apps installed via the web interface (otherwise you couldn't install them via the interface in the first place). |
I don't think there's anything actionable here - the nextcloud nixos module is limited by how Nextcloud (imperatively) manages its configuration. The current state is properly documented in |
@flokli I think one actionable item would be to have the nextcloud service fail with an explicit error if the configuration being used is not compatible with the configuration defined in the .nix. At least the user would be warned in practice that configuration is not really applied, and not only by the manual that they are relatively unlikely to actually read. Reopening for now, feel free to reclose if you think that's not a reasonable “solution” :) |
The problem is we don't know whether the configuration on disk containing database connection information ( If I'm not missing something obvious, checking configuration changes would translate to parsing/evaluating config.php on every nextcloud startup as an |
Since upstream mixes state and config it's questionable whether their configuration format is somehow supposed to be backwards-compatible (as it's only supposed to be used internally by Nextcloud). Hence I'm afraid that this will make i.e. upgrades even harder in case of configuration changes, so 👎 from me. As the issues are documented in the manual now, folks are warned and I think that this is a better option in contrast to adding more complexity to I suggest we either close this for the reasons @flokli already stated or wait for an appropriate upstream fix. |
I really don't feel good having stuff in Something that would sound nicer to me would be an At least the error is obvious (enabling the module without having run the executable would fail), all module options actually mean something, and the impure operation is made explicit. Either that or, similar to Would one of these solutions make sense to you? |
Me neither, but currently we don't have much choice…
I really like the fact that we can set up the Nextcloud instance in an unattended fashion, without having to worry about manual setting things up.
In theory, we could move some of the options in Really, this issue only occurs while a user changes nextcloud database parameters (mostly while tweaking his initial setup), and not having read the module documentation, where the behaviour is documented. What about adding the following (subtile) log statement, to point users to the docs when they peek into the logs while things are not working as expected?
|
I agree that the log statement is the minimum we can do, and would at least give a hint about the way in which things are broken. Now, I guess the reason we're kind of disagreeing on the path forward is that you're much more hopeful than me that nextcloud will ever fix its stuff -- I'm assuming it'll get fixed in years at best (and even then…) -- and if it's in years then I'd much rather live with Now urhm, I'm investigating the module a bit deeper, and… is there any reason we can't put the database configuration etc. in |
After having a deeper look at the sources ( Configs will be loaded from If I understand the code correctly, I assume that it should be possible to render all config options in [1] |
@Ma27 Nice catch! This might indeed be possible - we should make very sure that config overrides work the way we think they will - While I'd still prefer nextcloud splitting config and state properly, and being able to cope with read-only (base) config - it might be a direction worth exploring. What do you think? |
Well, for the record it was actually @Ekleog's idea 😅
I guess so, all the stuff from I can't promise that, but unless anybody beats me, I can hopefully prepare a fix for this :) |
@Ma27 Did you gain some new insights on this? |
Unfortunately not... I was pretty busy back then. But as this only requires some fiddling in the module and no patching of the actual package, the change shouldn't be too painful, so if you'd like to take over... 😅 |
One of the main problems of the Nextcloud module is that it's currently not possible to alter e.g. database configuration after the initial setup as it's written by their imperative installer to a file. After some research[1] it turned out that it's possible to override all values with an additional config file. The documentation has been slightly updated to remain up-to-date, but the warnings should remain there as the imperative configuration is still used and may cause unwanted side-effects. Also simplified the postgresql test which uses `ensure{Databases,Users}` to configure the database. Fixes NixOS#49783 [1] NixOS#49783 (comment)
Data that was once config and recorded on
${dataDir}/config/config.php
doesn't get updated when the configuration changes.This is a violation of purity. And more than that, it's very surprising when trying to install, hesitating between pgsql and sqlite, and struggling before understanding that the configuration doesn't get used anyway :p
cc @globin @flokli @eqyiel @fpletz
The text was updated successfully, but these errors were encountered: