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

Offen
#515 5 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
25/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
rust
Bereich
backend, devops

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
Rust
Sterne
6
Forks
2
Ø Merge
1 T. 3 Std.
Gemergte PRs (30 T.)
42

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus elastos/elastos-runtime

Alle Issues in elastos/elastos-runtime

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.