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

Pino-pretty logger transport throws in the built dist #474

Closed
ygrishajev opened this issue Nov 14, 2024 · 4 comments
Closed

Pino-pretty logger transport throws in the built dist #474

ygrishajev opened this issue Nov 14, 2024 · 4 comments

Comments

@ygrishajev
Copy link
Contributor

Steps to reproduce:

  1. build api npm run build -w apps/api
  2. run it node apps/api/dist/server.js

EXP: api boots up on defined port
ACT: an error thrown Error: unable to determine transport target for "pino-pretty"

This is of a low prio as the only case when it's an issue if we set STD_OUT_LOG_FORMAT to pretty in deployed env, which never happens. We only need this in local dev env.
Still we'd like this to be fixed.

@ygrishajev ygrishajev added this to the Logging Unification milestone Nov 14, 2024
@forbesus
Copy link
Contributor

it's working well on my side?
could you try again after run npm i?

@ygrishajev
Copy link
Contributor Author

~/DevArea/akash/console git:[feature/user]
rm -rf node_modules/ apps/*/node_modules packages/*/node_modules && npm i
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: This package is now deprecated. Move to @xterm/addon-fit instead.
npm warn deprecated [email protected]: Please use @jridgewell/sourcemap-codec instead
npm warn deprecated [email protected]: [email protected]
npm warn deprecated [email protected]: It is not compatible with newer versions of GA starting with v4, as long as you are using GAv3 it should be ok, but the package is not longer being maintained
npm warn deprecated [email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm warn deprecated [email protected]: This package is now deprecated. Move to @xterm/xterm instead.

> prepare
> husky || true


added 3319 packages, and audited 3337 packages in 2m

468 packages are looking for funding
  run `npm fund` for details

43 vulnerabilities (3 low, 19 moderate, 20 high, 1 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
~/DevArea/akash/console git:[feature/user]
cd apps/api/
~/DevArea/akash/console/apps/api git:[feature/user]
npm run build:app

> @akashnetwork/[email protected] build:app
> webpack --config webpack.prod.js

assets by path drizzle/ 41.4 KiB
  assets by path drizzle/meta/*.json 38.2 KiB
    asset drizzle/meta/0006_snapshot.json 7.18 KiB [compared for emit] [from: drizzle/meta/0006_snapshot.json] [copied]
    asset drizzle/meta/0005_snapshot.json 7 KiB [compared for emit] [from: drizzle/meta/0005_snapshot.json] [copied]
    asset drizzle/meta/0004_snapshot.json 5.33 KiB [compared for emit] [from: drizzle/meta/0004_snapshot.json] [copied]
    + 5 assets
  assets by path drizzle/*.sql 3.22 KiB
    asset drizzle/0000_cloudy_banshee.sql 1.09 KiB [compared for emit] [from: drizzle/0000_cloudy_banshee.sql] [copied]
    asset drizzle/0005_colorful_dreaming_celestial.sql 852 bytes [compared for emit] [from: drizzle/0005_colorful_dreaming_celestial.sql] [copied]
    asset drizzle/0006_skinny_stingray.sql 464 bytes [compared for emit] [from: drizzle/0006_skinny_stingray.sql] [copied]
    asset drizzle/0001_absurd_pretty_boy.sql 320 bytes [compared for emit] [from: drizzle/0001_absurd_pretty_boy.sql] [copied]
    + 3 assets
assets by path *.js 28.9 MiB
  asset server.js 28.3 MiB [compared for emit] (name: main)
  asset vendors-node_modules_hono_sentry_dist_index_mjs.server.js 517 KiB [compared for emit] (id hint: vendors)
orphan modules 471 KiB [orphan] 133 modules
runtime modules 2.77 KiB 9 modules
modules by path ../../node_modules/ 24.1 MiB
  javascript modules 23 MiB 2846 modules
  json modules 1.14 MiB 8 modules
modules by path ./ 586 KiB 174 modules
modules by path ../../packages/ 326 KiB
  javascript modules 321 KiB 95 modules
  json modules 4.22 KiB 3 modules
modules by path external "@cosmjs/ 168 bytes
  external "@cosmjs/crypto" 42 bytes [built] [code generated]
  external "@cosmjs/encoding" 42 bytes [built] [code generated]
  external "@cosmjs/stargate" 42 bytes [built] [code generated]
  external "@cosmjs/math" 42 bytes [built] [code generated]
+ 34 modules
webpack 5.94.0 compiled successfully in 23184 ms
~/DevArea/akash/console/apps/api git:[feature/user]
node dist/server.js
{"level":30,"time":1731658675436,"pid":66749,"hostname":"Gryshaievs-MBP","context":"ENV","msg":"Loaded env files: env/.env.local, env/.env, env/.env.mainnet"}
[09:17:55.673] DEBUG: CREATE SCHEMA IF NOT EXISTS "drizzle"
    context: "POSTGRES"
    orm: "drizzle"
[09:17:55.732] DEBUG: CREATE TABLE IF NOT EXISTS "drizzle"."__drizzle_migrations" (
  id SERIAL PRIMARY KEY,
  hash text NOT NULL,
  created_at bigint
)
    context: "POSTGRES"
    orm: "drizzle"
[09:17:55.737] DEBUG: select
  id,
  hash,
  created_at
from
  "drizzle"."__drizzle_migrations"
order by
  created_at desc
limit
  1
    context: "POSTGRES"
    orm: "drizzle"
[09:17:55.722] INFO (66749):
    context: "POSTGRES"
    severity_local: "NOTICE"
    severity: "NOTICE"
    code: "42P06"
    message: "schema \"drizzle\" already exists, skipping"
    file: "schemacmds.c"
    line: "131"
    routine: "CreateSchemaCommand"
[09:17:55.733] INFO (66749):
    context: "POSTGRES"
    severity_local: "NOTICE"
    severity: "NOTICE"
    code: "42P07"
    message: "relation \"__drizzle_migrations\" already exists, skipping"
    file: "parse_utilcmd.c"
    line: "207"
    routine: "transformCreateStmt"
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error: unable to determine transport target for "pino-pretty"
    at fixTarget (webpack://@akashnetwork/console-api/../../packages/logging/node_modules/pino/lib/transport.js?:161:13)
    at transport (webpack://@akashnetwork/console-api/../../packages/logging/node_modules/pino/lib/transport.js?:131:22)
    at normalizeArgs (webpack://@akashnetwork/console-api/../../packages/logging/node_modules/pino/lib/tools.js?:316:16)
    at pino (webpack://@akashnetwork/console-api/../../packages/logging/node_modules/pino/pino.js?:90:28)
    at LoggerService.initPino (webpack://@akashnetwork/console-api/../../packages/logging/src/servicies/logger/logger.service.ts?:29:35)
    at new LoggerService (webpack://@akashnetwork/console-api/../../packages/logging/src/servicies/logger/logger.service.ts?:16:26)
    at LoggerService.forContext (webpack://@akashnetwork/console-api/../../packages/logging/src/servicies/logger/logger.service.ts?:13:16)
    at new HttpLoggerService (webpack://@akashnetwork/console-api/./src/core/services/http-logger/http-logger.service.ts?:23:47)
    at eval (webpack://@akashnetwork/console-api/../../node_modules/tsyringe/dist/esm5/dependency-container.js?:371:28)
    at InternalDependencyContainer.construct (webpack://@akashnetwork/console-api/../../node_modules/tsyringe/dist/esm5/dependency-container.js?:379:11)

@forbesus
Copy link
Contributor

forbesus commented Nov 15, 2024

  id SERIAL PRIMARY KEY,
  hash text NOT NULL,
  created_at bigint
)
    context: "POSTGRES"
    orm: "drizzle"
[09:17:55.737] DEBUG: select
  id,
  hash,
  created_at
from
  "drizzle"."__drizzle_migrations"
order by
  created_at desc
limit
  1
    context: "POSTGRES"
    orm: "drizzle"
[09:17:55.722] INFO (66749):
    context: "POSTGRES"
    severity_local: "NOTICE"
    severity: "NOTICE"
    code: "42P06"
    message: "schema \"drizzle\" already exists, skipping"
    file: "schemacmds.c"
    line: "131"
    routine: "CreateSchemaCommand"```
    

@forbesus
Copy link
Contributor

forbesus commented Nov 15, 2024

In this part, logger was run successfully,
But error was occurred on HttpLoggerService
I can't reproduce the same error on my side

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Released (in Prod)
Development

No branches or pull requests

2 participants