-
-
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 binary query engine not ready #356
Comments
It seems like this is a repetitive problem, but there are many reasons that cause unpreparedness. I will look for an existing issue, hoping it will be helpful to you, |
Sorry for jumping right in but are you using I found my answer here I had to add PS: I'm not sorry if I sound disrespectful. I was stuck there for a few hours. |
@SL-Pirate I'm glad you found the problem 😊, I don't feel offended. Thank you for your reply. The same errors in different databases may come from different reasons. Prisma's errors are not so open and transparent, so it is difficult for me to cover all the errors. But I will make it better in my limited time. Friendly error messages are also one of them. There are almost no contributors to this project. Although it is not satisfactory, I have been trying my best. |
Yes, I totally understood that. I also contribute to open source so I understand your situation. I was on edge but knowing your situation I was trying my best to keep my cool. Again sorry if I was even a bit rude :) |
Yesss, FINALLY, I solved the same issue. I am using Mac M1. Here are the things that you need to check @PrzemyslawPluszowy @SL-Pirate
These fixed my issue |
I am working on an open-source project so I can post my DockerFike and docker-compose there. By the way, how I detected the fixes? When the dart frog server runs inside the container it tells: Here is the docker compose: version: "3"
services:
# Launch the db first
ribbit_database:
container_name: ribbit_database
hostname: ribbitdb
image: mysql:latest
restart: unless-stopped
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: myPassword123
MYSQL_DATABASE: hellav
MYSQL_USER: kerim
MYSQL_PASSWORD: myPassword123
# Launch this after
ribbit_main_service:
container_name: ribbit_main_service
build:
dockerfile: ./ribbit_main_service/Dockerfile
args:
- DATABASE_URL=mysql://kerim:myPassword123@ribbitdb:3306/hellav
ports:
- "8080:8080"
environment:
- PORT=8080
- JWT_SECRET=MyBiggestS3cr3t
- DATABASE_URL=mysql://kerim:myPassword123@ribbitdb:3306/hellav
networks:
ribbit:
external: true Here is the DockerFile: FROM dart:stable AS build
# Download npm to work with prisma within the build phase involving Dart
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - &&\
apt-get install -y nodejs
# Copying middle-end package
WORKDIR /app/ribbit_middle_end
COPY ribbit_main_service/ribbit_middle_end/pubspec.* ./
RUN dart pub get
COPY ribbit_main_service/ribbit_middle_end/. .
WORKDIR /app/ribbit_server
# Copying the server package
COPY ribbit_main_service/ribbit_server/pubspec.* ./
RUN dart pub get
COPY ribbit_main_service/ribbit_server/. .
# Expose DATABASE_URL as build-time env variable for prisma
ARG DATABASE_URL
# Generate prisma-related files
RUN npm install prisma
RUN npx prisma generate
# Generate other Dart classes
RUN dart pub run build_runner build
# Bundle the project
RUN dart pub global activate dart_frog_cli
RUN dart pub global run dart_frog_cli:dart_frog build
# Generate executable
RUN dart pub get --offline
RUN dart compile exe build/bin/server.dart -o build/bin/server
# 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
FROM scratch
# Copy runtime from previous build phase
COPY --from=build /runtime/ /
# Copy the source to review it within the Docker Container later
COPY --from=build /app/ribbit_server/. /app/source/
# Copy executable from the previous phase
COPY --from=build /app/ribbit_server/build/bin/server /app/bin/
# Copy executable the binary engine
COPY --from=build /app/ribbit_server/prisma-query-engine /app/bin/
# Prepare to execute the server within /app/bin/
WORKDIR /app/bin/
# Add required environment variables
ENV JWT_SECRET = "default-secret"
ENV PORT = 8080
ENV DATABASE_URL = ""
# Execute the server executable
CMD ["/app/bin/server"] |
@medz I think I could contribute into the docs about containerizing the Prisma since I'd been gathering the info into a whole for 3 days. I will read the guide |
@kerimamansaryyev Thank you very much, your PRs are always welcome❤️ |
Sorry guys, i have another problem when I shot postman i get .
im using mac m1
Found query engine binary in /Users/przemyslawnowak/Documents/my_project/prisma-query-engine POST /user Error thrown by handler. Exception: Prisma binary query engine not ready package:orm/engines/binary.dart 114:13 BinaryEngine._serverEndpoint.<fn> package:retry/retry.dart 131:24 RetryOptions.retry
Can you help me?
The text was updated successfully, but these errors were encountered: