CreateActorTemplate accepts 1 KiB memoryBytes (OOM-killing shared worker pod on wake), get resources -a <missing-atespace> exits 0, and CreateActor/DeleteAtespace hide missing resource details
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 28/100
調査の方向性
Start with the listed validation and resource paths in api/ateapi/v1/ateapi.proto, cmd/ateapi/internal/apivalidation/actor_template.go, and internal/ocispec/ocispec.go, then trace the list, create, and delete paths cited under Affected Code Locations. Reproduce the missing-atespace and tiny-memory cases with the provided kubectl ate commands. Done means the four behaviors have clear, separately verified expected outcomes; the worker OOM containment cause is explicitly unestablished in the issue.
索引モデルが issue の本文から書いたものです。
説明
Summary & Root Cause
- Part 1: API validation enforces only
memory_bytes > 0, andociResourcespasses the value through unclamped as the container's memory limit. CPU, by contrast, is raised to a kernel floor. Nothing stops a value far below what gVisor needs to start a sandbox, so the failure moves from admission (400) to the first wake. There,runsc createis killed and the actor goes toCRASHED. The kernel OOM kill (Memory cgroup out of memory: Killed process (runsc)) also took down the shared worker container (OOMKilled, restart). One tenant template can therefore restart a worker pod that other actors may be using. The code examined here does not establish why the OOM escapes the sandbox's limit and reaches the worker container. That part is observed behavior only. - Part 2: List RPCs filter rows by atespace without checking that the atespace exists, so a typo returns an empty page with RC 0.
- Part 3:
CreateActorresolves the template before anything checks the atespace. A missing atespace and a missing template both become the sameerrActorTemplateNotFound, andapierror.FromErrordrops theObjectRefcontext thatresolveActorTemplateadded. - Part 4: The store collapses every foreign-key violation into one sentinel. The handler cannot say which child resource type (actors, templates, tags) blocks the delete, and the CLI help mentions only actors.
Affected Code Locations
- Part 1 (tiny
memoryBytesaccepted and OOM-kills worker on wake):api/ateapi/v1/ateapi.proto:1235-1248:Resources.memory_bytesonly has+k8s:minimum=0. There is no lower bound.cmd/ateapi/internal/apivalidation/zz_generated.validation.go:7541-7570: the generated check formemory_bytesisvalidate.Minimum(..., 0)only.cmd/ateapi/internal/apivalidation/actor_template.go:86-97:ValidateCustom_ActorTemplate_Resourcesrejects only== 0(Required).cmd/ateapi/internal/apivalidation/zz_generated.validation.go:7526-7531: for CPU,-100hitsMinimum(0)("must be greater than or equal to 0"), while0hits the customRequiredatactor_template.go:90-91. That is why the two errors differ.internal/ocispec/ocispec.go:63-78:ociResourcescopiesmemory_bytesunchanged into the OCIlinux.resources.memory.limit(lines 69-71). CPU gets a kernel-minimum floor (cpuQuotaMinUS, lines 53-57 and 73). Memory has no floor at all.internal/ocispec/ocispec.go:161-164: the container spec'sLinux.Resourcesis set fromociResources.
- Part 2 (
get/List*in a missing atespace exits 0):cmd/ateapi/internal/controlapi/actor.go:225-242:ListActorspasses the atespace straight to the store with no existence check. The same applies toactor_template.go:103-118(ListActorTemplates) andtag.go:87-101(ListTags, which carries// TODO: implement thisat line 99).- Contrast:
cmd/kubectl-ate/internal/cmd/access_policy.go:170-185(requireScope) callsGetAtespaceand printsatespace %q not found.
- Part 3 (
CreateActorhides whether atespace or template is missing and dropsObjectRef):cmd/ateapi/internal/controlapi/actor.go:86:CreateActorcallsresolveActorTemplatefirst.cmd/ateapi/internal/controlapi/actor_template.go:152-171:errActorTemplateNotFound = apierror.FailedPrecondition("actor template not found")(line 156), wrapped as"%w; ObjectRef: %s "(line 165).internal/apierror/apierror.go:128-139:FromErrorreturnsapiErr.Error(), the apierror's own message without the wrapping context, so theObjectRefsuffix never reaches the client.cmd/ateapi/internal/controlapi/actor.go:161-163: theAtespace %s not foundbranch exists but is unreachable for a missing atespace, because template lookup fails first.
- Part 4 (
DeleteAtespacereturns generic "not empty" message vs.--help):cmd/ateapi/internal/store/atepg/atespace.go:136-138: a foreign-key violation maps to barestore.ErrFailedPrecondition.cmd/ateapi/internal/controlapi/atespace.go:120-121: the server formats this asAtespace %s is not empty.cmd/kubectl-ate/internal/cmd/atespace.go:102:Short: "Delete an empty atespace (fails if any actors remain)".
Note: Earlier write-ups cited
actor.go:86, 161-163as the location oferrActorTemplateNotFound. At15b58199the variable and its wrapping live inactor_template.go:152-171, andactor.go:161-163is the unreachable "Atespace not found" branch.
Detailed Reproduction Guide
- Tiny memory limit:
metadata:
name: s5-mem1k
atespace: ate-demo-counter
workerSelector:
matchLabels:
workload: counter
resources:
limits:
cpuMillicores: "250"
memoryBytes: "1024"
containers:
- name: counter
image: gcr.io/<PROJECT_ID>/ate-images/counter
command:
- /ko-app/counter
kubectl ate create actor-template -f s5-mem1k.yaml
kubectl ate create actor s5-mem1k-actor -a ate-demo-counter --template s5-mem1k
# Wake through atenet-router (mTLS client), for example:
curl -sS -X POST --cert credential-bundle.pem --key credential-bundle.pem --cacert router-ca.pem \
-H "ate-target-actor: ate-demo-counter/s5-mem1k-actor" https://atenet-router.ate-system.svc/
kubectl ate get actor s5-mem1k-actor -a ate-demo-counter -o yaml
# Check the worker pod that hosted the wake for an OOM restart:
kubectl -n ate-demo-counter get pods -o custom-columns=NAME:.metadata.name,RESTARTS:.status.containerStatuses[0].restartCount,LAST:.status.containerStatuses[0].lastState.terminated.reason
kubectl get events -A --field-selector reason=OOMKilling
- CPU
0vs-100(same template withcpuMillicores: "0", then"-100"):
kubectl ate create actor-template -f s5-cpu0.yaml
kubectl ate create actor-template -f s5-cpuneg.yaml
- Missing atespace on list:
kubectl ate get actors -a does-not-exist
kubectl ate get actor-templates -a does-not-exist
kubectl ate get tags -a does-not-exist
kubectl ate get access-policy -a does-not-exist
- Missing atespace vs missing template, and the delete message:
kubectl ate create actor x -a does-not-exist --template counter
kubectl ate create actor x -a ate-demo-counter --template nope
kubectl ate delete atespace ate-demo-counter
kubectl ate delete atespace --help | head -n 1
Expected vs. Actual Behavior
- Expected:
memoryBytes: 1024is rejected at create time withInvalidArgumentand a documented minimum. A sandbox that exceeds its memory limit is contained to that actor and does not affect the worker pod. CPU0and-100produce consistent messages.- Listing in a missing atespace returns
NotFound: atespace "does-not-exist" not found, asget access-policydoes. CreateActorsays which of atespace or template is missing, including<atespace>/<template>.DeleteAtespacenames the blocking resource types, and--helpdoes not say "actors" only.
- Actual:
- The template is admitted (RC=0). The wake returns HTTP 500 and the actor goes
ACTOR_STATE_CRASHED(runsc createkilled). The shared worker container is also OOM-killed and restarted. CPU0givesRequired valuebut-100givesmust be greater than or equal to 0. - The three list commands exit 0 with only a header.
- Both
create actorcases return the identicalactor template not found. - Delete returns
Atespace ate-demo-counter is not empty, while help says(fails if any actors remain).
- The template is admitted (RC=0). The wake returns HTTP 500 and the actor goes
Observed Output & Logs
$ kubectl ate create actor-template -f s5-mem1k.yaml
ATESPACE NAME GOLDEN TAG ERROR AGE
ate-demo-counter s5-mem1k 0s
RC=0
$ ate_curl s5-mem1k-actor
error resuming actor ate-demo-counter/s5-mem1k-actor
HTTP_CODE:500
status:
assignedNode: gke-worker-node-1
crash:
crashTime: "2026-10-27T00:39:30.763493847Z"
message: 'resume failed: atelet Run: while calling worker RunWorkload: rpc error:
code = Internal desc = while creating the sandbox: while running `runsc create`:
signal: killed'
state: ACTOR_STATE_CRASHED
$ kubectl ate create actor-template -f s5-cpu0.yaml
Error: failed to create actor template: rpc error: code = InvalidArgument desc = actor_template.resources.limits.cpu_millicores: Required value
RC=1
$ kubectl ate create actor-template -f s5-cpuneg.yaml
Error: failed to create actor template: rpc error: code = InvalidArgument desc = actor_template.resources.limits.cpu_millicores: Invalid value: -100: must be greater than or equal to 0
RC=1
$ kubectl ate get actors -a does-not-exist
ATESPACE NAME TEMPLATE STATE WORKER POD WORKER IPS VERSION AGE
RC=0
$ kubectl ate get actor-templates -a does-not-exist
ATESPACE NAME GOLDEN TAG ERROR AGE
RC=0
$ kubectl ate get tags -a does-not-exist
ATESPACE NAME SCOPE STATE SNAPSHOT FIDELITY AGE
RC=0
$ kubectl ate get access-policy -a does-not-exist
Error: atespace "does-not-exist" not found
RC=1
$ kubectl ate create actor x -a does-not-exist --template counter
Error: failed to create actor: rpc error: code = FailedPrecondition desc = actor template not found
RC=1
$ kubectl ate create actor x -a ate-demo-counter --template nope
Error: failed to create actor: rpc error: code = FailedPrecondition desc = actor template not found
RC=1
$ kubectl ate delete atespace ate-demo-counter
Error: failed to delete atespace: rpc error: code = FailedPrecondition desc = Atespace ate-demo-counter is not empty
RC=1
$ kubectl ate delete atespace --help | head -n 1
Delete an empty atespace (fails if any actors remain)
$ kubectl ate create actor-template -f r3-mem1k.yaml
ATESPACE NAME GOLDEN TAG ERROR AGE
ate-demo-counter r3-mem1k 0s
RC=0
$ ate_curl ate-demo-counter/r3-mem1k-actor
error resuming actor ate-demo-counter/r3-mem1k-actor
HTTP_CODE:500 TIME_TOTAL:0.521037s
{
"state": "ACTOR_STATE_CRASHED",
"crash": {
"crashTime": "2026-10-27T02:00:27.157823263Z",
"message": "resume failed: atelet Run: while calling worker RunWorkload: rpc error: code = Internal desc = while creating the sandbox: while running `runsc create`: signal: terminated"
},
"uid": "7d894d64-525c-450b-beb9-954cd9581553"
}
- 主要言語
- Go
- スター
- 5.9k
- フォーク
- 637
- 平均マージ
- 2日 1時間
- マージ済み PR(30日)
- 523
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
agent-substrate/substrate のほかの issue
-
Clean up the ko retry tests対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンarea/dev-infra area/reliability area/tests kind/cleanup
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
agent-substrate/substrate#3461 ·
メンテナーはふだん 1 日以内に返信
-
egress: drop the empty-provider check in providerCredential対応中かも @cloudonly が 3 日前に担当しました。 オープンarea/network kind/cleanup
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
agent-substrate/substrate#3428 ·
メンテナーはふだん 1 日以内に返信
-
kubectl-ate create actor-template -f <file> fails with useless error対応中かも @cloudonly が 4 日前に担当しました。 オープンarea/cli kind/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
agent-substrate/substrate#3406 ·
メンテナーはふだん 1 日以内に返信
-
k8s-credential-provider manifest is missing ate-otel-config envFrom, failing OTLP metric exports to [::1]:4317 / 127.0.0.1:4317 every 60s対応中かも @ericcurtin が 5 日前に担当しました。 オープンarea/dev-infra area/observability area/security kind/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
agent-substrate/substrate#3282 ·
メンテナーはふだん 1 日以内に返信
-
filecachegc.runPass suppresses eviction logs when FreedBytes < target and consecutiveShortfalls > 3対応中かも @ericcurtin が 4 日前に担当しました。 オープンarea/node area/observability area/storage kind/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
agent-substrate/substrate#3281 ·
メンテナーはふだん 1 日以内に返信
agent-substrate/substrate の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
limitlessprojects/Go-Hybrid#3342 ·
メンテナーはふだん 1 日以内に返信
-
status/ready type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
buildpacks/pack#2733 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
kind/bug needs-priority needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
konveyor/tackle2-hub#1166 · コメント 1 件 ·
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
router-for-me/CLIProxyAPI#7209 ·
メンテナーはふだん 1 日以内に返信