Bug 1651688

Summary: red herring messages SQL Warning Code: 0, SQLState: 00000 several times per second in candlepin.log and error.log
Product: Red Hat Satellite Reporter: Jan Jansky <jjansky>
Component: CandlepinAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED NOTABUG QA Contact: jcallaha
Severity: low Docs Contact:
Priority: medium    
Version: 6.3.4CC: aperotti, jjansky, khowell, ojanus, pmoravec, rlavande, vmeghana
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1667149 (view as bug list) Environment:
Last Closed: 2019-10-22 15:03:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1667149    
Bug Blocks:    

Description Jan Jansky 2018-11-20 15:10:03 UTC
Description of problem:
Hello one of our customers contact us about messages like

WARN org.hibernate.engine.jdbc.spi.SqlExceptionHelper - SQL Warning Code: 0, SQLState: 00000
WARN  org.hibernate.engine.jdbc.spi.SqlExceptionHelper - bind <unnamed> to S_2


several times per second. It is not causing any troubles with Satellite itself, but it is filling quickly logs error.log and candlepin.log

Version-Release number of selected component (if applicable):
Satellite 6.3.5 (not an option in selection)
candlepin-2.1.24-1.el7.noarch
candlepin-selinux-2.1.24-1.el7.noarch


How reproducible:
Not sure, never saw this and it looks like red herring to me, also customer claimed that he is not observing any issue, only filling up logs


Actual results:
WARN org.hibernate.engine.jdbc.spi.SqlExceptionHelper - SQL Warning Code: 0, SQLState: 00000
WARN  org.hibernate.engine.jdbc.spi.SqlExceptionHelper - bind <unnamed> to S_2

Expected results:
none

or 

DEBUG org.hibernate.engine.jdbc.spi.SqlExceptionHelper - SQL Warning Code: 0, SQLState: 00000
DEBUG  org.hibernate.engine.jdbc.spi.SqlExceptionHelper - bind <unnamed> to S_2


Additional info: If you will need any details, please let us know... also adding owner of the case as CC.

Comment 1 Barnaby Court 2018-11-24 04:39:20 UTC
First I have seen this, what version of postgres is installed on the system?

Comment 7 ojanus 2019-10-22 15:03:50 UTC
SQL Warning Code: 0, SQLState: 00000 is not an error. As you see in the [Postgresql Documentation](https://www.postgresql.org/docs/10/errcodes-appendix.html), code 00000 indicates successful completion.

These logs can be turned ON/OFF in /var/lib/pgsql/data/postgresql.conf in the section "When to Log". Below is the relevant section. There are multiple levels and level "debug2" logs successful completion as a warning.

```
# - When to Log -

client_min_messages = debug2
                                        #   debug5
                                        #   debug4
                                        #   debug3
                                        #   debug2
                                        #   debug1
                                        #   log
                                        #   notice
                                        #   warning
                                        #   error

log_min_messages = debug2
                                        #   debug5
                                        #   debug4
                                        #   debug3
                                        #   debug2
                                        #   debug1
                                        #   info
                                        #   notice
                                        #   warning
                                        #   error
                                        #   log
                                        #   fatal
                                        #   panic

log_min_error_statement = debug2
                                        #   debug5
                                        #   debug4
                                        #   debug3
                                        #   debug2
                                        #   debug1
                                        #   info
                                        #   notice
                                        #   warning
                                        #   error
                                        #   log
                                        #   fatal
                                        #   panic (effectively off)

#log_min_duration_statement = -1        # -1 is disabled, 0 logs all statements
                                        # and their durations, > 0 logs only
                                        # statements running at least this number
                                        # of milliseconds

```