Getting error when trying to use the new prisma client with pg adapter #1931

Closed
opened 2026-03-13 09:13:19 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @BjoernRave on GitHub (Sep 15, 2025).

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

  1. Install prisma using the new generator/client: https://www.prisma.io/docs/orm/prisma-client/setup-and-configuration/no-rust-engine?utm_source=twitter
  2. try to use better-auth with the prisma adapter

Current vs. Expected behavior

when an endpoint from better-auth gets hit I get this error:

2025-09-15T14:29:24.444Z ERROR [Better Auth]: INTERNAL_SERVER_ERROR [Error [DriverAdapterError]: could not open file "global/pg_filenode.map": Input/output error] {
dashboard:dev:   clientVersion: '6.16.1',
dashboard:dev:   [cause]: [Object]
dashboard:dev: }

Using it with the old prisma setup works fine

What version of Better Auth are you using?

1.3.9

System info

{
  "system": {
    "platform": "darwin",
    "arch": "arm64",
    "version": "Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:30 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6020",
    "release": "24.6.0",
    "cpuCount": 12,
    "cpuModel": "Apple M2 Pro",
    "totalMemory": "32.00 GB",
    "freeMemory": "2.62 GB"
  },
  "node": {
    "version": "v22.14.0",
    "env": "development"
  },
  "packageManager": {
    "name": "npm",
    "version": "10.9.2"
  },
  "frameworks": null,
  "databases": null,
  "betterAuth": {
    "version": "Unknown",
    "config": null
  }
}

Which area(s) are affected? (Select all that apply)

Backend

Auth config (if applicable)

import { betterAuth } from "better-auth"
export const auth = betterAuth({
  emailAndPassword: {  
    enabled: true
  },
});

Additional context

No response

Originally created by @BjoernRave on GitHub (Sep 15, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce 1. Install prisma using the new generator/client: https://www.prisma.io/docs/orm/prisma-client/setup-and-configuration/no-rust-engine?utm_source=twitter 2. try to use better-auth with the prisma adapter ### Current vs. Expected behavior when an endpoint from better-auth gets hit I get this error: ``` 2025-09-15T14:29:24.444Z ERROR [Better Auth]: INTERNAL_SERVER_ERROR [Error [DriverAdapterError]: could not open file "global/pg_filenode.map": Input/output error] { dashboard:dev: clientVersion: '6.16.1', dashboard:dev: [cause]: [Object] dashboard:dev: } ``` Using it with the old prisma setup works fine ### What version of Better Auth are you using? 1.3.9 ### System info ```bash { "system": { "platform": "darwin", "arch": "arm64", "version": "Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:30 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6020", "release": "24.6.0", "cpuCount": 12, "cpuModel": "Apple M2 Pro", "totalMemory": "32.00 GB", "freeMemory": "2.62 GB" }, "node": { "version": "v22.14.0", "env": "development" }, "packageManager": { "name": "npm", "version": "10.9.2" }, "frameworks": null, "databases": null, "betterAuth": { "version": "Unknown", "config": null } } ``` ### Which area(s) are affected? (Select all that apply) Backend ### Auth config (if applicable) ```typescript import { betterAuth } from "better-auth" export const auth = betterAuth({ emailAndPassword: { enabled: true }, }); ``` ### Additional context _No response_
GiteaMirror added the adapter label 2026-03-13 09:13:19 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Sep 15, 2025):

Hi @BjoernRave! I'm Dosu and I’m helping the better-auth team.

This error (could not open file "global/pg_filenode.map": Input/output error) is coming from the PostgreSQL driver layer, not directly from Better Auth or its Prisma adapter. There are no known compatibility issues or special configuration requirements for using Better Auth v1.3.9 with Prisma client v6.16.1 and the new pg adapter, and the Better Auth codebase does not include any explicit handling for the new Prisma/pg stack as of this version. The adapter expects standard Prisma client usage, and the documentation only notes to import the Prisma client from the correct location if you use a custom output directory in your Prisma schema (docs).

The specific error you’re seeing is typical of a PostgreSQL server or file system issue, and may be triggered by the way the new Prisma driver interacts with your database. This could be environmental (e.g., file system access on your DB server, or using a managed Postgres instance that restricts certain operations) or a result of incompatibility between the new Prisma driver and your database/storage setup. There’s no evidence that this is a bug in Better Auth or its Prisma adapter (source).

If reverting to the old Prisma setup resolves the issue, it’s likely related to the new Prisma client’s driver adapter or your database environment, not Better Auth itself.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

@dosubot[bot] commented on GitHub (Sep 15, 2025): <!-- Greeting --> Hi @BjoernRave! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the better-auth team. <!-- Answer --> This error (`could not open file "global/pg_filenode.map": Input/output error`) is coming from the PostgreSQL driver layer, not directly from Better Auth or its Prisma adapter. There are no known compatibility issues or special configuration requirements for using Better Auth v1.3.9 with Prisma client v6.16.1 and the new pg adapter, and the Better Auth codebase does not include any explicit handling for the new Prisma/pg stack as of this version. The adapter expects standard Prisma client usage, and the documentation only notes to import the Prisma client from the correct location if you use a custom output directory in your Prisma schema ([docs](https://github.com/better-auth/better-auth/blob/5b06218d7fd6673df2fdfbade1640d9bed0f2906/docs/content/docs/adapters/prisma.mdx)). The specific error you’re seeing is typical of a PostgreSQL server or file system issue, and may be triggered by the way the new Prisma driver interacts with your database. This could be environmental (e.g., file system access on your DB server, or using a managed Postgres instance that restricts certain operations) or a result of incompatibility between the new Prisma driver and your database/storage setup. There’s no evidence that this is a bug in Better Auth or its Prisma adapter ([source](https://github.com/better-auth/better-auth/issues/3736)). If reverting to the old Prisma setup resolves the issue, it’s likely related to the new Prisma client’s driver adapter or your database environment, not Better Auth itself. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/bbbd5a69-6a4a-4037-bfd7-6c6bfb3ef5ef?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/bbbd5a69-6a4a-4037-bfd7-6c6bfb3ef5ef?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/bbbd5a69-6a4a-4037-bfd7-6c6bfb3ef5ef?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/bbbd5a69-6a4a-4037-bfd7-6c6bfb3ef5ef?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/bbbd5a69-6a4a-4037-bfd7-6c6bfb3ef5ef?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/bbbd5a69-6a4a-4037-bfd7-6c6bfb3ef5ef?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/bbbd5a69-6a4a-4037-bfd7-6c6bfb3ef5ef?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/cdda13d9-dd27-4d31-b09a-5d8bec92de21/ask?utm_source=github)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/better-auth/better-auth/issues/4672)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#1931