You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
After upgrading Prisma from 5.19.1 to 6.3.0, I encountered an issue where Prisma could no longer connect to the database in WSL 1.
Error: P1001: Can't reach database server at `localhost:5432`
To isolate the issue, I tested it directly with the tokio-postgres library and observed the following error message:
Failed to connect to database: error connecting to server: Protocol not available (os error 92)
This issue is not limited to localhost (localhost:5432)—it also occurs when connecting to any valid PostgreSQL URL, making database connections completely unusable in WSL 1.
Upon investigation, the issue is very likely caused by the use of TCP user timeout, which may not be supported in WSL 1. However, the existing approach of setting TCP keepalive works fine.
The relevant code can be found here: connect_socket.rs#L33
Regression Details:
This change was introduced in Prisma 5.22.0, when tokio-postgres was upgraded from 0.7.7 to 0.7.12.
Before Prisma 5.22.0, database connections in WSL 1 worked as expected.
Steps to Reproduce:
Use tokio-postgres in a WSL 1 environment
Attempt to connect to a PostgreSQL database running on localhost:5432
Observe the connection failure with os error 92
Expected Behavior:
tokio-postgres should be able to connect to the database in WSL 1, as it did in previous versions.
Environment:
Library: tokio-postgres
WSL Version: 1
Distro: Ubuntu 22.04.5 LTS
Database: PostgreSQL v16
Operating System: Windows 10
Thanks! Please let me know if I can provide any further details.
The text was updated successfully, but these errors were encountered:
Thanks for the quick reply! At the moment, I still need to stick with WSL 1 due to corporate policy for the Windows version. I also wanted to raise this in case there's a possible workaround or fix for WSL 1 users. Thanks again for taking the time to look into it.
Description:
Hello,
After upgrading Prisma from 5.19.1 to 6.3.0, I encountered an issue where Prisma could no longer connect to the database in WSL 1.
Error: P1001: Can't reach database server at `localhost:5432`
To isolate the issue, I tested it directly with the tokio-postgres library and observed the following error message:
This issue is not limited to localhost (localhost:5432)—it also occurs when connecting to any valid PostgreSQL URL, making database connections completely unusable in WSL 1.
Upon investigation, the issue is very likely caused by the use of TCP user timeout, which may not be supported in WSL 1. However, the existing approach of setting TCP keepalive works fine.
The relevant code can be found here: connect_socket.rs#L33
Regression Details:
Steps to Reproduce:
Expected Behavior:
tokio-postgres should be able to connect to the database in WSL 1, as it did in previous versions.
Environment:
Thanks! Please let me know if I can provide any further details.
The text was updated successfully, but these errors were encountered: