Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Event Bus Services do not log subscription errors properly #9997

Closed
MiguelFranken opened this issue Nov 8, 2024 · 1 comment
Closed

Comments

@MiguelFranken
Copy link

MiguelFranken commented Nov 8, 2024

Package.json file

{
  "name": "",
  "version": "0.0.1",
  "description": "A starter for Medusa projects.",
  "author": "Medusa (https://medusajs.com)",
  "license": "MIT",
  "keywords": [
    "sqlite",
    "postgres",
    "typescript",
    "ecommerce",
    "headless",
    "medusa"
  ],
  "scripts": {
    "build": "medusa build",
    "build:admin": "DISABLE_MEDUSA_ADMIN=true medusa build --admin-only",
    "seed": "medusa exec ./src/scripts/seed.ts",
    "start": "medusa start",
    "dev": "medusa develop",
    "db:migrate": "medusa db:migrate",
    "db:sync-links": "medusa db:sync-links",
    "test:integration:http": "TEST_TYPE=integration:http NODE_OPTIONS=--experimental-vm-modules jest --silent=false --runInBand --forceExit",
    "test:integration:modules": "TEST_TYPE=integration:modules NODE_OPTIONS=--experimental-vm-modules jest --silent --runInBand --forceExit",
    "test:unit": "TEST_TYPE=unit NODE_OPTIONS=--experimental-vm-modules jest --silent --runInBand --forceExit"
  },
  "dependencies": {
    "@medusajs/admin-sdk": "^2.0.1",
    "@medusajs/cli": "^2.0.1",
    "@medusajs/framework": "^2.0.1",
    "@medusajs/medusa": "^2.0.1",
    "@mikro-orm/core": "5.9.7",
    "@mikro-orm/knex": "5.9.7",
    "@mikro-orm/migrations": "5.9.7",
    "@mikro-orm/postgresql": "5.9.7",
    "awilix": "^8.0.1",
    "pg": "^8.13.0",
    "zod": "3.22.4"
  },
  "devDependencies": {
    "@medusajs/test-utils": "latest",
    "@mikro-orm/cli": "5.9.7",
    "@swc/core": "1.5.7",
    "@swc/jest": "^0.2.36",
    "@types/jest": "^29.5.13",
    "@types/node": "^20.0.0",
    "@types/react": "^18.3.2",
    "@types/react-dom": "^18.2.25",
    "jest": "^29.7.0",
    "prop-types": "^15.8.1",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "ts-node": "^10.9.2",
    "typescript": "^5.6.2",
    "vite": "^5.2.11"
  },
  "engines": {
    "node": ">=20"
  }
}

Node.js version

v20.13.1

Database and its version

16.2

Operating system name and version

Mac OS

Browser name

No response

What happended?

Error are not properly logged in Event Bus module.

Issue is here:

`An error occurred while processing ${event.toString()}: ${e}`

I am trying to debug an error with the payment webhook subscriber and it's not possible for me to get a good error message as the error here is an object and the logger instance just returns [Object objct]

Expected behavior

Event bus modules log properly

Actual behavior

Logger logs [Object objct] for errors in subscribe method

Link to reproduction repo

/

@MiguelFranken MiguelFranken changed the title [Bug]: Event Bus Services do not log subscription errors propery [Bug]: Event Bus Services do not log subscription errors properly Nov 8, 2024
@olivermrbl olivermrbl added the type: bug label Nov 11, 2024 — with Linear
@linear linear bot closed this as completed Nov 13, 2024
@MiguelFranken
Copy link
Author

Updated today to the newest version 2.0.6 and the error is still not serialized properly.
I tested it with event-bus-local and I get a proper error message, but the problem still happens when I use redis.

@carlos-r-l-rodrigues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants