Hello, is there a limit on active sessions for a p...
# orm-help
c
Hello, is there a limit on active sessions for a particular prisma service? I have my server code deployed on lambda, where my prisma-binding gets instantiated on every request (using service token). Recently, I started getting this error when making requests using prisma-binding:
Copy code
Your token is invalid. It might have expired or you might be using a token from a different project.
Didn't happen before.
d
There is no limit.
h
Hi @congy As @dpetrick has already mentioned, there is no limit on number of active session. The error you are getting suggest that you forgot to pass your service secret to prisma binding. Without this secret, prisma binding can't authenticate with the Prisma Server. Please take the secret from your
prisma.yml
file and pass it on to the prisma binding class like so:
Copy code
const prisma = new Prisma({
  typeDefs: '<you typedef location>,
  endpoint: '<your endpoint>',
  secret: '<your secret>'
})
c
I have my secret in there. And it worked before, and even now it works sometimes (like 1 request out of 10).
h
Might be an issue related to server time then. Check your prisma server's time. Try to match with the location where your lambda function is hosted. Sometimes binding can create a token with an invalid time(ie time in the future).
c
Isn't it a strange behavior? My prisma server is hosted in AWS datacenter (Ireland), and I'm using it from central europe (different timezone). I need to access my prisma-server from both lambda-function (in the same timezone that my prisma-server is located) and from my own computer (different timezone than prisma-server).
d
Maybe the server time is out of sync with the actual time. Can you please try to use something like ntp to fix it, and get back with info if this works or doesn't? https://www.tecmint.com/synchronize-time-with-ntp-in-linux/
c
Unfortunately I can't, my prisma-server is an ECS instance with Fargate launch type (fully-managed, serverless container service), and I can't ssh into that particular machine.
d
maybe you can recycle the server by changing fargate configuration? A new server would ensure correct time. Just to validate this hypothesis!
c
Some of my colleges were having the "time out of sync" issue, but they managed to solve it locally on their computer. I think the problem might be somewhere else.
Will try it, and post my findings after it's done.
@divyendu I've tried it out, but the issue still persists.