-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connection terminated unexpectedly #3182
Comments
This seems to be tls issue with your database. Hard to say without debugging this further on infrastructure level. |
I have run some additional tests and I can reproduce the behavior locally with this stack compose file: version: '3'
networks:
infisical:
volumes:
pg_data:
redis_data:
services:
backend:
image: infisical/infisical:v0.113.0-postgres
env_file: .env
networks:
- infisical
ports:
- 8080:8080
deploy:
replicas: 1
redis:
image: redis
environment:
- ALLOW_EMPTY_PASSWORD=yes
networks:
- infisical
volumes:
- redis_data:/data
deploy:
replicas: 1
db:
image: postgres:14-alpine
env_file: .env
volumes:
- pg_data:/var/lib/postgresql/data
networks:
- infisical
ports:
- 5432:5432
deploy:
replicas: 1 TLS is not configured, and I am not having any connection issues to the Postgres service from other clients. Connection string and postgres authentication parameters are correct as i can use the frontend to manage my Infisical projects. As I said, only after a period of inactivity i get the |
Hi @7hael Interesting. Let me check on this, may be it's because of not being inactive in our product - this issue not happening |
Describe the bug
When performing API calls to my self-hosted instance after a period of inactivity, I occasionally get the following error:
Only after the first one or two error responses the API works as expected.
To Reproduce
Steps to reproduce:
/api/v1/auth/universal-auth/login
.Expected behavior
The API should immediatly respond with the access token.
Additional context
The error can occur for every API call, I just usually get it for the universal-auth after some period of inactivity on Infisical, but i had the same problem with different calls.
I suppose this has to do with the database connection configurations. In the instance.ts the
pool
parameter is not passed to knex, so the default values are used. As it is stated in the official documentation and in this knex issue (which addresses the same exact problem I am having), it is advised to change the pool'smin
value to 0. Is there any particular reason why the pool'smin
value is not being set? Wouldn't it be better to make it configurable via an environment variable?The text was updated successfully, but these errors were encountered: