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

Đang mở
#515 5 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
backend, devops

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Rust
Star
6
Fork
2
Merge trung bình
1 ngày 3 giờ
Pull request đã merge (30 ngày)
42

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của elastos/elastos-runtime

Tất cả issue của elastos/elastos-runtime

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.