prisma: `prisma:warn Prisma failed to detect the Linux distro in use, and may not work as expected. Defaulting to "debian".` after upgrading from 4.8.1 to 4.9.0

Bug description

When running Prisma locally on Arch Linux, I get two warning messages for each Prisma command run: prisma:warn Prisma failed to detect the Linux distro in use, and may not work as expected. Defaulting to "debian". Some possibly relevant information about my setup

  1. openssl version OpenSSL 1.1.1n 15 Mar 2022
  2. ldconfig -p | grep ssl
	libxmlsec1-openssl.so.1 (libc6,x86-64) => /usr/lib/libxmlsec1-openssl.so.1
	libxmlsec1-openssl.so (libc6,x86-64) => /usr/lib/libxmlsec1-openssl.so
	libwolfssl.so.35 (libc6,x86-64) => /usr/lib/libwolfssl.so.35
	libwolfssl.so (libc6,x86-64) => /usr/lib/libwolfssl.so
	libssl3.so (libc6,x86-64) => /usr/lib/libssl3.so
	libssl3.so (libc6) => /usr/lib32/libssl3.so
	libssl.so.3 (libc6,x86-64) => /usr/lib/libssl.so.3
	libssl.so.3 (libc6) => /usr/lib32/libssl.so.3
	libssl.so.1.1 (libc6,x86-64) => /usr/lib/libssl.so.1.1
	libssl.so (libc6,x86-64) => /usr/lib/libssl.so
	libssl.so (libc6) => /usr/lib32/libssl.so
	libgnutls-openssl.so.27 (libc6,x86-64) => /usr/lib/libgnutls-openssl.so.27
	libgnutls-openssl.so (libc6,x86-64) => /usr/lib/libgnutls-openssl.so
	libevent_openssl-2.1.so.7 (libc6,x86-64) => /usr/lib/libevent_openssl-2.1.so.7
	libevent_openssl-2.1.so (libc6,x86-64) => /usr/lib/libevent_openssl-2.1.so

How to reproduce

After setting up a new Prisma 4.9 project and installing the dependencies, run prisma generate in Arch Linux.

Expected behavior

No warning messages appear, as in all versions prior to 4.9.

Prisma information

generator client {
  provider = "prisma-client-js"
}

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

model User {
  id     String  @id
  name   String
}

Environment & setup

  • OS: Arch Linux
  • Database: Postgres
  • Node.js version: v16.18.1

Prisma Version

4.9.0

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 8
  • Comments: 17 (3 by maintainers)

Most upvoted comments

Hi everyone, Alberto from Prisma here. We have seen that many of you reacted to this warning, so we listened and changed it to

Prisma doesn’t know which engines to download for the Linux distro “${originalDistro}”. Falling back to Prisma engines built for “debian”. Please report your experience by creating an issue at ‘https://github.com/prisma/prisma/issues’, so we can add your distro to the list of known supported distros.

in the upcoming prisma@4.10.0 release, where originalDistro is the name of your distro as read from the ID field of /etc/os-release (e.g., arch).

Additionally, this will not actually pop up anymore for most of the distros that have been mentioned in this issue before.


Let’s break the old warning message down to understand why this warning was appearing in the first place:

Prisma failed to detect the Linux distro in use, and may not work as expected. Defaulting to “debian”.

Prisma failed to detect the Linux distro in use means that Arch Linux (and similar distros like Manjaro and EndeavourOS) weren’t explicitly handled by Prisma. Before downloading Prisma engines (which are compiled for several platforms / architectures / openssl combinations), we check whether we’re on Alpine, on a Debian-like distro or on RHEL.

and may not work as expected means that Prisma developers aren’t able to provide guarantees that Prisma will run on a system that we didn’t officially test on. However, Prisma worked fine on your machine before prisma@4.9.0, it will keep working as usual even if you see this warning (that’s why it’s only a warning, and not an error).

Defaulting to "debian" means that Prisma will fall back to downloading the engines that were compiled for Debian-like distros, which happen to run fine on Arch-like distros as well.

Same warning here after upgrading to Prisma 4.9.0

  • OS: Arch Linux
  • Database: Postgres
  • Node: v19.3.0

Same warning here using Prisma 4.9.0

  • OS: Arch Linux
  • Database: MySQL
  • Node: 18.13.0

Can we get an environment variable or some form of setting we can set to hide the message / override that default distro? so I can just set a system wide environment variable like PRISMA_ENGINE_DISTRO=debian to confirm that my system should get the engines built for Debian and not show the warning.

or perhaps only show the message if the distro is untested and the engine fails to load, letting the user know that it was the unsupported distro that may have caused the issue. or show the message on the first run.

Something so that every script importing Prisma doesn’t log this warning.

EDIT: temp fix you can use PRISMA_DISABLE_WARNINGS=1 but it would be nice for a version of this specific to this issue so other prisma warnings would show up.