This message was deleted.
# ask-for-help
s
This message was deleted.
u
I’m using version 1.1.9 of yatai Helm (yatai 1.1.9). I installed postgreSQL on an external server and entered the corresponding host information in the values.yaml file and was able to see the metadata being saved normally. However, when I checked the yatai container log, I could see an unexpected EOF message.
Copy code
/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
Copy code
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.
Copy code
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.
I think the issue is caused by PostgreSQL internally terminating the connection managed by Yatai's Idle connection pool. When I checked the logs of PostgreSQL, I saw the following logs.
Copy code
LOG:  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.