-
-
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
No automatic reconnection to the database #1170
Comments
Also having same issue
|
Same issue with a mysql database |
Similar issue occurs overnight as a binary with a local mysql container Apr 13 14:38:04 * semaphore[86031]: [mysql] 2023/04/13 14:38:04 connection.go:196: busy buffer |
Hi, from what I've investigated it seems that Go's sql drivers do not handle automatic re-connection attempts. And it feels like they really don't want to implement it themselves and want to let it up to the individual developers (see here). For now the easiest fix for semaphore would be to implement explicit crash condition when this database connection loss is noticed. Semaphore will crash and restart, but at least you'd not have to restart it manually (if using |
I need to restart semaphore every morning or I cannot login. Binary + mysql docker container. For now a cronjob does the job, but it's a bit annoying that login sessions are never kept. I don't understand why the connection is even lost in the first place? I'm not seeing anything in the logs. |
Same here ! |
Until there is a better solution we "solved" it with a kubernetes probe : apiVersion: apps/v1
kind: Deployment
[...]
spec:
containers:
- env:
- name: SEMAPHORE_API_TOKEN
valueFrom:
secretKeyRef:
key: api-token
name: semaphore-api-token
image: xxx/ansible-semaphore:yyy
livenessProbe:
exec:
command:
- sh
- -c
- 'curl localhost:3000/api/projects -H "Authorization: Bearer $SEMAPHORE_API_TOKEN" --fail'
initialDelaySeconds: 300
periodSeconds: 5 When the API starts to fail, Kubernetes replaces the pod. |
I'm using semaphore with a postgreSQL database backend. When postgreSQL is restarted, semaphore crashes.
Steps to reproduce :
ss -tnp | grep 5432
)This happens in v2.7.22 and v2.8.77
Stack trace example :
The text was updated successfully, but these errors were encountered: