{"record":{"id":"9e8aa753fc25c1c5","repo":"mudler/LocalAI","slug":"acestep-cpp-fatal-cannot-read-gguf-metadata-fro","errorCode":null,"errorMessage":"[acestep-cpp] FATAL: cannot read GGUF metadata from %s\\n","messagePattern":"\\[acestep-cpp\\] FATAL: cannot read GGUF metadata from (.+?)\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"backend/go/acestep-cpp/cpp/goacestepcpp.cpp","lineNumber":99,"sourceCode":"\n    // Read DiT GGUF metadata + silence_latent\n    {\n        GGUFModel gf = {};\n        if (gf_load(&gf, dit_model_path)) {\n            g_is_turbo           = gf_get_bool(gf, \"acestep.is_turbo\");\n            const void * sl_data = gf_get_data(gf, \"silence_latent\");\n            if (sl_data) {\n                g_silence_full.resize(15000 * 64);\n                memcpy(g_silence_full.data(), sl_data, 15000 * 64 * sizeof(float));\n                fprintf(stderr, \"[acestep-cpp] silence_latent: [15000, 64] loaded\\n\");\n            } else {\n                fprintf(stderr, \"[acestep-cpp] FATAL: silence_latent not found in %s\\n\", dit_model_path);\n                gf_close(&gf);\n                return 2;\n            }\n            gf_close(&gf);\n        } else {\n            fprintf(stderr, \"[acestep-cpp] FATAL: cannot read GGUF metadata from %s\\n\", dit_model_path);\n            return 2;\n        }\n    }\n\n    // Load VAE model\n    fprintf(stderr, \"[acestep-cpp] Loading VAE from %s\\n\", vae_model_path);\n    vae_ggml_load(&g_vae, vae_model_path);\n    g_vae_loaded = true;\n\n    fprintf(stderr, \"[acestep-cpp] All models loaded successfully (turbo=%d)\\n\", g_is_turbo);\n    return 0;\n}\n\nint generate_music(const char * caption, const char * lyrics, int bpm,\n                   const char * keyscale, const char * timesignature,\n                   float duration, float temperature, bool instrumental,\n                   int seed, const char * dst, int threads) {\n    if (!g_dit_loaded || !g_vae_loaded) {","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/mudler/LocalAI/blob/44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26/backend/go/acestep-cpp/cpp/goacestepcpp.cpp#L81-L117","documentation":"acestep-cpp fatal: gf_load() could not open/parse the DiT GGUF even at the metadata level, so neither is_turbo nor silence_latent can be read; load_model returns 2. Distinct from error 155 (file readable, tensor missing) — here the file itself is unreadable as GGUF.","triggerScenarios":"dit_model_path is a nonexistent path, a directory, an empty/truncated file (interrupted download), or a non-GGUF file (e.g. a safetensors or HTML error page saved by a failed fetch); gf_load fails outright.","commonSituations":" curl failures saving 404 pages as model files; partial uploads to model storage; wrong mount paths in containers; file corrupted in transfer.","solutions":["Verify the path: ls -l and file <dit_model_path> — it must be a regular, GGUF-magic file of the expected size.","Re-download from the canonical gallery URL and checksum before use.","Fix container mounts/volume paths so the backend sees the same file you validated."],"exampleFix":"# before\n$ file models/dit.gguf\nmodels/dit.gguf: HTML document   # failed download -> FATAL cannot read GGUF metadata\n\n# after\n$ file models/dit.gguf\nmodels/dit.gguf: data   # GGUF magic present, expected size -> loads","handlingStrategy":"validation","validationCode":"# accept only well-formed GGUF files of the expected size\nfile \"$DIT\" | grep -q 'data' || { echo 'not a GGUF: '\"$DIT\" >&2; exit 1; }\n[ \"$(stat -c%s \"$DIT\")\" -eq \"$EXPECTED_BYTES\" ] || { echo 'size mismatch' >&2; exit 1; }","typeGuard":"bool is_gguf_file(const char *path) {\n    FILE *f = fopen(path, \"rb\");\n    if (!f) return false;\n    char magic[4] = {0};\n    bool ok = fread(magic, 1, 4, f) == 4 && memcmp(magic, \"GGUF\", 4) == 0;\n    fclose(f);\n    return ok;\n}","tryCatchPattern":null,"preventionTips":["Download with retries and verify checksums; never keep a partial file at the target path (use .part then rename).","Run a GGUF magic/size sanity check in deployment scripts before the backend starts.","Keep container mounts consistent between validation and serving environments."],"tags":["cpp","acestep","gguf","model-loading","corruption"],"backgroundTag":null,"analyzedSha":"44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26","analyzedAt":"2026-08-15T10:13:50.291Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}