[ 
https://issues.apache.org/jira/browse/GUACAMOLE-919?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17073565#comment-17073565
 ] 

Mechanix commented on GUACAMOLE-919:
------------------------------------

[~DouglasHeriot] Thanks for opening a PR, much appreciated.
Which socketTimeout  do you mean? I couldn't find that one in 
https://www.pgbouncer.org/config.html#dangerous-timeouts

I've redeployed pgBouncer and the pod starts with:

{code:bash}
Wrote authentication credentials to /etc/pgbouncer/userlist.txt
Create pgbouncer config in /etc/pgbouncer
################## Auto generated ##################

[databases]
guacamole = host=10.2.133.8 port=5432 user=guacamole
[pgbouncer]
listen_addr = 0.0.0.0
listen_port = 5432
unix_socket_dir =
user = postgres
auth_file = /etc/pgbouncer/userlist.txt
auth_type = md5
pool_mode = session
ignore_startup_parameters = extra_float_digits
# Log settings
admin_users = postgres
# Connection sanity checks, timeouts
server_reset_query = DISCARD ALL
# TLS settings
# Dangerous timeouts
query_wait_timeout = 7
tcp_keepalive = 1
tcp_keepidle = 7200

################## end file ##################
{code}


But I'm still getting this errors and the blank page after 1h of idle time:


08:37:55.274 [http-nio-8080-exec-2] DEBUG o.a.i.t.jdbc.JdbcTransaction - 
Opening JDBC Connection

