ate-env leaks raw/double-wrapped gRPC errors and misleading "suspending" error on delete of non-existent environment
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 42/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- go, grpc
- Área
- backend-api-design, cli, testing
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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"
- Lenguaje dominante
- Go
- Estrellas
- 70
- Forks
- 17
- Merge medio
- 21 h 36 min
- PR fusionados (30 d)
- 19
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de agent-substrate/env
-
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
agent-substrate/env#123 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 74/100
agent-substrate/env#121 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
agent-substrate/env#118 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 57/100
agent-substrate/env#117 ·
Los mantenedores suelen responder en 1 día
-
bug substrate
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
agent-substrate/env#115 ·
Los mantenedores suelen responder en 1 día
Todos los issues de agent-substrate/env
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
agent-butler-finding chore
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
jordansmall/spindrift#6318 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Eyevinn/moqlivemock#166 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
JakeChampion/lang#14091 ·
Los mantenedores suelen responder en 1 día
-
batcher: BAF send context leaks per batchPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
hyperledger/fabric-x-orderer#1409 ·
Los mantenedores suelen responder en 3 días