Skip to content

OpenAPI service env, port, and domain handlers raise raw validation and nil errors #2642

Description

@RainBondsongyg

Summary

Sentry captured OpenAPI service configuration endpoints raising raw exceptions for missing optional fields, missing service/app state, and serializer validation errors.

De-duplication note

Existing #2619 covered missing team/app initialization on OpenAPI list endpoints. These groups are newer service config mutation paths and were not present in that batch.

Sentry evidence

  • RAINBOND-CONSOLE-J7 - Sentry issue 923 - 7 event(s) - first 2026-06-30T07:58:27Z - last 2026-06-30T09:29:08Z - route /openapi/v1/teams/{team_id}/regions/{region_name}/apps/{app_id}/services/{service_id}/envs - release v6.9.2-release-esgz-5e8bbce-2026-06-24-07 - Sentry
    • Error: KeyError: 'note'
  • RAINBOND-CONSOLE-JJ - Sentry issue 935 - 1 event(s) - first 2026-06-30T09:05:23Z - last 2026-06-30T09:05:23Z - route /openapi/v1/teams/{team_id}/regions/{region_name}/apps/{app_id}/services/{service_id}/ports/{port} - release v6.9.2-release-esgz-5e8bbce-2026-06-24-07 - Sentry
    • Error: AttributeError: 'NoneType' object has no attribute 'app_id'
  • RAINBOND-CONSOLE-JH - Sentry issue 934 - 1 event(s) - first 2026-06-30T09:05:03Z - last 2026-06-30T09:05:03Z - route /openapi/v1/teams/{team_id}/regions/{region_name}/apps/{app_id}/services/{service_id}/ports - release v6.9.2-release-esgz-5e8bbce-2026-06-24-07 - Sentry
    • Error: {'port_alias': [ErrorDetail(string='该字段不能为空。', code='blank')]}
  • RAINBOND-CONSOLE-JF - Sentry issue 932 - 1 event(s) - first 2026-06-30T09:03:16Z - last 2026-06-30T09:03:16Z - route /openapi/v1/teams/{team_id}/regions/{region_name}/apps/{app_id}/httpdomains - release v6.9.2-release-esgz-5e8bbce-2026-06-24-07 - Sentry
    • Error: {'configuration': {'set_headers': [ErrorDetail(string='该字段是必填项。', code='required')]}}
  • RAINBOND-CONSOLE-JE - Sentry issue 931 - 1 event(s) - first 2026-06-30T09:03:15Z - last 2026-06-30T09:03:15Z - route /openapi/v1/teams/{team_id}/regions/{region_name}/apps/{app_id}/services/{service_id}/ports - release v6.9.2-release-esgz-5e8bbce-2026-06-24-07 - Sentry
    • Error: {'port': [ErrorDetail(string='该字段是必填项。', code='required')]}

Impact

OpenAPI callers receive server errors or raw validation payloads instead of stable 4xx responses. These paths affect service env updates, port creation, and HTTP domain creation.

Suggested next steps

  • Normalize optional env fields such as note before indexing request payloads.
  • Return structured validation responses for missing port, port_alias, and configuration.set_headers instead of capturing them as server errors.
  • Add nil checks before dereferencing service/app fields such as app_id.
  • Add OpenAPI regression tests for omitted optional env metadata and incomplete port/domain payloads.

Source: Sentry production unresolved scan on 2026-06-30. This consolidates new groups after checking existing Rainbond issues, including closed Sentry batch issues #2610-#2621.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions