aws / aws-sdk-js-v3

Modularized AWS SDK for JavaScript.
Apache License 2.0
3.14k stars 581 forks source link

ResourceNotFoundException: Event source or Event bus not found #4788

Closed Omdaprog closed 1 year ago

Omdaprog commented 1 year ago

Checkboxes for prior research

Describe the bug

im trying to activate a event source by by ActivateEventSourceCommand but it returns ResourceNotFoundException: Event source aws.partner/shopify.com/------/certor-dev or event bus aws.partner/shopify.com/-----/certor-dev does not exist. though my partner event source connect successfully.

image

SDK version number

"@aws-sdk/client-eventbridge": "^3.337.0"

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

node: v16.15.1

Reproduction Steps

connect partner event source and activate it by AWS SDK ActivateEventSourceCommand

Observed Behavior

ResourceNotFoundException: Event source aws.partner/shopify.com/------/certor-dev or event bus aws.partner/shopify.com/-------/certor-dev does not exist.

Expected Behavior

activate event source with success

Possible Solution

No response

Additional Information/Context

No response

RanVaknin commented 1 year ago

Hi @Omdaprog ,

Are you calling the request from the correct AWS region? Ie, is your event source defined in us-east-1 and you are calling it from us-west-2?

Thanks, Ran~

Omdaprog commented 1 year ago

Hi @RanVaknin Thanks for your response, yes im sure that calling with correct region, Additionally when i fetch all eventSource it return a list pending eventSources but i'm unable to activate any of them.

image
RanVaknin commented 1 year ago

Hi @Omdaprog ,

Thanks for the follow up info.

I'm not entirely sure why you are running into this problem. I can only speak to SDK's functionality rather than each individual AWS Service and since operation goes through, and gets a response from the service, we can deduct that this is either a service issue, or a misuse of the API.

I was able to verify that it's not an SDK issue by running the command in the cli:

$ aws events activate-event-source --name aws.partner/shopify.com/*******8961/certor-dev

An error occurred (ResourceNotFoundException) when calling the ActivateEventSource operation: Event source aws.partner/shopify.com/*******8961/certor-dev or event bus aws.partner/shopify.com/*******8961/certor-dev does not exist.

(You didnt redact the result from the Name field in the response photo you pasted)

So now that we know it's not SDK issue but rather a usage issue or service issue, looking at some of the documentation for Eventbridge I see that:

  1. in the Documentation for ActivateEventSource the doc string reads:

    Activates a partner event source that has been deactivated. Once activated, your matching event bus will start receiving events from the event source.

  1. In this doc:

    Go back to the EventBridge console and choose Partner event sources in the navigation pane.

Select the button next to the partner event source and then choose Associate with event bus.

The status of the event source changes from Pending to Active, and the name of the event bus updates to match the partner event source name. You can now start creating rules that match events from the partner event source. For more information, see Creating a rule that matches SaaS partner events.

It sounds like the way to activate an event source, is by associating it with an event bus. CreateEventBus takes in an event source as an argument. I would start there.

Unfortunately I cannot setup a whole reproduction on my end since it is an integration with a 3rd party application, but I hope this can help.

Let me know how it goes. Thanks, Ran~

github-actions[bot] commented 1 year ago

This issue has not received a response in 1 week. If you still think there is a problem, please leave a comment to avoid the issue from automatically closing.

github-actions[bot] commented 1 year ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.