dott.bio/maus
dott.bio/maus
RRailway
Created by Spacemandev on 9/18/2023 in #✋|help
OpenSSL error when using Bun + Prisma
Basically the configuration specifies what to include in your container, and how to build your app.
65 replies
RRailway
Created by Spacemandev on 9/18/2023 in #✋|help
OpenSSL error when using Bun + Prisma
Indeed, it uses nixpacks. It supports JSON too, though!
65 replies
RRailway
Created by Spacemandev on 9/18/2023 in #✋|help
OpenSSL error when using Bun + Prisma
Hehey! 🎉 Awesome work, jr, thanks a lot! 🙌
65 replies
RRailway
Created by Spacemandev on 9/18/2023 in #✋|help
OpenSSL error when using Bun + Prisma
It works great now, either way. Thanks for all the help! 🙌
65 replies
RRailway
Created by Spacemandev on 9/18/2023 in #✋|help
OpenSSL error when using Bun + Prisma
Did you push some new stuff, or have I been hallucinating all these errors from before? 🫠 😂
65 replies
RRailway
Created by Spacemandev on 9/18/2023 in #✋|help
OpenSSL error when using Bun + Prisma
There's soon going to be nothing left of my nixpacks.toml at this rate.
65 replies
RRailway
Created by Spacemandev on 9/18/2023 in #✋|help
OpenSSL error when using Bun + Prisma
Let me try entirely w/o it then.
65 replies
RRailway
Created by Spacemandev on 9/18/2023 in #✋|help
OpenSSL error when using Bun + Prisma
Oh! OK. 👍
65 replies
RRailway
Created by Spacemandev on 9/18/2023 in #✋|help
OpenSSL error when using Bun + Prisma
What happens if you add the nixLibs part? 🙂
65 replies
RRailway
Created by Spacemandev on 9/18/2023 in #✋|help
OpenSSL error when using Bun + Prisma
Funky, huh? If you cannot see the nixpacks.toml, this is it:
[phases.setup]
nixPkgs = ['...', 'imagemagick', 'nodejs', 'openssl']
nixLibs = ['...', 'openssl']

[phases.build]
cmds = [
'...',
'bun run checkdeps',
'bun run get-chrome',
'bun run prisma generate',
'rm -f /usr/bin/node',
]

[start]
cmd = 'bun run start'
[phases.setup]
nixPkgs = ['...', 'imagemagick', 'nodejs', 'openssl']
nixLibs = ['...', 'openssl']

[phases.build]
cmds = [
'...',
'bun run checkdeps',
'bun run get-chrome',
'bun run prisma generate',
'rm -f /usr/bin/node',
]

[start]
cmd = 'bun run start'
65 replies
RRailway
Created by Spacemandev on 9/18/2023 in #✋|help
OpenSSL error when using Bun + Prisma
65 replies
RRailway
Created by Spacemandev on 9/18/2023 in #✋|help
OpenSSL error when using Bun + Prisma
Wat: failed to create symbolic link '/etc/resolv.conf': Device or resource busy 🔍
65 replies
RRailway
Created by Spacemandev on 9/18/2023 in #✋|help
OpenSSL error when using Bun + Prisma
I'll give it a go! 👍
65 replies
RRailway
Created by Spacemandev on 9/18/2023 in #✋|help
OpenSSL error when using Bun + Prisma
Interesting! Under which section did you put the nixLibs? 🙂
65 replies
RRailway
Created by Spacemandev on 9/18/2023 in #✋|help
OpenSSL error when using Bun + Prisma
Exactly. Then symlink the .so/.3-files to make the prisma driver work.
65 replies
RRailway
Created by Spacemandev on 9/18/2023 in #✋|help
OpenSSL error when using Bun + Prisma
I have also tried using nixLibs = ['...', 'openssl'] in both [start] and [phases.build]. But I get super weird errors. I believe this is a better solution, for sure, if it would work.
65 replies
RRailway
Created by Spacemandev on 9/18/2023 in #✋|help
OpenSSL error when using Bun + Prisma
I got it up and running: 🎉 Both with prisma generate and starting the server. This is my nixpacks.toml:
[phases.setup]
nixPkgs = ['...', 'nodejs']

[phases.build]
cmds = [
'...',
'bun run prisma generate',
'ln -s /usr/lib/x86_64-linux-gnu/libssl.so /lib/libssl.so',
'ln -s /usr/lib/x86_64-linux-gnu/libssl.so.3 /lib/libssl.so.3',
'ln -s /usr/lib/x86_64-linux-gnu/libcrypto.so /lib/libcrypto.so',
'ln -s /usr/lib/x86_64-linux-gnu/libcrypto.so.3 /lib/libcrypto.so.3',
]

[start]
cmd = 'bun run start'
[phases.setup]
nixPkgs = ['...', 'nodejs']

[phases.build]
cmds = [
'...',
'bun run prisma generate',
'ln -s /usr/lib/x86_64-linux-gnu/libssl.so /lib/libssl.so',
'ln -s /usr/lib/x86_64-linux-gnu/libssl.so.3 /lib/libssl.so.3',
'ln -s /usr/lib/x86_64-linux-gnu/libcrypto.so /lib/libcrypto.so',
'ln -s /usr/lib/x86_64-linux-gnu/libcrypto.so.3 /lib/libcrypto.so.3',
]

[start]
cmd = 'bun run start'
I'm not sure if this is a good idea, but it works. 👍 Explanation: - Prisma will look in /lib for libssl.so.3 and libcrypto.so.3, so we symlink them there. - It needs to be /lib since prisma will use $LD_LIBRARY_PATH when searching, and only /lib is included by default - You can run prisma generate by including nodejs in your container (you can remove it after running it) - Also: OpenSSL is already included in the container by default (no need to add it!)
65 replies
RRailway
Created by Spacemandev on 9/18/2023 in #✋|help
OpenSSL error when using Bun + Prisma
That's where they exist RN. Will try to symlink. 👍
65 replies
RRailway
Created by Spacemandev on 9/18/2023 in #✋|help
OpenSSL error when using Bun + Prisma
/usr/lib/x86_64-linux-gnu/libssl.so.3
/usr/lib/x86_64-linux-gnu/libssl.so
/usr/lib/x86_64-linux-gnu/libssl.so.3
/usr/lib/x86_64-linux-gnu/libssl.so
65 replies
RRailway
Created by Spacemandev on 9/18/2023 in #✋|help
OpenSSL error when using Bun + Prisma
Hey gang! Having this very same issue. Prisma will look in /usr/lib64 and /lib64 for libssl. However, there is no libssl there, even though you've installed it. Running openssl version -e in the container returns:
ENGINESDIR: "/nix/store/2kl52k9kclb82bg8nvf4paxb3v972c70-openssl-3.0.10/lib/engines-3
ENGINESDIR: "/nix/store/2kl52k9kclb82bg8nvf4paxb3v972c70-openssl-3.0.10/lib/engines-3
So I just think there's a missing symlink or $LD_LIBRARY_PATH missing somewhere. I don't have any experience with NixOS or Nixpacks, so would love some help here. 🙏
65 replies