Slackbot
05/18/2023, 2:51 PM아침이슬
05/18/2023, 2:55 PM/src/api-server/services/api_token.go:249 unexpected EOF
[0.253ms] [rows:0] SELECT * FROM "api_token" WHERE token = 'mysecrettoken' AND "api_token"."deleted_at" IS NULL ORDER BY "api_token"."id" LIMIT 1
In yatai version 1.1.9, the code on line 249 looks like this
249: err := getBaseQuery(ctx, s).Where("token = ?", token).First(&apiToken).Error
250: if err != nil {
251: return nil, err
252: }
253: if apiToken.ID == 0 {
254: return nil, consts.ErrNotFound
255: }
If the returned row count is 0, you can see that the application logic(line 253) handles the exception separately. However, if the error occurs in the 249th line itself, it is believed to be a database connection issue.
However, in postgresql, the number of connections that yatai is actively connecting to is between 1 and 2.
SELECT count(*) FROM pg_stat_activity where datname = 'yatai';
The maxOpenConns
value defined in yatai values.yaml is 10, so I think it is not an issue caused by insufficient number of connections.
That’s as far as I’ve gotten, and I’m not sure what else to check here, so I’m asking if anyone has resolved an issue like this before.아침이슬
05/19/2023, 4:13 PMLOG: PID 26806 in cancel request did not match any process
LOG: PID 27118 in cancel request did not match any process
LOG: PID 27354 in cancel request did not match any process
After setting the maxIdleConns
value to 0 in the yatai values.yaml file, I noticed that the unexpected EOF error no longer occurs. If anyone else has experienced a similar issue, I hope this helps.