{color:#DE350B}08:42:30.247 [pool-1-thread-1] WARN 
o.a.i.d.pooled.PooledDataSource - Execution of ping query 'SELECT 1' failed: 
ERROR: server conn crashed?

08:42:30.248 [pool-1-thread-1] DEBUG o.a.i.d.pooled.PooledDataSource - 
Connection 143715841 is BAD: ERROR: server conn crashed?

08:42:30.248 [pool-1-thread-1] DEBUG o.a.i.d.pooled.PooledDataSource - A bad 
connection (143715841) was returned from the pool, getting another connection.

08:42:30.248 [pool-1-thread-1] DEBUG o.a.i.d.pooled.PooledDataSource - Checked 
out connection 65259250 from pool.

08:42:30.248 [pool-1-thread-1] DEBUG o.a.i.d.pooled.PooledDataSource - Testing 
connection 65259250 ...

08:58:01.546 [pool-1-thread-1] WARN o.a.i.d.pooled.PooledDataSource - Execution 
of ping query 'SELECT 1' failed: ERROR: server conn crashed?

08:58:01.546 [pool-1-thread-1] DEBUG o.a.i.d.pooled.PooledDataSource - 
Connection 65259250 is BAD: ERROR: server conn crashed?

08:58:01.546 [pool-1-thread-1] DEBUG o.a.i.d.pooled.PooledDataSource - A bad 
connection (65259250) was returned from the pool, getting another connection.

08:58:01.546 [pool-1-thread-1] DEBUG o.a.i.d.pooled.PooledDataSource - Checked 
out connection 1404868066 from pool.

08:58:01.546 [pool-1-thread-1] DEBUG o.a.i.d.pooled.PooledDataSource - Testing 
connection 1404868066 ...

09:13:33.898 [pool-1-thread-1] WARN o.a.i.d.pooled.PooledDataSource - Execution 
of ping query 'SELECT 1' failed: ERROR: server conn crashed?

09:13:33.898 [pool-1-thread-1] DEBUG o.a.i.d.pooled.PooledDataSource - 
Connection 1404868066 is BAD: ERROR: server conn crashed?{color}

09:13:33.898 [pool-1-thread-1] DEBUG o.a.i.d.pooled.PooledDataSource - A bad 
connection (1404868066) was returned from the pool, getting another connection.

09:13:34.011 [pool-1-thread-1] DEBUG o.a.i.d.pooled.PooledDataSource - Created 
connection 1606057130.

09:13:34.011 [pool-1-thread-1] DEBUG o.a.g.a.j.u.UserRecordMapper.update - ==> 
Preparing: UPDATE guacamole_user_history SET remote_host = ?, user_id = (SELECT 
user_id FROM guacamole_user JOIN guacamole_entity ON guacamole_user.entity_id = 
guacamole_entity.entity_id WHERE guacamole_entity.name = ? AND 
guacamole_entity.type = 'USER'::guacamole_entity_type), username = ?, 
start_date = ?, end_date = ? WHERE history_id = ?::integer

09:13:34.013 [pool-1-thread-1] DEBUG o.a.g.a.j.u.UserRecordMapper.update - ==> 
Parameters: 10.2.136.4(String), chuegel(String), chuegel(String), 2020-04-02 
07:24:52.214(Timestamp), 2020-04-02 08:26:59.175(Timestamp), 97(Integer)

09:13:34.032 [pool-1-thread-1] DEBUG o.a.g.a.j.u.UserRecordMapper.update - <== 
Updates: 1

09:13:34.032 [pool-1-thread-1] DEBUG o.a.i.t.jdbc.JdbcTransaction - Committing 
JDBC Connection [org.postgresql.jdbc.PgConnection@5fba7caa]

09:13:34.047 [pool-1-thread-1] DEBUG o.a.i.t.jdbc.JdbcTransaction - Resetting 
autocommit to true on JDBC Connection 
[org.postgresql.jdbc.PgConnection@5fba7caa]

09:13:34.047 [pool-1-thread-1] DEBUG o.a.i.t.jdbc.JdbcTransaction - Closing 
JDBC Connection [org.postgresql.jdbc.PgConnection@5fba7caa]

09:13:34.096 [http-nio-8080-exec-2] DEBUG o.a.i.d.pooled.PooledDataSource - 
Created connection 1188204539.

09:13:34.097 [http-nio-8080-exec-2] DEBUG o.a.g.a.j.user.UserMapper.selectOne - 
==> Preparing: SELECT guacamole_user.user_id, guacamole_entity.entity_id, 
guacamole_entity.name, password_hash, password_salt, password_date, disabled, 
expired, access_window_start, access_window_end, valid_from, valid_until, 
timezone, full_name, email_address, organization, organizational_role, 
MAX(start_date) AS last_active FROM guacamole_user JOIN guacamole_entity ON 
guacamole_user.entity_id = guacamole_entity.entity_id LEFT JOIN 
guacamole_user_history ON guacamole_user_history.user_id = 
guacamole_user.user_id WHERE guacamole_entity.name = ? AND 
guacamole_entity.type = 'USER'::guacamole_entity_type GROUP BY 
guacamole_user.user_id, guacamole_entity.entity_id; SELECT 
guacamole_user_attribute.user_id, guacamole_user_attribute.attribute_name, 
guacamole_user_attribute.attribute_value FROM guacamole_user_attribute JOIN 
guacamole_user ON guacamole_user.user_id = guacamole_user_attribute.user_id 
JOIN guacamole_entity ON guacamole_user.entity_id = guacamole_entity.entity_id 
WHERE guacamole_entity.name = ? AND guacamole_entity.type = 
'USER'::guacamole_entity_type

09:13:34.097 [http-nio-8080-exec-2] DEBUG o.a.g.a.j.user.UserMapper.selectOne - 
==> Parameters: null, null

09:13:34.110 [http-nio-8080-exec-2] DEBUG o.a.g.a.j.user.UserMapper.selectOne - 
<== Total: 0

09:13:34.111 [http-nio-8080-exec-2] DEBUG o.a.i.t.jdbc.JdbcTransaction - 
Resetting autocommit to true on JDBC Connection 
[org.postgresql.jdbc.PgConnection@46d28ffb]

09:13:34.123 [http-nio-8080-exec-2] DEBUG o.a.i.t.jdbc.JdbcTransaction - 
Closing JDBC Connection [org.postgresql.jdbc.PgConnection@46d28ffb]

09:13:34.134 [http-nio-8080-exec-18] DEBUG o.a.i.d.pooled.PooledDataSource - 
Created connection 2096793970.

09:13:34.135 [http-nio-8080-exec-18] DEBUG o.a.g.a.j.user.UserMapper.selectOne 
- ==> Preparing: SELECT guacamole_user.user_id, guacamole_entity.entity_id, 
guacamole_entity.name, password_hash, password_salt, password_date, disabled, 
expired, access_window_start, access_window_end, valid_from, valid_until, 
timezone, full_name, email_address, organization, organizational_role, 
MAX(start_date) AS last_active FROM guacamole_user JOIN guacamole_entity ON 
guacamole_user.entity_id = guacamole_entity.entity_id LEFT JOIN 
guacamole_user_history ON guacamole_user_history.user_id = 
guacamole_user.user_id WHERE guacamole_entity.name = ? AND 
guacamole_entity.type = 'USER'::guacamole_entity_type GROUP BY 
guacamole_user.user_id, guacamole_entity.entity_id; SELECT 
guacamole_user_attribute.user_id, guacamole_user_attribute.attribute_name, 
guacamole_user_attribute.attribute_value FROM guacamole_user_attribute JOIN 
guacamole_user ON guacamole_user.user_id = guacamole_user_attribute.user_id 
JOIN guacamole_entity ON guacamole_user.entity_id = guacamole_entity.entity_id 
WHERE guacamole_entity.name = ? AND guacamole_entity.type = 
'USER'::guacamole_entity_type

09:13:34.135 [http-nio-8080-exec-18] DEBUG o.a.g.a.j.user.UserMapper.selectOne 
- ==> Parameters: null, null

09:13:34.141 [http-nio-8080-exec-18] DEBUG o.a.g.a.j.user.UserMapper.selectOne 
- <== Total: 0

09:13:34.141 [http-nio-8080-exec-18] DEBUG o.a.i.t.jdbc.JdbcTransaction - 
Resetting autocommit to true on JDBC Connection 
[org.postgresql.jdbc.PgConnection@7cfa8972]

09:13:34.144 [http-nio-8080-exec-18] DEBUG o.a.i.t.jdbc.JdbcTransaction - 
Closing JDBC Connection [org.postgresql.jdbc.PgConnection@7cfa8972]

09:13:34.155 [http-nio-8080-exec-15] DEBUG o.a.i.d.pooled.PooledDataSource - 
Created connection 1359687838.

09:13:34.155 [http-nio-8080-exec-15] DEBUG o.a.g.a.j.user.UserMapper.selectOne 
- ==> Preparing: SELECT guacamole_user.user_id, guacamole_entity.entity_id, 
guacamole_entity.name, password_hash, password_salt, password_date, disabled, 
expired, access_window_start, access_window_end, valid_from, valid_until, 
timezone, full_name, email_address, organization, organizational_role, 
MAX(start_date) AS last_active FROM guacamole_user JOIN guacamole_entity ON 
guacamole_user.entity_id = guacamole_entity.entity_id LEFT JOIN 
guacamole_user_history ON guacamole_user_history.user_id = 
guacamole_user.user_id WHERE guacamole_entity.name = ? AND 
guacamole_entity.type = 'USER'::guacamole_entity_type GROUP BY 
guacamole_user.user_id, guacamole_entity.entity_id; SELECT 
guacamole_user_attribute.user_id, guacamole_user_attribute.attribute_name, 
guacamole_user_attribute.attribute_value FROM guacamole_user_attribute JOIN 
guacamole_user ON guacamole_user.user_id = guacamole_user_attribute.user_id 
JOIN guacamole_entity ON guacamole_user.entity_id = guacamole_entity.entity_id 
WHERE guacamole_entity.name = ? AND guacamole_entity.type = 
'USER'::guacamole_entity_type

09:13:34.156 [http-nio-8080-exec-15] DEBUG o.a.g.a.j.user.UserMapper.selectOne 
- ==> Parameters: null, null

09:13:34.167 [http-nio-8080-exec-15] DEBUG o.a.g.a.j.user.UserMapper.selectOne 
- <== Total: 0

09:13:34.167 [http-nio-8080-exec-15] DEBUG o.a.i.t.jdbc.JdbcTransaction - 
Resetting autocommit to true on JDBC Connection 
[org.postgresql.jdbc.PgConnection@510b309e]

09:13:34.173 [http-nio-8080-exec-15] DEBUG o.a.i.t.jdbc.JdbcTransaction - 
Closing JDBC Connection [org.postgresql.jdbc.PgConnection@510b309e]

09:13:34.205 [http-nio-8080-exec-5] DEBUG o.a.i.d.pooled.PooledDataSource - 
Created connection 644055196.

09:13:34.206 [http-nio-8080-exec-5] DEBUG o.a.i.d.pooled.PooledDataSource - 
Testing connection 644055196 ...

09:13:34.217 [http-nio-8080-exec-5] DEBUG o.a.i.d.pooled.PooledDataSource - 
{color:#00875A}Connection 644055196 is GOOD!{color}


> An I/O error occurred while sending to the backend
> --------------------------------------------------
>
>                 Key: GUACAMOLE-919
>                 URL: https://issues.apache.org/jira/browse/GUACAMOLE-919
>             Project: Guacamole
>          Issue Type: Bug
>          Components: guacamole-auth-jdbc-postgresql
>    Affects Versions: 1.0.0
>            Reporter: Mechanix
>            Assignee: Nick Couchman
>            Priority: Minor
>         Attachments: image-2020-01-27-15-19-26-634.png
>
>
> Hi,
> we use guacamole with postgresql and openid extension. Guacamole and guacd is 
> deployed inside a k8s cluster.
> For some reason, the authentication doesn't succeed sporadically; there is 
> only a blank page and this error message in the guacamole log:
> *[pool-1-thread-1] WARN o.a.i.d.pooled.PooledDataSource - Execution of ping 
> query 'SELECT 1' failed: An I/O error occurred while sending to the backend.*
> I suspect there is a weird timeout happening between guacamole and postgresql 
> but couldn't figure out why.
> Any hints are much appreciated. Thanks
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to