Why am I seeing this? and how does one fix this?
{ "errors": [ { "type": "ATTACHED_EVENT_SOURCE_LIMIT_REACHED", "message": "This component has too many event sources attached to it. Delete one or more event sources from this component before attaching a new one." } ] }
Hi, @Phill Pafford !
Compass currently has a limit of 20 event sources per component.
There are multiple ways that you could end with a Compass component with multiple event sources created. Some tools and flows create and attach them for you. There's more information about event sources in https://developer.atlassian.com/cloud/compass/components/send-events-using-rest-api-with-event-sources/
I believe you can remove those repository links whose events you wouldn't need to see could free up slots for other event sources. But there are also GraphQL queries that you can use to target and delete specific event sources manually added:
mutation DeleteEventSourceMutation {
compass {
deleteEventSource(
input: {
cloudId: "",
externalEventSourceId: "",
eventType: DEPLOYMENT
}
) {
success
}
}
}
@Enrique Serrano Valle to my understanding this was just an identifier and was not aware of limits. I'm using the branch name as identifier on the build, what would you recommend?
"externalEventSourceId": "feature/abc-123",
example
{
"cloudId": "f3f3f3f-1234-5432-6543-dddddkdkdkdk",
"event": {
"build": {
"displayName": "BUILD: ACME - Applications - my-app - feature-abc-123",
"lastUpdated": "2025-02-06T23:36:10Z",
"updateSequenceNumber": "1",
"description": "ACME - Applications - my-app - feature-abc-123",
"url": "https://bamboo.ACME.com/browse/ACME-PROJ123-JOB1-1",
"externalEventSourceId": "feature/abc-123",
"buildProperties": {
"state": "FAILED",
"startedAt": "2025-02-06T23:35:17.678Z",
"pipeline": {
"pipelineId": "1"
}
}
}
},
"componentId": "ari:cloud:compass:f3f3f3f-1234-5432-6543-dddddkdkdkdk:component/aaabbb444-h4h4-4112-b44e-4d6c748b84bc/849b19c0-edb3-486c-9dd5-sdfhhwef8348"
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Enrique Serrano Valle the example here also used the branch name
https://developer.atlassian.com/cloud/compass/components/send-events-from-bamboo/
EXTERNAL_ID=${bamboo.planRepository.branchDisplayName}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Phill Pafford that's good feedback; Compass might do this a bit differently. Here's a Compass-dedicated example that has useful guidance about external IDs for event sources.
With an event source being a funnel for events of a given type (e.g.: deployments) that apply to (at least) one component, the external ID is typically something that unequivocally identifies the event provider. Typical examples:
I hope that helps clarify the recommended external event source ID approach for Compass. This way, you won't need so many different event sources to track all your component activity.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Enrique Serrano Valle is there a rest api call to get all the external ids so I can determine which ones to delete? and can I delete using the rest api?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
trying graphql in a bash script and it's not working, keep getting
{"code":401,"message":"Unauthorized"}
changing to use the rest api url, I get a 404, which is fine as it shows auth works
https://developer.atlassian.com/cloud/compass/graphql/#overview
example script
#!/usr/bin/env bash
set -e
COMPASS_CLOUD_INSTANCE=acme
COMPASS_USER_TOKEN=very.long.token.from.manage-profile.security.link.above
TEST="GRAPHQL AUTH TEST"
echo "START TEST: $TEST"
COMPASS_BASE_URL="https://$COMPASS_CLOUD_INSTANCE.atlassian.net/gateway/api/graphql"
echo "COMPASS_BASE_URL: $COMPASS_BASE_URL"
curl -H "Authorization: Bearer $COMPASS_USER_TOKEN" "$COMPASS_BASE_URL"
echo "END TEST: $TEST"
echo ""
TEST="REST API AUTH TEST"
echo "START TEST: $TEST"
COMPASS_BASE_URL="https://$COMPASS_CLOUD_INSTANCE.atlassian.net/gateway/api/compass"
echo "COMPASS_BASE_URL: $COMPASS_BASE_URL"
curl -H "Authorization: Bearer $COMPASS_USER_TOKEN" "$COMPASS_BASE_URL"
echo "END TEST: $TEST"
echo ""
#
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
asked another question here as well https://community.atlassian.com/t5/Compass-questions/Compass-Delete-externalEventSourceId-for-specific-eventType/qaq-p/2943549#M1367
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Phill Pafford I added an answer to your other thread too, but you're right that there's an operation to delete event sources that were manually added available in the GraphQL API.
Not sure about the 401 - I followed essentially your same steps with my username and token for that site and auth worked properly. (You'd need to be an admin to manage event sources, but that would have been a 403 if it were a matter of permissions and not of credentials.) I didn't have to Base64-encode anything there:
-u "yourUsernameEmail:your-long-api-key"
There's also a GraphQL query to retrieve the event sources for a given component:
query QueryComponentEventSources {
compass {
component(id: "ari:cloud:compass:...") {
... on CompassComponent {
id
name
eventSources {
externalEventSourceId
id
eventType
}
}
}
}
}
Let me know if that helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.