Skip to content

Get Pipeline results in duplicate resource_types if multiple scopes share the same resource_config_id #9520

Closed

Description

@sankar17

Summary

The concourse Get Pipeline results in duplicate resource_types if multiple scopes share the same resource_config_id

Duplicates appear when *resource_types.resource_config_id points at a resource_configs row that has more than one resource_config_scopes row.

Concourse stores one row per custom type in {}resource_types, but get-pipeline builds JSON by running a query that joins each type to resource_config_scopes. If several scope rows share the same resource_config_id as that type, the query returns several rows for the same type.

The database resourceTypesQuery reaches the “one config, many scopes” state the bad get-pipeline query mishandles.

We are seeing this issue in v7.12.1, 8.0.2 and v8.1.1

Steps to Reproduce

  1. Deploy Concourse v7.12.1
  2. fly -t test set-pipeline -p duplicate-resource-types -c repro-dup.yaml -l values
  3. fly -t test get-pipeline -p duplicate-resource-types | yq .resource_types [ will show one resource_type ]
  4. fly -t test unpause-pipeline -p duplicate-resource-types
  5. fly -t test get-pipeline -p duplicate-resource-types | yq .resource_types [ You will see more than one resource_type]

repro-dup.yaml
values.yaml

Expected Results

At Step 3 and 5 we are expecting below result

fly -t test get-pipeline -p duplicate-resource-types | yq .resource_types
- name: repro-custom-type
  source:
    repository: registry.internal/concourse/time-resource
    tag: "1.6"
  type: registry-image

Actual Results

At Step 3

fly -t test get-pipeline -p duplicate-resource-types | yq .resource_types
- name: repro-custom-type
  source:
    repository: registry.internal/concourse/time-resource
    tag: "1.6"
  type: registry-image

At Step 5, we are seeing more than one resource_type [ The resource_type count will grow ]

- name: repro-custom-type
  source:
    repository: registry.internal/concourse/time-resource
    tag: "1.6"
  type: registry-image
- name: repro-custom-type
  source:
    repository: registry.internal/concourse/time-resource
    tag: "1.6"
  type: registry-image
- name: repro-custom-type
  source:
    repository: registry.internal/concourse/time-resource
    tag: "1.6"
  type: registry-image
- name: repro-custom-type
  source:
    repository: registry.internal/concourse/time-resource
    tag: "1.6"
  type: registry-image

Web Node(s) configuration

---
deployment_name: concourse
azs:
- az1
network_name: deployment
web_vm_type: small
worker_vm_type: small
db_persistent_disk_type: 10240
db_vm_type: small
postgres_password: test
external_url: http://192.168.122.23

web_ip: 192.168.122.23
local_user:
  username: admin
  password: test

Worker(s) configuration

No response

Concourse Version

7.12.1

Browser (if applicable)

No response

Did this use to work?

No response

Activity

  1. taylorsilva commented on Apr 15, 2026

    @taylorsilva
    Member

    Confirmed this still happens with the latest on master

    resource_types:
      - name: repro-custom-type
        type: registry-image
        source: &repro_synced_image
          repository: concourse/time-resource
          tag: latest
    
    resources:
      # Same registry-image source as the custom type definition → same resource_config_id.
      - name: colliding-a
        type: registry-image
        source:
          <<: *repro_synced_image
    
      - name: colliding-b
        type: registry-image
        source:
          <<: *repro_synced_image
    
      # Uses the custom type → forces resource type checks without fly CLI.
      # Source is valid for the time-resource implementation inside the image above.
      - name: uses-repro-custom-type
        type: repro-custom-type
        source:
          interval: 5m
          location: UTC
    
    jobs:
      - name: run-checks
        plan:
          - get: colliding-a
            trigger: true
          - get: colliding-b
          - get: uses-repro-custom-type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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