prisma:warn Prisma failed to detect the libssl/openssl version to use, and may not work as expected. Defaulting to “openssl-1.1.x”.
Please manually install OpenSSL via apt-get update -y && apt-get install -y openssl and try installing Prisma again. If you’re running Prisma on Docker, add this command to your Dockerfile, or switch to an image that already has OpenSSL installed.
Error: Migration engine error:
/app/docker-entrypoint.js:24
reject(new Error(${command} failed rc=${code}))
^
Error: npx prisma migrate deploy failed rc=1
at ChildProcess. (/app/docker-entrypoint.js:24:16)
at ChildProcess.emit (node:events:513:28)
at ChildProcess._handle.onexit (node:internal/child_process:291:12)
Node.js v18.16.0
I’ve never had this issue in the past. Can someone please help?
flyctl automatically detects a Prisma app and creates a Dockerfile/entrypoint. It defaults to using sqlite but Postgres can of course be added.
The key point is that a Dockerfile is generated and seems to derive from a Debian base. Does your setup also include a Dockerfile? You should be able to just add the necessary dependency alongside the ones we already install.
Let me know if you’d like the Docker/fly.toml configs that were generated for the sample app and I can include them.
Good news for you and your hair, I believe I cracked it. Full disclosure that my test app still isn’t deploying but that’s likely due to us generating an entrypoint that expects npm run to work but this sample doesn’t have a run script. Here’s the Dockerfile I’m using:
# syntax = docker/dockerfile:1
# Adjust NODE_VERSION as desired
ARG NODE_VERSION=18.16.0
FROM node:${NODE_VERSION}-slim as base
LABEL fly_launch_runtime="NodeJS/Prisma"
# NodeJS/Prisma app lives here
WORKDIR /app
# Set production environment
ENV NODE_ENV=production
# Throw-away build stage to reduce size of final image
FROM base as build
# Install packages needed to build node modules
RUN apt-get update -qq && \
apt-get install -y python-is-python3 pkg-config build-essential openssl
# Install node modules
COPY --link package.json .
RUN npm install --production=false
# Generate Prisma Client
COPY --link prisma .
RUN npx prisma generate
# Copy application code
COPY --link . .
# Remove development dependencies
RUN npm prune --production
# Final stage for app image
FROM base
RUN apt-get update -qq && \
apt-get install -y openssl
# Copy built application
COPY --from=build /app /app
# Entrypoint prepares the database.
ENTRYPOINT ["/app/docker-entrypoint"]
# Start the server by default, this can be overwritten at runtime
CMD [ "npm", "run", "start" ]
The bit I added was this:
# Final stage for app image
FROM base
# Specifically this:
RUN apt-get update -qq && \
apt-get install -y openssl
Not sure what your Dockerfile was, but in our case we weren’t installing openssl in the final image. I’ll see if I can get that fixed.
Thank you. I copied your Dockerfile which seems to have fixed the original error. I am now however getting a different error:
In my terminal:
WARNING The app is not listening on the expected address and will not be reachable by fly-proxy.
You can fix this by configuring your app to listen on the following addresses:
0.0.0.0:3000
Found these processes inside the machine with open listening sockets:
PROCESS | ADDRESSES
-----------------*---------------------------------------
/.fly/hallpass | [fdaa:1:191:a7b:d6e9:4a80:ccea:2]:22
What’s in your fly.toml? Check that your HTTP listener isn’t set to port 8080, which I believe we generally default to. Sorry I don’t know the syntax off-hand, but I got this one as well and it turned out the ports didn’t match. Either listen on 8080 or change the config to reference 3000 and you should be good to go.
fly.toml was also set to 3000. Changed everything to 8080 now because that worked for me in the past too but unfortunately still getting the same errors. I suspect these errors are as a result of recent updates to the fly CLI - I updated from 1.2.X to 1.3.9 this morning and since then I haven’t been able to deploy an app successfully. Any thoughts?
I’ll take a look tomorrow morning, but if at all possible, it might be
wise to update to the latest flyctl and delete/re-create the app,
backing up your existing Dockerfile/fly.toml just in case. I did get a
fix for the broken Dockerfile upstreamed so with any luck it’ll just
work immediately for you this time around.
I followed the instructions on this post and changed ‘.flycast’ to ‘.internal’ in the url to my psql db and that seems to have fixed it. App is running