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

  1. Compile and install schemas: run glib-compile-schemas on the schemas dir and ensure `meson install`/build installs them
  2. Set GSETTINGS_SCHEMA_DIR to the directory containing the compiled schema when running unbuilt/debug binaries
  3. Verify the schema id in the code matches the id in the .gschema.xml file
  4. 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

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


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)