flxzt/rnote · error
Settings schema not found.
Error message
Settings schema not found.
What it means
Thrown by RnAppWindow::setup_settings_binds when app.app_settings() returns None, i.e. the GioSettings wrapper for the application's GSettings schema could not be constructed. Without the schema, no settings can be bound and the window setup aborts.
Solutions
- Compile and install schemas: run glib-compile-schemas on the schemas dir and ensure `meson install`/build installs them
- Set GSETTINGS_SCHEMA_DIR to the directory containing the compiled schema when running unbuilt/debug binaries
- Verify the schema id in the code matches the id in the .gschema.xml file
- Check the flatpak/sandbox manifest includes the schema in its export
Example fix
// before (shell) cargo run // after (shell) glib-compile-schemas crates/rnote-ui/data/resources # or the build output dir export GSETTINGS_SCHEMA_DIR=target_dir_with_schemas cargo run
Defensive patterns
Strategy: try-catch
Validate before calling
let schema_dir = std::env::var("GSETTINGS_SCHEMA_DIR").unwrap_or_default();
assert!(std::path::Path::new(&schema_dir).join("gschemas.compiled").exists(), "compiled schemas missing in {schema_dir}"); Try / catch
let Some(app_settings) = app.app_settings() else {
log::error!("GSettings schema not found; check GSETTINGS_SCHEMA_DIR and schema installation");
return Ok(()); // degrade gracefully instead of failing window init
}; Prevention
- Always run the app with schemas compiled and installed (meson install or glib-compile-schemas)
- Set GSETTINGS_SCHEMA_DIR when running debug builds
- Keep the schema id in code in sync with the .gschema.xml file
- Verify schema export in flatpak manifests
When it happens
Trigger: GSettings schema compiled with glib-compile-schemas is missing at runtime — wrong GSETTINGS_SCHEMA_DIR, schema not installed (meson build without install step), or an incorrect schema id when creating the app_settings.
Common situations: Running a debug build without `meson compile` install of schemas, flatpak sandbox missing the schema, GSETTINGS_SCHEMA_DIR pointing to the wrong directory, or renaming the schema id without updating code.
Related errors
- value in `stroke_components` array is not a JSON Object.
- BrushStyle try_from:: () for value failed
- EraserStyle try_from
- SelectorStyle try_from
- ShaperStyle try_from
AI-assisted analysis of flxzt/rnote@bbc5354502 (2026-09-08).
Data as JSON: /api/errors/6c4d2bdbbfa842ca.
Report an issue: GitHub.
Appendix: source
Thrown at crates/rnote-ui/src/appwindow/appsettings.rs:13
// Imports
use crate::appwindow::RnAppWindow;
use adw::{prelude::*, subclass::prelude::*};
use gtk4::{gdk, glib, glib::clone};
use tracing::error;
impl RnAppWindow {
/// Setup settings binds.
pub(crate) fn setup_settings_binds(&self) -> anyhow::Result<()> {
let app = self.app();
let app_settings = app
.app_settings()
.ok_or_else(|| anyhow::anyhow!("Settings schema not found."))?;
app.style_manager().connect_color_scheme_notify(clone!(
#[weak]
app_settings,
move |style_manager| {
let color_scheme = match style_manager.color_scheme() {
adw::ColorScheme::Default => String::from("default"),
adw::ColorScheme::ForceLight => String::from("force-light"),
adw::ColorScheme::ForceDark => String::from("force-dark"),
_ => String::from("default"),
};
if let Err(e) = app_settings.set_string("color-scheme", &color_scheme) {
error!("Failed to set setting `color-scheme`, Err: {e:?}");
}
}
));
View on GitHub (pinned to bbc5354502)