Skip to content

Conversation

drupol
Copy link
Contributor

@drupol drupol commented Aug 6, 2025

I wish I could understand why this issue is happening right now, never had the issue before.

Anyway, this should fix #430433 but there might be data losses.

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@drupol drupol mentioned this pull request Aug 6, 2025
3 tasks
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Aug 6, 2025
Copy link
Contributor

@74k1 74k1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Attribute statedir is missing. You probably meant to write stateDir.

@74k1
Copy link
Contributor

74k1 commented Aug 6, 2025

This seems to have fixed the readonly db issue.

I already lost my webui.db before while upgrading as mentioned in the addressed issue already.

I'm now able to setup everything again at least! Thanks a lot 😄

@drupol
Copy link
Contributor Author

drupol commented Aug 6, 2025

Cool, I'll rebase this properly when I'm back at my office.

@drupol drupol force-pushed the push-runvvntkkosm branch from bc3d049 to af749a3 Compare August 6, 2025 14:02
@drupol drupol marked this pull request as ready for review August 6, 2025 14:02
@nixpkgs-ci nixpkgs-ci bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Aug 6, 2025
@drupol drupol merged commit 539300c into NixOS:master Aug 6, 2025
26 of 31 checks passed
colemickens pushed a commit to colemickens/nixpkgs that referenced this pull request Aug 6, 2025
@MayNiklas
Copy link
Member

I have not yet deleted my database.
For me, this change does not fix the issue (I'm on nixos-unstable-small with already contains this merge).
I'll guess this won't work without data losses?

@74k1
Copy link
Contributor

74k1 commented Aug 6, 2025

@MayNiklas You can try setting the changes from here manually in your own config (before updating to 0.6.18) like this:

services.open-webui = {
	enable = true;
	...
	environment = {
		STATIC_DIR = "${config.services.open-webui.stateDir}/static";
		DATA_DIR = "${config.services.open-webui.stateDir}/data";
		HF_HOME = "${config.services.open-webui.stateDir}/hf_home";
		SENTENCE_TRANSFORMERS_HOME = "${config.services.open-webui.stateDir}/transformers_home";
	};
};

then moving your data (webui.db cache/* uploads/* vector_db/*) from ${cfg.stateDir} into ${cfg.stateDir}/data/

sudo cp /var/lib/open-webui/webui.db /var/lib/open-webui/data
sudo cp -r /var/lib/open-webui/cache /var/lib/open-webui/data
sudo cp -r /var/lib/open-webui/uploads /var/lib/open-webui/data
sudo cp -r /var/lib/open-webui/vector_db /var/lib/open-webui/data

and finally, try to update to the 0.6.18 version of open-webui.

However, I'm not entirely sure if this will work as I've lost my own data. Make sure to have a backup at least. 😄

I've just confirmed with @pinage404 that this method works without data loss!

@drupol
Copy link
Contributor Author

drupol commented Aug 8, 2025

I still don't understand why moving stuff from one directory into a subdirectory would make things magically work. Can you explain?

@74k1
Copy link
Contributor

74k1 commented Aug 8, 2025

I unfortunately also have no idea why this change suddenly seems to work.

When testing this PR, I noticed, new data (databases, etc.) would be saved and written under /var/lib/open-webui/data (as per DATA_DIR). This prompted me to test the behaviour with upgrading as well. And lo and behold, it worked.

#430433 (comment) mentions, that it was just to match upstream defaults.

Happy to test anything if wanted. 👍

@drupol
Copy link
Contributor Author

drupol commented Aug 8, 2025

Then we have no garantee that the issue won't show up again?

@74k1
Copy link
Contributor

74k1 commented Aug 8, 2025

It's really a mystery to me as well.
I'm hopeful that this settles it, as it's now at least "upstream defaults" and therefore more reproducible upstream as well (i hope?).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

open-webui: doesn't work anymore
3 participants