prisma: ETXTBSY error when an instance of prisma2 is already running

Hi. I am trying to run studio against microservices with its own database (different schema.prisma files) and I get ETXTBSY error when doing so.

Steps to reproduce:

  1. CD to the first microservice. Run prisma2 studio to open up the studio for the first microservice. Everything works fine here.

  2. Keep the first instance of studio running, CD to the second microservice and run prisma2 studio or prisma2 generate. You get this error:

Error: ETXTBSY: text file is busy, open '/home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/query-engine-debian-openssl-1.1.x'
  1. Go back to the first microservice, stop the first instance of prisma2 studio and then run the commands in the second microservice, and then it works.

So, at max it is now possible to have only one instance of studio running at this time for me if prisma2 is installed globally as I see. So, when I have microservices with its own databases, not sure how to get multiple instances of studio running to connect to each of them.

STEPS I DID FOR WORKING AROUND THIS PROBLEM:

  1. Uninstall the global installation of prisma2

  2. Install it as a dev dependency locally specific to each microservice with npm install prisma2 --save-dev

  3. Then run studio in each microservice with npx prisma2 studio --port=5555 and npx prisma2 studio --port=5556 and then, it works without any issues.

So, I guess the problem is one binary being used for all instances of studio.

But then, still you have the problem that in every microservice, you need to stop the specific instance of studio to run prisma2 generate against it since it gets locked with itself.

Running Ubuntu 19.10:

Linux vignesh-predator 5.3.0-24-generic #26-Ubuntu SMP Thu Nov 14 01:33:18 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Tried this in prisma2 alpha as well as preview-019. Version:

prisma2@2.0.0-alpha.475, binary version: 8d3279825dadef204b1606d25b3c02db0ca33c91

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 3
  • Comments: 25 (22 by maintainers)

Most upvoted comments

Adding a gif here to show the error for the repo https://github.com/vignesh-test-org/prisma-db-etxbsy

Peek 2020-01-20 22-30

Thanks a lot for reporting 🙏 This issue is fixed in the latest alpha version of prisma2. You can try it out with npm i -g prisma2@alpha.

In case it’s not fixed for you - please let us know and we’ll reopen this issue!

@tvvignesh and @RafaelKr you’re both right, a checksum is the right thing to do. I did another test and it’s just ~ 100ms overhead when running things in parallel. I just implemented it, so we can all sleep well 😴

I can only reproduce this on Linux(I used ubuntu 19.10). I can’t reproduce this on a Mac

Thanks, I was able to reproduce this on Ubuntu 19.10 but not on a mac: image

Studio servers creates a photon worker cluster which is consuming the binary and it is unavailable for use for the other service.