prisma-client-go icon indicating copy to clipboard operation
prisma-client-go copied to clipboard

Cant use `go run github.com/prisma/prisma-client-go db push` on Linux ARM-64

Open Looskie opened this issue 2 years ago • 8 comments

Hi, I've been having a ton of problems on my Raspberry Pi running Ubuntu 64bit running the go run github.com/prisma/prisma-client-go db push command.

I've been trying to debug this for around 10hrs+ and I think I might have found the issue?

I think its related to this https://github.com/prisma/prisma/issues/861

Here is the stack trace for go run github.com/prisma/prisma-client-go db push

panic: could not run [db push --preview-feature]: fork/exec /home/ubuntu/.cache/prisma/binaries/cli/2.26.0/prisma-cli-linux: exec format error

goroutine 1 [running]:
main.main()
	/home/ubuntu/go/pkg/mod/github.com/prisma/[email protected]/main.go:29 +0x40c
exit status 2

Please let me know what you think! Hope you're having a good day ❤️

Also side note, I tried installing the prisma CLI and tried doing it that way just for a shine of hope, and it generated it, but it panics on Connect saying

panic: ensure: version check failed: fork/exec /tmp/prisma/binaries/engines/9b816b3aa13cc270074f172f30d6eda8a8ce867d/unpacked/prisma-query-engine-linux: exec format error

goroutine 1 [running]:
main.main()
	/home/ubuntu/actions-runner/next/imperial/imperial/services/go/packages/api/main.go:91 +0x350
exit status 2

Looskie avatar Sep 12 '21 17:09 Looskie

cheers image

heybereket avatar Sep 12 '21 18:09 heybereket

cheers image

hexiro avatar Sep 15 '21 20:09 hexiro

This issue started randomly happening for me today. Deployed on Render. System info:

Linux
5.4.0-1039-gke
#41~18.04.1-Ubuntu SMP Sat Mar 20 14:57:07 UTC 2021
x86_64

Obviously I know the package is dead in the water, but I didn't expect it to just randomly break the binaries. Are these not the common Prisma binaries? Presumably it should continue to work?

liamross avatar Jan 11 '22 04:01 liamross

Nothing got changed there, so nothing should break.

Do you get the same message as the original poster? Or something slightly different? Whcih version?

janpio avatar Jan 11 '22 18:01 janpio

The error started happening on a redeploy of the exact same branch, so I suspect it has to do with fetching the system-specific CLI or binaries? You would probably know more about what Prisma does under the hood. Here is the error readout:

panic: could not run [migrate deploy --schema data/prisma/schema.prisma]: signal: segmentation fault

goroutine 1 [running]:
main.main()
        /opt/render/project/go/pkg/mod/github.com/prisma/[email protected]/main.go:29 +0x34c
exit status 2

I fixed it by doing the generate and deploy locally (M1 mac) and then zipping it up with the binaries that I extracted from my last functioning deploy and unzipping it during deploy on the server... Not an ideal fix. Basically if I try to generate or deploy on the linux box it breaks.

liamross avatar Jan 11 '22 22:01 liamross

Can you compare the new (broken) to the old (working) binaries? Can you list the binaries more exact? I do not have the full context on what the Go client does internally.

janpio avatar Jan 11 '22 23:01 janpio

I can't because the binaries never actually get generated. The command to generate the Go types and the binaries (generate) also fails with a similar message to the deploy command above. That's why the workaround is to run it locally on M1 and then zip it and deploy that on the server to avoid running generate and deploy as part of my build script on Linux where it breaks.

liamross avatar Jan 12 '22 17:01 liamross

So generate is the first command that fails? Same error output?

janpio avatar Jan 12 '22 17:01 janpio

Alright so it's quite clear why this is not working at this point. This is not a priority but I can take a look if anyone is still interested in having linux arm 64 binaries.

If you try, please use the latest branch as there are some fixes around the binaries: go get github.com/steebchen/prisma-client-go@main

steebchen avatar Jun 21 '23 22:06 steebchen

Thank you image

heybereket avatar Jun 21 '23 22:06 heybereket

Thank you image

hexiro avatar Jun 21 '23 22:06 hexiro

It MIGHT be fixed via #814, but honestly I have no idea if it does :D

steebchen avatar Jun 21 '23 22:06 steebchen

steeb the GOAT

image

Looskie avatar Jun 26 '23 04:06 Looskie