Update-available notice should be printed to stdout, not stderr (causes log aggregators to flag it as `error`)

Open Beginner friendly
#29,541 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
nodejs, typescript
Domain
cli

Research direction

Inspect the update-printer, likely packages/cli/src/utils/printUpdateMessage.ts, and compare it with the bundled function H1e in node_modules/prisma/build/index.js. Reproduce the notice with the two consecutive prisma validate commands, then verify that the informational update notice is emitted on stdout rather than stderr.

Written by the indexing model from the issue text.

Description

Bug description

The "Update available" notice that the Prisma CLI prints when a new version is available is sent to stderr via console.error(). In container/CI environments, log aggregators (Datadog, GCP Cloud Logging, AWS CloudWatch, Loki, etc.) classify any line on stderr as severity error by default. This means an informational update notice surfaces in observability tools as a recurring error, which is misleading and pollutes alerting/dashboards.

The notice is informational by nature — it doesn't reflect a failure of the user's command. It should be printed to stdout so log aggregators classify it as info.

How to reproduce

Run any Prisma CLI command that succeeds twice (the first run populates the checkpoint cache; the second run prints the notice if an update is available). For example, in a container:

docker run --rm node:24.14.0-alpine3.22 sh -c '
  mkdir /app && cd /app
  cat > schema.prisma <<EOS
datasource db { provider = "postgresql" url = "postgresql://x:y@host:5432/db" }
generator client { provider = "prisma-client-js" }
EOS
  npx --yes prisma@6.19.2 validate
  npx --yes prisma@6.19.2 validate
' 2>/dev/null   # discard stdout — notice still appears, proving it is on stderr

Or directly inspect the bundled CLI source — the print function in node_modules/prisma/build/index.js (function H1e in 6.19.2) ends with:

let p = _w({ height: n, width: 59, str: l, horizontalPadding: 2 });
console.error(p);   // <-- stderr

Expected behavior

The update notice should be printed to stdout (console.log or process.stdout.write). It is informational, not an error.

Why this matters

In production deployments using log aggregators that key on stream:

  • Datadog Agent's docker log integration marks every stderr line as status:error by default. Result: the box-drawing notice shows up in Datadog as a recurring error-severity event every time a new container starts and runs prisma migrate deploy.
  • Similar behavior in Loki/Promtail (level=error), AWS CloudWatch (with default JSON parsers), and GCP Cloud Logging (severity: ERROR for stderr).

This causes false-positive "errors" in dashboards, alerts, and monitor queries, even though Prisma is functioning normally.

Workarounds users currently rely on

  1. Set PRISMA_HIDE_UPDATE_MESSAGE=true — works, but suppresses the notice entirely (defeats the purpose of having it).
  2. Redirect stderr to stdout in the container entrypoint (2>&1) — works for the notice, but also collapses real errors to stdout, which is worse.
  3. Add a custom log-pipeline rule in the aggregator that re-tags messages matching /Update available .* -> .*/ to severity info — surgical, but lives outside the application repo and adds operational complexity per environment.

A single-character fix in Prisma (console.errorconsole.log) would eliminate the need for any of these workarounds.

Suggested change

In the update-printer (H1e in 6.19.2's bundled build/index.js, source likely in packages/cli/src/utils/printUpdateMessage.ts or similar):

- console.error(p)
+ console.log(p)

Environment & setup

  • OS: Alpine Linux 3.22 (any container OS reproduces)
  • Node.js: v24.14.0
  • Prisma version: 6.19.2 (verified — same code path exists in current main per the bundled source)

Prisma Version

prisma                  : 6.19.2
@prisma/client          : 6.19.2
Dominant language
TypeScript
Stars
47.6k
Forks
2.5k
Avg merge
22h 54m
Merged PRs (30d)
93

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from prisma/orm

All issues in prisma/orm

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.