Update fails on Homes with the local AI engine: sealed llama.cpp tree cannot be replaced (2.0.1)

Abierto
#515 5 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
rust
Área
backend, devops

Línea de trabajo

Start with setup/local_model_engine_receipt.rs, setup.rs around lines 3697–3760, and install_transaction/support.rs to trace how the sealed llama.cpp tree is copied, replaced, and removed. Reproduce the failed update path with an installed engine archive that changes, then evaluate whether directory write permissions are needed when receipt checks already verify file hashes and modes. Done means the update and recovery paths safely handle the chosen sealing design, with tests covering interrupted updates.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Problem

Updating a Home that has the local AI engine (llama.cpp) installed fails when the release changes the engine archive. Seen 2 Nov 2026, rc.1 -> 2.0.0-rc.2 on a Mac (darwin archive sha256 5c182a73 -> a3ba8ae2; Linux archives unchanged).

  • CLI: update refused; original release files restored / Trusted source Carrier fetch failed for llama-server (...): Permission denied (os error 13).
  • System: "The update could not be completed." Each try leaves a sealed ~780 MB DATA/.tmp*.

Cause (7bc3704b5)

Setup seals the engine tree (dirs 0500, files 0400; receipt check requires it, setup/local_model_engine_receipt.rs). setup.rs atomic_copy_dir swaps the new tree in, then remove_dir_all on the old sealed tree -> EACCES. System path: install_transaction/support.rs copy_tree creates the 0500 dir before its children -> EACCES. Fresh installs do not include llama-server (not in profile home); rc.2 -> 2.0.0 ships byte-identical engine archives on every platform, so that hop restages nothing (plan_update_support, setup.rs ~3697-3760).

Workaround (used on a real Mac Home)

Move DATA/libexec/llama.cpp aside, chmod -R u+w and delete DATA/.tmp*, stop Home, elastos update --yes, start Home. The engine is reinstalled at the new version on start.

Fix branch

fix/2.0-sealed-tree-removal (unpushed): 98651b7e8 (proof on a sealed clone, CLI path rc.1 -> rc.2 exit 0), 5f6920475, 957cb64c2. Codex reviews: FAIL (P1 path walk, P1 chmod by path, P2 recovery) -> FAIL (P2 recovery accepts 0700 root) -> FAIL (3 x P2 on the reseal record: interrupted record creation, record used before scratch validation, record deletion durable before reseal).

Design question before any further attempt

All three attempts share one assumption: installed and staged engine directories must be 0500, so every move, copy, removal and crash recovery has to unseal and reseal them. Each attempt adds crash windows. Test that assumption first: the owner can always chmod its own directories, so 0500 directories give no protection against the same user; the receipt's content hashes do. Candidate: seal files only (0400), keep engine directories 0700, receipt checks hashes and file modes. Then the plain swap/remove/rename paths work unchanged. Constraint either way: a Home's update runs the OLD release's support code, so until a release with the fix is installed, no release may change a llama-server archive that existing Homes have installed.

Lenguaje dominante
Rust
Estrellas
6
Forks
2
Merge medio
1 d 3 h
PR fusionados (30 d)
42

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de elastos/elastos-runtime

Todos los issues de elastos/elastos-runtime

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.