{"record":{"id":"42733567ffcf235f","repo":"diem/diem","slug":"invalid-module-name-in-publish-ordering","errorCode":null,"errorMessage":"Invalid module name in publish ordering: {}","messagePattern":"Invalid module name in publish ordering: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"language/tools/move-cli/src/sandbox/commands/publish.rs","lineNumber":110,"sourceCode":"                    let res = session.publish_module(module_bytes, sender, &mut gas_status);\n                    if let Err(err) = res {\n                        explain_publish_error(err, state, module)?;\n                        has_error = true;\n                        break;\n                    }\n                }\n            }\n            Some(ordering) => {\n                let module_map: BTreeMap<_, _> = modules\n                    .into_iter()\n                    .map(|((ident, _), m)| (ident.value.module.0.value.to_string(), m))\n                    .collect();\n\n                let mut sender_opt = None;\n                let mut module_bytes_vec = vec![];\n                for name in ordering {\n                    match module_map.get(name) {\n                        None => bail!(\"Invalid module name in publish ordering: {}\", name),\n                        Some(module) => {\n                            let mut module_bytes = vec![];\n                            module.serialize(&mut module_bytes)?;\n                            module_bytes_vec.push(module_bytes);\n                            if sender_opt.is_none() {\n                                sender_opt = Some(*module.self_id().address());\n                            }\n                        }\n                    }\n                }\n\n                match sender_opt {\n                    None => bail!(\"No modules to publish\"),\n                    Some(sender) => {\n                        let res = session.publish_module_bundle(\n                            module_bytes_vec,\n                            sender,\n                            &mut gas_status,","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/diem/diem/blob/fc4714a8ea273b6efe8b13dbce72ea60aad9a16c/language/tools/move-cli/src/sandbox/commands/publish.rs#L92-L128","documentation":"When publishing with a user-supplied module ordering (e.g. via --override-ordering), publish builds a map of module name → compiled module and then looks up each name from the ordering list. This bail fires when an ordering entry doesn't match any module in the package — the name is misspelled or not part of the current package.","triggerScenarios":"`move sandbox publish --override-ordering <names...>` where one of the listed names is not a module compiled from the package (typo, wrong address prefix, module removed from sources).","commonSituations":"Renaming a module in source but keeping the old name in a publish script; ordering lists copied from another package; missing named-address prefix in the ordering entry.","solutions":["Correct the ordering entry to exactly match a module in the package (name as it appears in the module map, e.g. `0x42::storage`).","Re-run `move build` and list the package's modules to confirm the exact names, then fix the ordering.","Remove stale entries from publish scripts/ordering files after renaming or deleting modules."],"exampleFix":"// before\n$ move sandbox publish --override-ordering 0x42::stoarge build/my_pkg\nInvalid module name in publish ordering: 0x42::stoarge\n\n// after (typo fixed)\n$ move sandbox publish --override-ordering 0x42::storage build/my_pkg","handlingStrategy":"validation","validationCode":"// Validate ordering names against the built module map before publishing\nfor name in ordering {\n    if !module_map.contains_key(name) {\n        fatal(format!(\"unknown module in ordering: {}\", name));\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Regenerate ordering lists after renaming/removing modules","Use exact addr::module names as they appear in sources","Validate ordering against `move build` output before publishing in CI"],"tags":["move","publish","cli","ordering"],"backgroundTag":"invalid-module-name","analyzedSha":"fc4714a8ea273b6efe8b13dbce72ea60aad9a16c","analyzedAt":"2026-09-04T21:07:05.890Z","contentChangedAt":"2026-09-04T21:07:05.890Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}