Skip to content

Leaking MongoDB internal error when uploading a duplicated service twice #21

@pgmarc

Description

@pgmarc

Given

  • SPACE is up and running
  • You have an ADMIN API Key
  • A you have uploaded the following file example.yaml to POST /services
saasName: Example
version: alfa
createdAt: "2025-08-05"
syntaxVersion: "3.0"
currency: USD
features:
  featA:
    valueType: BOOLEAN
    defaultValue: true
    expression: pricingContext['features']['featA']
    type: DOMAIN
plans:
  BASIC:
    price: 0.0
    unit: user/month
    features: null
    usageLimits: null
  GOLD:
    price: 5.0
    unit: user/month
    features: null
    usageLimits: null

Using curl

curl -H 'x-api-key: b72d71983d91f1b812c372e63adad4502ea17f36ed54b59a75be7b6f67c3ff9f' \
  --form pricing=@example.yaml \
  http://localhost:5403/api/v1/services

When

Uploading the same file example.yaml again:

curl -v -H 'x-api-key: b72d71983d91f1b812c372e63adad4502ea17f36ed54b59a75be7b6f67c3ff9f' \
  --form pricing=@example.yaml \
  http://localhost:5403/api/v1/services

Then

I get 500 Internal Server Error status code with the following JSON response:

{"error":"E11000 duplicate key error collection: space_db.pricings index: _serviceName_1_version_1 dup key: { _serviceName: \"Example\", version: \"alfa\" }"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions