Expand my Community achievements bar.

Event from Adobe Commerce does not show up in developer console

Avatar

Level 1

I followed this guide: https://developer.adobe.com/commerce/extensibility/events/

 

Events are visible in the event_data table in the Adobe Commerce MySQL database. However, they do not show up in the Developer Console in Debug Tracing or Event Browser (Journaling).

 

Is there anybody that can help me?

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

6 Replies

Avatar

Level 7

how are the events received? if you are receiving into a runtime action and if action is undeployed, not active; then events wont show even at browser. 

 

Correct way to confirm, is just print event into log. Create a simple runtime action with just log statement like this 

import { Core } from "@adobe/aio-sdk";
const logger = Core.Logger("main");
// main function that will be executed by Adobe I/O Runtime
function main(params) {
  logger.info("Developer is receiving commerce actions");
  logger.debug(JSON.stringify(params.data));
}
const _main = main;
export { _main as main };

 Deploy this action into your workspace using `aio app deploy`. Configure logger. I linked AIO to my Enterprise Splunk, so can read log statements from my splunk.

Once event is fired at commerce, should show on splunk, and will show on event browser as well. 

Avatar

Level 1

Hi sarav_prakash, thank you for your answer.

 

The event is indeed configured to receive in a runtime action, however the action is not activated. When I invoke the action manually via the CLI, I can see the logs. However when I trigger the event using Adobe Commerce, I don't see any logs at all. So it seems that the event is somehow not received.

Avatar

Level 7

Oh I see. Not sure , coz this is very normal. I am listening to a number of AEM events and havn't seen such problem of event published, but action not listening. worth to raise adobe ticket asking to check the journal queues. 

Avatar

Level 1

Thanks. I cannot raise a ticket because this is a sandbox environment. I have sent a mail to our Adobe contact person to find out how to resolve this.

Avatar

Employee

Hi @JeroenNo,

Could you try the steps described in the Events troubleshooting documentation to troubleshoot the issue you are having?

Let us know if you were able to find and fix the root cause or if you needed further assistance / guidance

Thanks!

Avatar

Level 1

I rojoangel, thanks for your response.

I followed the steps described on the Events troubleshooting documentation:

  1. I checked the events_data table using SELECT * FROM event_data;
    The events have been successfully sent: status = 1 for all events
  2. The events are received by App Builder: I can see them now in the Debug Tracing view:Screenshot 2025-02-04 at 09.45.29.pngHowever, the response code is 204, which (I think?) means that there is no event registration for this event.
    I also checked with aio runtime logs --tail and aio runtime activations ls, however I don't see any activity.

For the sake of completeness, my app.config.yaml and function actions/notify-add-to-cart/index.js:

application:
runtimeManifest:
packages:
app-builder-sig-presentation:
license: Apache-2.0
actions:
notify-add-to-cart:
function: actions/notify-add-to-cart/index.js
web: 'no'
runtime: nodejs:18
inputs:
LOG_LEVEL: debug
annotations:
require-adobe-auth: false
final: true
events:
registrations:
Commerce Events:
description: Commerce Events Registration
events_of_interest:
- provider_metadata: dx_commerce_events
event_codes:
- com.adobe.commerce.observer.checkout_cart_product_add_after
runtime_action: app-builder-sig-presentation/notify-add-to-cart
/* 
* <license header>
*/

/**
* This is a sample action showcasing how to access an external API
*
* Note:
* You might want to disable authentication and authorization checks against Adobe Identity Management System for a generic action. In that case:
* - Remove the require-adobe-auth annotation for this action in the manifest.yml of your application
* - Remove the Authorization header from the array passed in checkMissingRequestInputs
* - The two steps above imply that every client knowing the URL to this deployed action will be able to invoke it without any authentication and authorization checks against Adobe Identity Management System
* - Make sure to validate these changes against your security requirements before deploying the action
*/


const { Core } = require('@adobe/aio-sdk')

// main function that will be executed by Adobe I/O Runtime
const main = async params => {
const logger = Core.Logger('main', { level: params.LOG_LEVEL || 'info' })
logger.info(params)
};

exports.main = main