fix(worker): restore getpwnam execuser-existence check (bug-1507 merge regression)

The scheduler-framework merge (4e894d21) reverted the bug-1507 fix from
c091a8da: job_start_local_task fell back to nobody only when execuser was
EMPTY, not when it does not exist on the worker host — a submit-user missing
from /etc/passwd makes systemd fail the worker unit with EXIT_USER (217) and
every job dies. Restored the getpwnam() existence check (+ #include <pwd.h>).
All 21 worker tests pass; fallback log message verified in the built xcecd.

Also records the merge-overwrite lesson in cerebrum Do-Not-Repeat: after any
branch-sync merge, re-verify each previously-fixed bug's marker symbol
survived (git show <merge>:<file> | grep -c <symbol> vs <merge>^).
This commit is contained in:
lei.chen 2026-08-27 13:11:09 +00:00
parent 10865a4e63
commit 05ac57b183
4 changed files with 26 additions and 5 deletions

View file

@ -14867,20 +14867,22 @@
"error_message": "\u4f5c\u4e1a\u63d0\u4ea4\u540e\u7acb\u5373 EXIT: systemd \u5355\u5143 xcecd-worker-<jobid>.service \u5931\u8d25, status=217/USER (\u670d\u52a1\u7528\u6237\u4e0d\u5b58\u5728). \u7528\u6237 1-0-1785897786-0 \u7b49\u5168\u90e8\u5931\u8d25.",
"file": "src/worker/src/controller_connector.c (job_start_local_task)",
"root_cause": "apiserver bug-1500 \u4fee\u590d\u8bbe\u7f6e si.execuser=resolveExecUser(job)=\"admin\" (\u63d0\u4ea4\u7528\u6237). \u4f46 admin \u5728 worker \u4e3b\u673a /etc/passwd \u4e0d\u5b58\u5728. worker \u628a limits->user_name \u8bbe\u4e3a execuser, start_systemd_job \u751f\u6210 User=admin \u5355\u5143 -> systemd EXIT_USER 217 -> \u4f5c\u4e1a\u5931\u8d25. \u4e4b\u524d execuser \u4e3a\u7a7a\u65f6\u9ed8\u8ba4 nobody(\u5b58\u5728) \u80fd\u8dd1, bug-1500 \u90e8\u7f72\u540e\u53d8\u6210 admin \u53cd\u800c\u5168\u5931\u8d25.",
"fix": "job_start_local_task \u7528 getpwnam() \u68c0\u67e5 execuser \u662f\u5426\u5b58\u5728; \u4e0d\u5b58\u5728\u5219\u56de\u9000 nobody. \u4f5c\u4e1a\u4ee5 nobody \u8fd0\u884c(\u7528\u6237\u5df2\u786e\u8ba4\u73b0\u9636\u6bb5\u53ef\u4ee5).",
"fix": "job_start_local_task \u7528 getpwnam() \u68c0\u67e5 execuser \u662f\u5426\u5b58\u5728; \u4e0d\u5b58\u5728\u5219\u56de\u9000 nobody. \u4f5c\u4e1a\u4ee5 nobody \u8fd0\u884c(\u7528\u6237\u5df2\u786e\u8ba4\u73b0\u9636\u6bb5\u53ef\u4ee5). [2026-08-26 UPDATE] MERGE REGRESSION: the getpwnam() existence check was reverted by merge commit 4e894d21 (Rongsong scheduler-framework sync) \u2014 controller_connector.c now falls back to nobody only when execuser is empty, not when it does not exist (getpwnam gone from whole tree, verified 0 hits; chatbot^ had 1). admin exists on t1 /etc/passwd so not currently triggering, but latent \u2014 restore the getpwnam check (c091a8da had it). [2026-08-26] RESTORED: re-applied getpwnam() check in job_start_local_task (+ #include <pwd.h>), aligned to c091a8da. Worker builds clean, all 21 worker tests pass (controller_connector_test 15/0, resource_sync 2/0, xcecd_startup 2/0, dbus_workers 2/0). Verified the fallback log message is in the built xcecd binary.",
"tags": [
"worker",
"execuser",
"systemd",
"217",
"nobody",
"regression"
"regression",
"merge-regression",
"needs-restore"
],
"related_bugs": [
"bug-1500"
],
"occurrences": 1,
"last_seen": "2026-08-05"
"occurrences": 2,
"last_seen": "2026-08-26T12:00:00Z"
},
{
"id": "bug-1508",