lablup / lablup/backend.ai-webui

Fix WebUI not handling DOWNSTREAM_SERVICE_ERROR from Hive Gateway for GraphQL errors

Open
#5,734 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
133
Forks
81
Avg merge
1d 11h
Merged PRs (30d)
344

Description

## Problem

When GraphQL errors pass through the Hive Gateway, the gateway rewrites extensions.code to DOWNSTREAM_SERVICE_ERROR and adds serviceName field. The WebUI does not recognize this error format, causing the page to break.

Direct Manager responses (without gateway) use the original Backend.AI error code in extensions.code (e.g. backendai_read_not-found), which the WebUI handles correctly.

## Error Formats

Format that does NOT work (via Gateway):

```json
{"extensions": {"code": "DOWNSTREAM_SERVICE_ERROR", "serviceName": "graphene"}}
```

Format that works (direct from Manager):

```json
{"extensions": {"service": "graphene"}}
```

## Root Cause

Hive Gateway (gateway.config.ts, maskedErrors: false) passes through error messages but transforms the extensions structure. The WebUI error handler branches on extensions.code and does not recognize DOWNSTREAM_SERVICE_ERROR.

## Fix Direction

1. WebUI: Add handling for DOWNSTREAM_SERVICE_ERROR code, fall back to message-based error handling
1. Gateway: Add custom plugin to preserve original extensions.code from subgraph errors

JIRA Issue: BA-4863

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.