Skip to content

[BUG]: Data contract file upload fails when the contract contains support entries #73

@GFernie

Description

@GFernie

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Uploading a data contract file through the UI fails when the contract contains a support section.

I reproduced this in the Ontos UI using a minimal public ODCS example. Uploading the YAML file via Data Contracts -> Upload File returns 500 with {"detail":"Upload failed"}.

Audit log for the same failure shows:

TypeError: 'type' is an invalid keyword argument for DataContractSupportDb

The same file upload path succeeds when the contract does not contain support.

Additionally, after upload attempts the frontend throws Uncaught ReferenceError: Loader2 is not defined.

Expected Behavior

Uploading a valid ODCS contract file should import the contract successfully, including contracts that contain a support section.

Steps To Reproduce

  1. Open Ontos and go to Data Contracts.
  2. Click Upload File.
  3. Upload this minimal YAML:
kind: DataContract
apiVersion: v3.1.0
id: urn:datacontract:example:public:upload:repro
name: public_support_upload_repro
version: 1.0.0
status: draft
description:
  purpose: Minimal public repro for Ontos contract upload failure.
support:
  - channel: "#support-example"
    tool: slack
    scope: technical
    url: https://example.com/support-example
  1. Observe that POST /api/data-contracts/upload returns 500 and the upload fails.

Control comparison:

  1. Upload this minimal YAML without support:
kind: DataContract
apiVersion: v3.1.0
id: urn:datacontract:example:public:upload:control
name: public_upload_control
version: 1.0.0
status: draft
description:
  purpose: Minimal public control contract without support entries.
  1. Observe that POST /api/data-contracts/upload returns 200 and the contract is created successfully.

Cloud

AWS

Browser

Chrome

Version

latest

Relevant log output

Failing file upload request
- Endpoint: POST /api/data-contracts/upload
- Status: 500
- Request ID: cd5d5bec-1f33-47cd-83e6-6b524d713ff7
- Response body: {"detail":"Upload failed"}

Successful control upload
- Endpoint: POST /api/data-contracts/upload
- Status: 200
- Request ID: afe89685-b51b-4312-a419-7ace60e0adbf

Frontend console
Failed to load resource: the server responded with a status of 500 ()
Uncaught ReferenceError: Loader2 is not defined

Audit log
{
  "params": {
    "filename": "minimal-support-upload-repro.odcs.yaml"
  },
  "exception": {
    "type": "TypeError",
    "message": "'type' is an invalid keyword argument for DataContractSupportDb"
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions