Skip to content

fix(gateway): permissions fetch fails during project initialization #46

@FL-AntoineDurand

Description

@FL-AntoineDurand

Problem

Every project initialization logs this error:

[ERROR] [PROJECT_ROOMS] Failed to initialize permissions for {project_id}: fetch failed {}

The error is non-fatal — project init continues and WebSocket connections work — but it indicates that the gateway cannot reach Ganymede to fetch permissions during the lazy project initialization triggered by the first WebSocket connection.

How It Happens

  1. First WebSocket connection for a project triggers lazy init in authenticateAndRoute()
  2. projectRooms.initializeProject(project_id) is called
  3. As part of init, permissions are fetched from Ganymede
  4. The fetch fails with a generic "fetch failed" error (no status code, empty error object)

Likely Cause

The permissions fetch uses the gateway's Ganymede client (https://172.17.0.2 with Host: ganymede.apollo.local). Possible causes:

  • TLS/certificate issue on the internal connection
  • Missing or invalid gateway token for the permissions endpoint
  • Ganymede endpoint not expecting this request format
  • Network timing issue during gateway startup

Impact

  • Permissions are not loaded for the project, which may cause authorization issues
  • Users may not have proper access controls enforced
  • The error is silent to the user but visible in gateway logs

Files

  • packages/app-gateway/src/websocket.tsauthenticateAndRoute() triggers init
  • packages/modules/collab/src/lib/collab-registry.tsProjectRoomsManager.initializeProject()

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggatewayGateway container lifecycle and routing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions