Skip to content

Conversation

@DmitriyAlergant
Copy link
Contributor

Fixes cross-platform Docker build issue where prisma generate fails when building for amd64 platform from macOS using OrbStack while attempting to install nodejs.

When python prisma attempts to bootstrap nodeenv to run prisma generate it seems to be failing in this image (chainguard) in this environment.

docker buildx build . -f Dockerfile -t litellm:mybuild --platform linux/amd64

Error log before the change (original state)

...
=> [runtime 11/16] RUN chmod +x docker/install_auto_router.sh && ./docker/install_auto_router.sh                                                                                                               3.7s 
 => ERROR [runtime 12/16] RUN prisma generate                                                                                                                                                                   9.4s 
------                                                                                                                                                                                                               
 > [runtime 12/16] RUN prisma generate:                                                                                                                                                                              
0.919 Installing Prisma CLI                                                                                                                                                                                          
1.381  * Install prebuilt node (25.2.1) ../usr/lib/python3.13/site-packages/nodeenv.py:639: DeprecationWarning: Python 3.14 will, by default, filter extracted tar archives and reject files or modify their metadata. Use the filter argument to control this behavior.                                                                                                                                                                  
3.723   archive.extractall(src_dir, extract_list)                                                                                                                                                                    
5.676 ... done.
8.438 An error ocurred while installing the Prisma CLI; npm install log: npm error cannot set sizeCalculation without setting maxSize or maxEntrySize
8.438 npm error A complete log of this run can be found in: /root/.npm/_logs/2025-11-21T01_16_51_193Z-debug-0.log
8.438 
8.444 Traceback (most recent call last):
8.448   File "/usr/bin/prisma", line 7, in <module>
8.448     sys.exit(main())
8.448              ~~~~^^
8.448   File "/usr/lib/python3.13/site-packages/prisma/cli/cli.py", line 39, in main
8.448     sys.exit(prisma.run(args[1:]))
8.448              ~~~~~~~~~~^^^^^^^^^^
8.448   File "/usr/lib/python3.13/site-packages/prisma/cli/prisma.py", line 36, in run
8.448     entrypoint = ensure_cached().entrypoint
8.448                  ~~~~~~~~~~~~~^^
8.448   File "/usr/lib/python3.13/site-packages/prisma/cli/prisma.py", line 104, in ensure_cached
8.448     proc.check_returncode()
8.448     ~~~~~~~~~~~~~~~~~~~~~^^
8.448   File "/usr/lib/python3.13/subprocess.py", line 508, in check_returncode
8.448     raise CalledProcessError(self.returncode, self.args, self.stdout,
8.448                              self.stderr)
8.448 subprocess.CalledProcessError: Command '['/root/.cache/prisma-python/nodeenv/bin/npm', 'install', 'prisma@5.4.2']' returned non-zero exit status 1.
------
Dockerfile:76
--------------------
  74 |     
  75 |     # Generate prisma client
  76 | >>> RUN prisma generate
  77 |     RUN chmod +x docker/entrypoint.sh
  78 |     RUN chmod +x docker/prod_entrypoint.sh
--------------------
ERROR: failed to build: failed to solve: process "/bin/sh -c prisma generate" did not complete successfully: exit code: 1

The same command succeeds after proposed change

Pre-Submission checklist

  • [N/A] I have Added testing in the [tests/litellm/]
  • [N/A] I have added a screenshot of my new test passing locally
  • [N/A] My PR passes all unit tests on [make test-unit]
  • [Y] My PR's scope is as isolated as possible, it only solves 1 specific problem

Type

🚄 Infrastructure

Changes

Adding nodejs npm to the image

Fixes cross-platform Docker build issue where `prisma generate` fails
when building for amd64 platform from macOS. The Prisma CLI requires
Node.js and npm to be available in the runtime environment.

The Python prisma package (v0.11.0) uses nodeenv to bootstrap Node.js
if not found. However, the downloaded npm v10 fails with a
"sizeCalculation" error in minimal Chainguard environments during
cross-platform builds. Providing system nodejs/npm resolves this.

Changes:
- Added nodejs and npm to runtime dependencies (Dockerfile:51)
- This enables prisma generate to run successfully during the build

Error without fix:
npm error cannot set sizeCalculation without setting maxSize or maxEntrySize
subprocess.CalledProcessError: Command '[...nodeenv/bin/npm', 'install',
'prisma@5.4.2']' returned non-zero exit status 1.

Testing:
docker buildx build --platform linux/amd64 -t litellm:test .
@vercel
Copy link

vercel bot commented Nov 21, 2025

@claude is attempting to deploy a commit to the CLERKIEAI Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@krrishdholakia krrishdholakia merged commit 90850bf into BerriAI:main Nov 23, 2025
1 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants