Error trying to generate Prisma Client inside OpenAI Codex Cloud environment. Can't download binary
I'm trying to use OpenAI Codex AI agent (Cloud).
I'm new to this (not a big vibecoder myself) but Codex is mostly working.
The only thing I can't get right despite having tryied a lot of different stuff is have it successfully generate my Prisma Client inside its cloud container so that it could run the code and test stuff autonomously (I don't mean to really use the client making requests to any database. its just that without the generated client I get TypeScript errors where I'm importing it).
The error when generating the Prisma Client seems to happen when it tries to download a binary:
Error: request to https://binaries.prisma.sh/all_commits/85179d7826409ee107a6ba334b5e305ae3fba9fb/debian-openssl-3.0.x/schema-engine.gz.sha256 failed, reason:
Full error bellow:
Codex environment is restrictive regarding network access. I have tried to enable full network access (for all methods and all hosts) although insecure, just for testing, but still got the same error.
Has anyone succeeded in making this work?
Is there any workaround for such environments with restricted network access?
I know that Prisma has to use/generate binaries specific to the OS, but have no idea how to make this scenario work.5 Replies
You selected the bot's instantaneous insights. Let me compile your answer right away!
The error you're seeing is due to Prisma CLI trying to download engine binaries from https://binaries.prisma.sh, which is blocked or inaccessible in your OpenAI Codex Cloud environment. This is a common issue in restricted or air-gapped environments.
Key points from the knowledge sources:
- Prisma CLI requires network access to download engine binaries and their checksum files during
You cannot currently generate the Prisma Client for the first time in a fully network-restricted environment. The best workaround is to generate the client elsewhere and copy it in. 🤔 Alright, thanks for letting us know that there's still some help needed. A team member will reply to you shortly. In the meantime, please let us know any additional info, questions, or which parts of the answer may need clarification.
prisma generate
. If the network is restricted, this process fails, even if you try to provide the binaries manually or set custom engine locations via environment variables. The CLI still attempts to fetch checksum files from the internet, causing the command to fail if it can't reach the server Is it possible to run "prisma generate" without internet connection?, prisma generate
tries to fetch engine checksum files from mirror even if custom engine locations are provided in an .env
file.
- There is currently no official, fully offline workflow for generating the Prisma Client in a fresh environment without any network access, unless all required binaries and their checksums are already cached in the expected locations (e.g., ~/.cache/prisma/master/...
). Even setting environment variables like PRISMA_QUERY_ENGINE_LIBRARY
or copying binaries manually does not prevent the CLI from trying to fetch checksums online Is it possible to run "prisma generate" without internet connection?, Control binary download and network access by CLI.
Workarounds:
- If you can build the Prisma Client in an environment with internet access, you can copy the generated client (the @prisma/client
directory after running prisma generate
) into your restricted environment. This avoids the need to run prisma generate
in the restricted environment.
- There is ongoing discussion
and open issues about improving offline support, but as of now, a fully offline, first-time prisma generate
is not officially supported Is it possible to run "prisma generate" without internet connection?, prisma generate
tries to fetch engine checksum files from mirror even if custom engine locations are provided in an .env
file.
Summary:You cannot currently generate the Prisma Client for the first time in a fully network-restricted environment. The best workaround is to generate the client elsewhere and copy it in. 🤔 Alright, thanks for letting us know that there's still some help needed. A team member will reply to you shortly. In the meantime, please let us know any additional info, questions, or which parts of the answer may need clarification.
Hey!
The error is related to Prisma binaries unable to be downloaded, presumably due to some kind of network restriction.
Could you try to use Prisma ORM without the rust binaries:
https://www.prisma.io/docs/orm/prisma-client/setup-and-configuration/no-rust-engine
This will become default in Prisma 7
Use Prisma ORM without Rust engines | Prisma Documentation
Learn how to use Prisma ORM without Rust engines
Hello @Nurul thanks for de direction!
I'm glad to test this!
Still got the same error though. It looks like it's still downloading the sha256 hash.
Am I missing something with my setup?
schema.prisma
package.json
- NodeJS 24
- PNPM 10when I run locally the command
DEBUG=* pnpm generate
I get the attached outputI've tried with the new
prisma-client
provider and still got the same error again.
Maybe if I'm using Prisma without Rust and with the new provider, could I remove the generated folder from the gitignore, keep it under version control and not need to generate it every time?
I think that would do the trick since I wouldnt need to generate again inside Codex cloud environment, but would that be a good practice?