akash-network / console

Deploy docker containers on the Akash Network
https://console.akash.network
Apache License 2.0
84 stars 52 forks source link

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

Open ygrishajev opened 2 days ago

ygrishajev commented 2 days ago

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.

forbesus commented 1 day ago

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

ygrishajev commented 1 day ago
~/DevArea/akash/console git:[feature/user]
rm -rf node_modules/ apps/*/node_modules packages/*/node_modules && npm i
npm warn deprecated rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported
npm warn deprecated rollup-plugin-terser@7.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated glob@8.1.0: Glob versions prior to v9 are no longer supported
npm warn deprecated xterm-addon-fit@0.7.0: This package is now deprecated. Move to @xterm/addon-fit instead.
npm warn deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead
npm warn deprecated workbox-cacheable-response@6.6.0: workbox-background-sync@6.6.0
npm warn deprecated workbox-google-analytics@6.6.0: 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 json2csv@5.0.7: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm warn deprecated xterm@5.3.0: 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/console-api@2.29.1 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 commented 1 day ago

  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 commented 1 day ago

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