Self-hosted Engine 3 rejects namespace provisioning payload with display_name (HTTP 422)

Abierto Apto para principiantes
#305 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
88/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
node.js, typescript

Línea de trabajo

Lee provisionAppNamespace en packages/dynamic-apps/src/control-plane.ts e inspecciona la solicitud de namespace self-hosted que construye. Verifica que la solicitud coincida con el esquema de Engine descrito en el issue y, después, confirma que la implementación se realiza correctamente con la creación de namespaces habilitada.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

@rivet-dev/[email protected] cannot publish a plain Fetch-handler app against self-hosted Engine 3.0.0-preview.4 when it needs to create the per-app namespace. Its self-hosted namespace request includes display_name, which this Engine rejects as an unknown field.

Environment
Smallest HTTP reproduction

Against the disposable stack below (these are dummy credentials):

curl -i http://127.0.0.1:16420/namespaces \
  -H 'Authorization: Bearer repro-token' \
  -H 'Content-Type: application/json' \
  --data '{"name":"invalid-example","display_name":"Example"}'

Actual: HTTP 422:

Failed to deserialize the JSON body into the target type: display_name: unknown field `display_name`, expected `name` at line 1 column 40

The same endpoint with only the supported field succeeds with HTTP 200:

curl -i http://127.0.0.1:16420/namespaces \
  -H 'Authorization: Bearer repro-token' \
  -H 'Content-Type: application/json' \
  --data '{"name":"valid-example"}'
SDK behavior

A new app containing only a package.json and export default { fetch() { return new Response("hello"); } } builds successfully, but deployApp() rejects with:

code: dynamic_apps_namespace_create_failed
message: Rivet namespace creation failed with HTTP 422

Expected: namespace provisioning uses the Engine's supported request schema and the valid app deploys successfully.

The payload is constructed by provisionAppNamespace. Removing display_name from this self-hosted request was sufficient to let deployment proceed in a separate validation. The Docker reproduction below uses the unmodified published package and reproduces the failure.

Full SDK reproduction (disposable local stack)

All credentials below are deliberately invented and apply only to the disposable local stack. The Engine API is bound to loopback. The runner uses the Docker service hostname so RivetKit connects to the remote Engine rather than selecting its localhost/native development mode.

Files and commands

Save these files in an empty directory.

compose.yaml:

name: rivet-upstream-repro
services:
  seaweedfs:
    image: chrislusf/seaweedfs:4.51
    command: [mini, -dir=/data, -ip=seaweedfs, -ip.bind=0.0.0.0]
    environment:
      AWS_ACCESS_KEY_ID: repro-access
      AWS_SECRET_ACCESS_KEY: repro-secret
      S3_BUCKET: rivet
    volumes: [objects:/data]
    healthcheck:
      test: [CMD-SHELL, "curl -fsS http://localhost:9333/cluster/status >/dev/null"]
      interval: 2s
      timeout: 2s
      retries: 30
  engine:
    image: rivetdev/engine:3.0.0-preview.4
    depends_on:
      seaweedfs:
        condition: service_healthy
    environment:
      RIVET__AUTH__ADMIN_TOKEN: repro-token
      RIVET__OBJECT_STORAGE__PRIMARY__S3__ACCESS_KEY_ID: repro-access
      RIVET__OBJECT_STORAGE__PRIMARY__S3__SECRET_ACCESS_KEY: repro-secret
      AWS_ALLOW_HTTP: "true"
    ports: ["127.0.0.1:16420:6420"]
    volumes:
      - ./rivet.json:/etc/rivet/config.json:ro
      - log:/var/lib/rivet/log
    healthcheck:
      test: [CMD, curl, -fsS, http://localhost:6420/health]
      interval: 2s
      timeout: 2s
      retries: 30
  runner:
    profiles: [test]
    image: node:26.13.0-trixie-slim
    working_dir: /work
    volumes: [.:/work]
    environment:
      RIVET_ENDPOINT: http://repro:repro-token@engine:6420
      RIVET_POOL: default
      RIVET_ENVOY_VERSION: "1"
    entrypoint: [node, --import, tsx]
    command: [deploy.ts]
volumes:
  objects:
  log:

rivet.json:

{
  "storage": {
    "log_directory": "/var/lib/rivet/log",
    "auto_provision_partitions": 1,
    "balancing": {
      "enabled": false
    }
  },
  "object_storage": {
    "primary": {
      "s3": {
        "bucket": "rivet",
        "region": "us-east-1",
        "endpoint": "http://seaweedfs:8333",
        "prefix": "engine"
      }
    }
  }
}

setup.ts:

import { RivetClient } from "@rivetkit/engine-api-full";

const client = new RivetClient({
  environment: "http://127.0.0.1:16420",
  token: "repro-token", // Dummy credential for this disposable local stack.
});
await client.namespaces.create({ name: "repro" });
await client.pools.upsert("default", { namespace: "repro" });
console.log("Created the repro namespace and pool");

deploy.ts:

import { randomUUID } from "node:crypto";
import { deployApp } from "@rivet-dev/dynamic-apps";

const appId = `example-${randomUUID()}`;
const createNamespace = process.env.CREATE_NAMESPACE !== "false";
try {
  await deployApp({
    appId,
    createNamespace,
    files: {
      "package.json": JSON.stringify({ name: "example", private: true, type: "module", main: "index.js" }),
      "index.js": 'export default { fetch() { return new Response("hello"); } };',
    },
  });
  console.log("Deployment succeeded", { createNamespace });
  process.exit(0);
} catch (error) {
  console.error("Deployment failed", { createNamespace, message: error.message, code: error.code });
  process.exit(1);
}

Commands (Node.js 26.13.0 on the host):

docker compose up -d --wait
npm init -y
npm pkg set type=module
npm install --save-exact @rivet-dev/[email protected] @rivetkit/[email protected] [email protected]
npx tsx setup.ts
docker compose run --rm runner

The setup creates a fresh repro host namespace and default pool. On a just-started Engine, if setup reports depot/overloaded with routing_unavailable, wait for storage initialization and retry setup before running the reproduction.

Cleanup after testing, from this disposable directory only:

docker compose down --volumes
Lenguaje dominante
TypeScript
Estrellas
1k
Forks
53
Merge medio
2 h 54 min
PR fusionados (30 d)
5

Preparar el entorno

  • Incluye un Dockerfile o un archivo de Docker Compose
  • Sin plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de rivet-dev/dynamic-apps

Todos los issues de rivet-dev/dynamic-apps

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.