{"record":{"id":"19091e8aed7bbc27","repo":"getzola/zola","slug":"config-name-is-not-valid-utf-8","errorCode":null,"errorMessage":"Config name is not valid UTF-8.","messagePattern":"Config name is not valid UTF-8\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cmd/serve.rs","lineNumber":672,"sourceCode":"\n            log::info!(\n                \"Web server is available at {} (bound to {})\\n\",\n                constructed_base_url.replace(&bind_address.to_string(), &local_addr.to_string()),\n                local_addr\n            );\n            if open && let Err(err) = open::that(&constructed_base_url) {\n                log::error!(\"Failed to open URL in your browser: {err}\");\n            }\n\n            axum::serve(listener, app).await.expect(\"Could not start web server\");\n        });\n    });\n\n    // We watch for changes in the config by monitoring its parent directory, but we ignore all\n    // ordinary peer files. Map the parent directory back to the config file name to not confuse\n    // the end user.\n    let config_name =\n        config_path.file_name().unwrap().to_str().expect(\"Config name is not valid UTF-8.\");\n    let watch_list = watchers\n        .iter()\n        .map(|w| if w == root_dir_str { config_name } else { w })\n        .collect::<Vec<&str>>()\n        .join(\",\");\n    log::info!(\n        \"Listening for changes in {}{}{{{}}}\",\n        root_dir.display(),\n        MAIN_SEPARATOR,\n        watch_list\n    );\n\n    let preserve_dotfiles_in_output = site.config.preserve_dotfiles_in_output;\n\n    log::info!(\"Press Ctrl+C to stop\\n\");\n    // Clean the output folder on ctrl+C\n    ctrlc::set_handler(move || {\n        match clean_site_output_folder(&output_path, preserve_dotfiles_in_output) {","sourceCodeStart":654,"sourceCodeEnd":690,"githubUrl":"https://github.com/getzola/zola/blob/61d30828217957120309db657950224edf9707e2/src/cmd/serve.rs#L654-L690","documentation":"Inside the server thread, serve() turns the config file path into a string to hand to the file watcher (the config's parent directory is monitored for reloads). The conversion fails when the config path is not valid UTF-8, so the watcher cannot be set up for the config file and live-reload of config changes would silently not work; the expect aborts the thread to make the incompatibility explicit.","triggerScenarios":"Thrown at src/cmd/serve.rs:672 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rename the config file (and its parent directories) to use only valid UTF-8 characters","Pass the path to the watcher as OsStr/Path bytes instead of converting to str","Return a descriptive error naming the offending path instead of expect()"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"61d30828217957120309db657950224edf9707e2","analyzedAt":"2026-09-03T14:39:09.727Z","contentChangedAt":"2026-09-03T14:39:09.727Z","schemaVersion":2},"datasetVersion":"2026-09-10T17:17:09.494Z"}