crtsh / certwatch_db

Database schema
https://crt.sh/
GNU General Public License v3.0
194 stars 36 forks source link

prepared statement "S_0" already exists #78

Closed yschimke closed 3 years ago

yschimke commented 3 years ago

Using r2dbc I get these errors occasionally.

[ WARN] (reactor-tcp-nio-1) Error: SEVERITY_LOCALIZED=ERROR, SEVERITY_NON_LOCALIZED=ERROR, CODE=42P05, MESSAGE=prepared statement "S_0" already exists, FILE=prepare.c, LINE=466, ROUTINE=StorePreparedStatement
Exception in thread "main" io.r2dbc.postgresql.ExceptionFactory$PostgresqlBadGrammarException: [42P05] prepared statement "S_0" already exists
    at io.r2dbc.postgresql.ExceptionFactory.createException(ExceptionFactory.java:85)
    at io.r2dbc.postgresql.ExceptionFactory.handleErrorResponse(ExceptionFactory.java:110)
    at reactor.core.publisher.FluxHandle$HandleSubscriber.onNext(FluxHandle.java:96)
    at reactor.core.publisher.FluxPeekFuseable$PeekConditionalSubscriber.onNext(FluxPeekFuseable.java:845)
    at reactor.core.publisher.FluxCreate$BufferAsyncSink.drain(FluxCreate.java:793)
    at reactor.core.publisher.FluxCreate$BufferAsyncSink.next(FluxCreate.java:718)

I'm trying to work around with these solutions https://github.com/pgjdbc/r2dbc-postgresql/issues/223 https://stackoverflow.com/questions/7611926/postgres-error-prepared-statement-s-1-already-exists

Raising here for visibility and incase it's a config issue, but please close if you think it's a client issue.

robstradling commented 3 years ago

@yschimke crt.sh:5432 uses PgBouncer with Statement Pooling, so I'm afraid prepared statements aren't supported.

yschimke commented 3 years ago

Disabling in the client config worked