{"record":{"id":"0f1297912144936d","repo":"mudler/LocalAI","slug":"moss-tts-cpp-fatal-moss-local-load-failed-n","errorCode":null,"errorMessage":"[moss-tts-cpp] FATAL: moss_local_load failed\\n","messagePattern":"\\[moss-tts-cpp\\] FATAL: moss_local_load failed\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"backend/go/moss-tts-cpp/cpp/mossttscpp.cpp","lineNumber":53,"sourceCode":"        fprintf(stderr, \"[moss-tts-cpp] ERROR: local_path is required\\n\");\n        return 1;\n    }\n    if (!codec_path || codec_path[0] == '\\0') {\n        fprintf(stderr, \"[moss-tts-cpp] ERROR: codec_path is required\\n\");\n        return 2;\n    }\n    if (!tokenizer_path || tokenizer_path[0] == '\\0') {\n        fprintf(stderr, \"[moss-tts-cpp] ERROR: tokenizer_path is required\\n\");\n        return 3;\n    }\n\n    fprintf(stderr,\n            \"[moss-tts-cpp] Loading local=%s codec=%s tokenizer=%s\\n\",\n            local_path, codec_path, tokenizer_path);\n\n    g_local = moss_local_load(local_path, codec_path, tokenizer_path);\n    if (!g_local) {\n        fprintf(stderr, \"[moss-tts-cpp] FATAL: moss_local_load failed\\n\");\n        return 4;\n    }\n    fprintf(stderr, \"[moss-tts-cpp] Model loaded (%s)\\n\", moss_tts_version());\n    return 0;\n}\n\nfloat *mtl_tts(const char *text, const char *reference_wav, int seed,\n               int *out_n, int *out_sr) {\n    if (out_n)\n        *out_n = 0;\n    if (out_sr)\n        *out_sr = 0;\n    if (!g_local) {\n        fprintf(stderr, \"[moss-tts-cpp] ERROR: model not loaded\\n\");\n        return nullptr;\n    }\n    if (!text || text[0] == '\\0') {\n        fprintf(stderr, \"[moss-tts-cpp] ERROR: text is required\\n\");","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/mudler/LocalAI/blob/44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26/backend/go/moss-tts-cpp/cpp/mossttscpp.cpp#L35-L71","documentation":"mtl_load() passed argument validation but moss_local_load() returned NULL (return 4). This is the real engine-level failure: the runtime could not load the main model + codec + tokenizer trio. The engine's own logging (routed through ggml_log_cb) appears above this line and carries the precise cause.","triggerScenarios":"Any of the three supplied paths pointing to missing, truncated, or incompatible files; version mismatch between main model and codec/tokenizer artifacts; ggml backend allocation failure (OOM) during weight loading.","commonSituations":"Mixing artifacts from different Moss TTS releases; interrupted downloads; loading on a host with insufficient RAM for the full model; missing CPU feature (AVX etc.) causing backend init failure inside the engine.","solutions":["Read the engine log lines above the FATAL — moss_local_load logs the exact failing artifact or allocation.","Verify all three files exist with expected sizes and come from the same release.","Free other loaded backends or add RAM/swap if OOM.","Re-download the model set from the gallery to rule out corruption."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"for _, p := range []string{modelPath, codecPath, tokenizerPath} {\n    if fi, err := os.Stat(p); err != nil || fi.Size() == 0 {\n        return fmt.Errorf(\"moss artifact invalid: %s\", p)\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pre-flight stat all three artifacts and compare sizes to the gallery manifest.","Keep model/codec/tokenizer from the same release.","Capture engine logs (ggml_log_cb routes them) to pinpoint which artifact failed."],"tags":["moss-tts-cpp","tts","model-loading","oom"],"backgroundTag":null,"analyzedSha":"44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26","analyzedAt":"2026-08-15T10:13:50.291Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}