ate-env leaks raw/double-wrapped gRPC errors and misleading "suspending" error on delete of non-existent environment
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 42/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- go, grpc
- Ambito
- backend-api-design, cli, testing
Direzione di ricerca
Start with the listed error-handling paths in internal/ate/client.go, internal/apiservice/server.go, clients/go/client.go, and guest/filesystem/service.go; trace how each reproduced failure is wrapped and translated across the API and CLI. Use the five ate-env commands in the reproduction guide to check the current behavior. Done means errors are presented once with useful context, missing-environment deletion identifies the missing environment, directory reads use an appropriate status, and transport failures explain how to check connectivity.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary & Root Cause
- Errors are wrapped twice. The env API server wraps Substrate errors (
ate: creating "alice": <status error>) and re-emits them with the same code. gRPC'sstatus.FromErroraccepts the wrapped error and uses its full text as the message, so the CLI showsrpc error: code = AlreadyExists desc = ate: creating "alice": rpc error: code = AlreadyExists desc = .... deleteof a missing environment fails inside the implicitSuspend, so the message sayssuspending.readof a directory is reported asInternal.- Transport failures (the port-forward is down) reach the user as raw
Unavailabledial errors, with no hint to check the port-forward or--api.
Affected Code Locations
At env 40a6c63, with de462e98 line numbers noted where they differ:
internal/ate/client.go:316-328(de462e98:306-318):Client.Deletecallsc.Suspendfirst and returns its error unchangedinternal/ate/client.go:305-314(de462e98:299-304):Suspendwraps errors asate: suspending %q: %winternal/ate/client.go:277-279:Createwraps the rawCreateActorstatus error with%w(onlyNotFoundis translated, bywrapGRPCErrorat:372-377,de462e98:362-367)internal/apiservice/server.go:146-148, 255-257:CreateEnvironmentandDeleteEnvironmentreturntoGRPCError(err)internal/apiservice/server.go:557-570:toGRPCErrorreturns any error that already carries a non-Unknown gRPC code as is, so the wrapped text (including the innerrpc error: ...) becomes the new status messageclients/go/client.go:154-167:fromGRPCErrortranslates onlyNotFoundand oneFailedPreconditioncase. Everything else becomesenv: <raw status error>guest/filesystem/service.go:155-160: a read error (includingEISDIR) is returned ascodes.Internal,failed to read file %q: %v
Detailed Reproduction Guide
ate-env delete does-not-exist; echo "exit: $?"
ate-env create alice; ate-env create alice; echo "exit: $?"
ate-env create alice-py --rootfs-image python:3.12; echo "exit: $?"
ate-env alice read .; echo "exit: $?"
ate-env alice shell --api 127.0.0.1:17799 echo hi; echo "exit: $?" # nothing listening on 17799
Expected vs. Actual Behavior
- Expected:
environment "does-not-exist" not found.environment "alice" already exists."." is a directoryasInvalidArgumentorFailedPrecondition.cannot reach ate-env-api at 127.0.0.1:17799 (is the port-forward running? see --api / SUBSTRATE_ENV_API). No rawrpc error: code = ...text. - Actual: See the outputs below: a misleading
suspendingcontext, a double-wrappedAlreadyExists,Internalfor a directory read, and raw gRPC transport text.
Observed Output & Logs
ate-env: env: not found: ate: suspending "does-not-exist": not found: actor "does-not-exist" not found
ate-env: env: rpc error: code = AlreadyExists desc = ate: creating "alice": rpc error: code = AlreadyExists desc = actor "alice" already exists
ate-env: env: rpc error: code = InvalidArgument desc = image "python:3.12" is not pinned by digest (want repo@sha256:<64 hex>)
ate-env: env: rpc error: code = Internal desc = failed to read file ".": read /workspace: is a directory
ate-env: env: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing: dial tcp 127.0.0.1:7777: connect: connection refused"
$ ate-env delete does-not-exist
ate-env: env: not found: ate: suspending "does-not-exist": not found: actor "does-not-exist" not found
EXIT: 1
$ ate-env create alice && ate-env create alice
ate-env: env: rpc error: code = AlreadyExists desc = ate: creating "alice": rpc error: code = AlreadyExists desc = actor "alice" already exists
EXIT: 1
$ ate-env alice read .
ate-env: env: rpc error: code = Internal desc = failed to read file ".": read /tmp/TestReverifyEnvCLI511734675/001: is a directory
EXIT: 1
$ ate-env --api 127.0.0.1:17777 create alice
ate-env: env: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing: dial tcp 127.0.0.1:17777: connect: connection refused"
EXIT: 1
$ ate-env delete does-not-exist
EXIT: 1
ate-env: env: not found: ate: suspending "does-not-exist": not found: Actor ate-env/does-not-exist not found
$ ate-env create alice
EXIT: 1
ate-env: env: rpc error: code = AlreadyExists desc = ate: creating "alice": rpc error: code = AlreadyExists desc = Actor alice already exists
$ ate-env create alice-py --rootfs-image python:3.12
EXIT: 1
ate-env: env: rpc error: code = InvalidArgument desc = image "python:3.12" is not pinned by digest (want repo@sha256:<64 hex>)
$ ate-env alice read .
EXIT: 1
ate-env: env: rpc error: code = Internal desc = failed to read file ".": read .: is a directory
$ ate-env alice shell --api 127.0.0.1:17799 echo hi
EXIT: 1
ate-env: env: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing: dial tcp 127.0.0.1:17799: connect: connection refused"
- Lingua principale
- Go
- Stelle
- 70
- Fork
- 17
- Merge medio
- 21h 36m
- PR unite (30g)
- 19
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
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/env
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
agent-substrate/env#123 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 74/100
agent-substrate/env#121 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
agent-substrate/env#118 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 57/100
agent-substrate/env#117 ·
I maintainer di solito rispondono entro 1 giorno
-
bug substrate
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
agent-substrate/env#115 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di agent-substrate/env
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
Schema validation is skipped when a transaction is invoked with a lowercase first letterForse già presa @RaphaelFakhri l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
-
cmd/ebitenmobile: multi-language bindings run the complete generator twiceForse già presa @kumagi l’ha presa oggi. Apertaos:macos performance
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
hajimehoshi/ebiten#4011 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
agent-butler-finding chore
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
jordansmall/spindrift#6318 ·
I maintainer di solito rispondono entro 1 giorno