diem/diem · critical
Automatically building Move code failed. Need to manually re
Error message
Automatically building Move code failed. Need to manually resolve the issue using the CLI
What it means
A panic raised when the 'df-cli sandbox publish' subprocess ran but did not succeed: its exit status was a failure, or it unexpectedly produced stdout/stderr output (the check in build_move_sources treats any output on a successful publish as invalid). It indicates the Move code could not be compiled automatically and requires manual resolution.
Source
Thrown at shuffle/genesis/src/lib.rs:82
let diem_root_key_path = node_config_dir.join("mint.key");
let serialized_keys = bcs::to_bytes(&root_keys.root_key).unwrap();
let mut key_file = std::fs::File::create(&diem_root_key_path).unwrap();
key_file.write_all(&serialized_keys).unwrap();
Ok(validators.pop().unwrap())
}
pub fn build_move_sources() -> Result<()> {
// Build the Move code to ensure we get the latest changes in script builders + the genesis WriteSet
utils::time_it("Building Move code", || {
let output = Command::new("df-cli")
.args(&["sandbox", "publish"])
.current_dir(MOVE_CODE_DIR)
.output()
.expect("Failure building Move code");
if !output.status.success() || !output.stdout.is_empty() || !output.stderr.is_empty() {
io::stdout().write_all(&output.stdout).unwrap();
panic!("Automatically building Move code failed. Need to manually resolve the issue using the CLI");
}
});
// Hack: remove the Debug module because attempting to publish it in genesis will fail.
// The issue is that the module uses native functions that are only included in a VM built with
// certain flags enabled.
// TODO: better solution for this
let debug_module_path = Path::new(MOVE_BYTECODE_DIR);
fs::remove_file(debug_module_path.join("Debug.mv"))?;
// Generate script ABIs
utils::time_it("Generating script ABIs", || {
release::generate_script_abis(Path::new(COMPILED_SCRIPTS_ABI_DIR))
});
// Generate script builders in Rust
utils::time_it("Generating Rust script builders", || {
release::generate_script_builder(
Path::new(TRANSACTION_BUILDERS_GENERATED_SOURCE_PATH),View on GitHub (pinned to fc4714a8ea)
Solutions
- Run `df-cli sandbox publish` manually in MOVE_CODE_DIR to see the real compiler errors
- Fix the Move source errors it reports
- Clear stale build artifacts/cache and rebuild
- If only warnings are printed on success, update the CLI or silence the output so the empty-stdout check passes
- Temporarily remove problematic modules (e.g. the Debug module with flag-gated natives) before building
Example fix
// manually reproduce the failure
cd <repo>/move/code && df-cli sandbox publish
// then fix e.g.:
// before: script { use 0x1::Debug; ... }
// after: remove the Debug module usage (natives only in flag-enabled VM builds) Defensive patterns
Strategy: retry
Validate before calling
# shell: smoke-test the Move build before genesis
cd <repo>/move/code && df-cli sandbox publish >/dev/null 2>&1 \
|| { echo "Move build failing; fix errors before genesis"; exit 1; } Try / catch
// Rust: run the CLI manually first and surface compiler output
let out = Command::new("df-cli").args(&["sandbox","publish"]).current_dir(MOVE_CODE_DIR).output()
.expect("Failure building Move code");
if !out.status.success() {
io::stderr().write_all(&out.stderr).unwrap();
panic!("Move build failed; fix compiler errors above, then rerun");
} Prevention
- Compile Move sources in CI to catch errors before genesis
- Fix or remove flag-gated native modules (e.g. Debug) before building
- Clear stale build artifacts after toolchain upgrades
- Treat any CLI stdout/stderr on publish as a failure signal and investigate
When it happens
Trigger: Move sources in MOVE_CODE_DIR have compile errors, dependency conflicts, or df-cli prints any warning/output during sandbox publish, tripping the `!status.success() || !stdout.is_empty() || !stderr.is_empty()` condition.
Common situations: Editing Move modules and introducing a compile error, stale build artifacts, VM native-function flag mismatches (as noted by the adjacent Debug-module comment), or CLI emitting deprecation warnings on stdout.
Related errors
- Failure building Move code
- Failed to run rustfmt on generated code
- main() cannot be native
- ICE error should have been thrown
- ICE break/continue not translated to jumps
AI-assisted analysis of diem/diem@fc4714a8ea (2026-09-04).
Data as JSON: /api/errors/704fabb7d1e0c2b6.
Report an issue: GitHub.