-
-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prisma engine architecture mismatch #337
Comments
@egyleader I understand your feelings very well. I am temporarily unable to solve the unpleasantness caused by this step. This requires Prisma to officially launch a new engine (currently being experimentally tried internally) that has not yet been announced to the public. Prisma currently has two engines: binary and NAPI. Obviously, the NAPI engine was developed for Node, and other languages can only use binary engines. Therefore, developers have to be required to download the corresponding engine on the appropriate architecture platform. |
ok I understand the limitations of the current engine and the potential of the next one , but can we update the documentaion with warnings and current workarounds ??? the ability to use prisma with cloud providers is essential to any dart built api using prisma and will maximize the community of prisma-dart client and can push the development of this features and package further . |
@egyleader Stability with cloud providers is difficult for me, my country is banned from using Google cloud and AWS! I personally don't have the funds to purchase and test it. Often in this case I need help with ingestion, regarding compilation in Docker, maybe this file 👉 can help you https://github.com/NeroSong/dart_orm_docker_example/blob/master/Dockerfile This file is an example written by a Prisma Client Dart user in the community when writing a blog . Maybe you can refer to it, or maybe @NeroSong can help. |
@egyleader Hi, Have you fixed it yet? |
no , used the refrenced docker file and tried to get it to work but faced the same error |
there is a problem in generating the prisma engine binary on server side |
@egyleader I think because we need check connect with database |
I'll follow up, it seems that Prisma recently added architecture support, I don't know if this is the cause. Maybe it won't be anytime soon, my wife just had a baby and I have my hands full. |
FROM dart:stable AS build
WORKDIR /app
COPY pubspec.* ./
RUN dart pub get
COPY . .
RUN dart pub get --offline
# Install Node.js LTS to build prisma
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - &&\
apt-get install -y nodejs
RUN npm install prisma
RUN npx prisma generate
RUN dart compile exe bin/dart_orm_docker_test.dart -o bin/server
# Copy Prisma Engine deps so to `/runtime/`
RUN FILES="libz.so libgcc_s.so libssl.so libcrypto.so"; \
for file in $FILES; do \
so="$(find / -name "${file}*" -print -quit)"; \
dir="$(dirname "$so")"; \
mkdir -p "/runtime${dir}"; \
cp "$so" "/runtime$so"; \
echo "Copied $so to /runtime${so}"; \
done
FROM scratch
COPY --from=build /runtime /
COPY --from=build /app/bin/server /app/bin/
COPY --from=build /app/prisma-query-engine /app/prisma-query-engine
WORKDIR /app
CMD ["./bin/server"] |
this work for me with postgresql, thank you |
@egyleader cc: @medz Hai, did you solve this problem? precondition
conclusionThe conclusion was that we lacked the necessary dependent modules to run prisma-query-engine. solutionNot everything is correct. Please modify it for your environment. schema.prisma
Dockerfile FROM dart:3.2.0
# Install Node.js LTS to builder
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - &&\
apt-get install -y nodejs
RUN apt-get update && \
apt-get install -y wget
# install libssl1.1
RUN wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb || (echo "Failed to download libssl1.1" && exit 1) && \
dpkg -i libssl1.1_1.1.0g-2ubuntu4_amd64.deb && \
rm libssl1.1_1.1.0g-2ubuntu4_amd64.deb
RUN apt-get install -y musl musl-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Configure runtime for prisma
RUN FILES="libz.so libgcc_s.so libssl.so libcrypto.so"; \
for file in $FILES; do \
so="$(find / -name "${file}*" -print -quit)"; \
dir="$(dirname "$so")"; \
mkdir -p "/runtime${dir}"; \
cp "$so" "/runtime$so"; \
echo "Copied $so to /runtime${so}"; \
done
COPY /runtime/ /app
RUN npm install prisma
COPY /database/cloud/prisma-query-engine /app/prisma-query-engine
CMD ["dart", "hoge/api/main.dart"]
InspectionI noticed this after checking the error log in process.
and execute the ldd command and output the following log
can see that I hope my comments here are helpful. |
@yamarkz The binary engine is downloaded from Prisma CLI. Please remove the 'binaryTargets' setting. I did not find any remaining errors during Dockerfile testing. If it still exists, can you give me the smallest reproduction repo? |
Also, it would be best if you could upgrade to the latest version. Due to the fact that I am the only one maintaining this library and my energy is limited, there is currently no idea of maintaining multiple versions. |
problem :
when generating prisma client on mac os or windows and deploying to linux machine the result engine works on the native machine , but when deployed it gives the ambiguous error :
Exception: Prisma binary query engine not ready
.inspection :
after trying a lot of things to try to identify the problem I inspected that the problem is with file architecture , so I tired two solutions :
First try :
I tried to compile linux architecture in macOS locally so it will be deployed automatically with my dart_frog api docker image to google cloud run , i used :
and it downloaded the linux binaries and generated the engine but didn't work when deployed 🤷🏻♂️
second try :
I tried to modify the docker file to install npx and generate the prisma engine on the deployed docker image itself as follows
but it results in the following error :
The text was updated successfully, but these errors were encountered: