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
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 28/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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"
}
- Lingua principale
- Go
- Stelle
- 5.9k
- Fork
- 637
- Merge medio
- 2g 1h
- PR unite (30g)
- 523
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di agent-substrate/substrate
-
Clean up the ko retry testsForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertaarea/dev-infra area/reliability area/tests kind/cleanup
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
agent-substrate/substrate#3461 ·
I maintainer di solito rispondono entro 1 giorno
-
egress: drop the empty-provider check in providerCredentialForse già presa @cloudonly l’ha presa 3 giorni fa. Apertaarea/network kind/cleanup
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
agent-substrate/substrate#3428 ·
I maintainer di solito rispondono entro 1 giorno
-
kubectl-ate create actor-template -f <file> fails with useless errorForse già presa @cloudonly l’ha presa 4 giorni fa. Apertaarea/cli kind/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
agent-substrate/substrate#3406 ·
I maintainer di solito rispondono entro 1 giorno
-
k8s-credential-provider manifest is missing ate-otel-config envFrom, failing OTLP metric exports to [::1]:4317 / 127.0.0.1:4317 every 60sForse già presa @ericcurtin l’ha presa 5 giorni fa. Apertaarea/dev-infra area/observability area/security kind/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
agent-substrate/substrate#3282 ·
I maintainer di solito rispondono entro 1 giorno
-
filecachegc.runPass suppresses eviction logs when FreedBytes < target and consecutiveShortfalls > 3Forse già presa @ericcurtin l’ha presa 4 giorni fa. Apertaarea/node area/observability area/storage kind/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
agent-substrate/substrate#3281 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di agent-substrate/substrate
Issue simili
-
bug good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
[mesheryctl] design delete fails when passing file or URL as positional argumentForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertacomponent/mesheryctl kind/bug language/go
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
meshery/meshery#22772 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
backend security size:S
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
limitlessprojects/Go-Hybrid#3342 ·
I maintainer di solito rispondono entro 1 giorno
-
status/ready type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
buildpacks/pack#2733 ·
I maintainer di solito rispondono entro 1 giorno