<#126 Error database connection since version 2.87...
# pact-broker
g
#126 Error database connection since version 2.87.0.1 Issue created by RyanCDS Pre issue-raising checklist I have already (please mark the applicable with an
x
): ☑︎ Confirmed this is the right place to raise the issue - only issues related to the Dockerization of the Pact Broker should be raised here. Issues related to the Pact Broker application itself should be raised in the Pact Broker project. ☑︎ Upgraded to the latest Pact Broker Docker image OR ☑︎ Checked the </CHANGELOG.md|CHANGELOG> to see if the issue I am about to raise has been fixed ☑︎ Read the Troubleshooting page Software versions • pact-broker gem version: eg 2.107.0 • pact-broker docker version: eg 2.107.0.1 • OS: Kubernetes environment with containerd • pact broker client details: NA Expected behaviour The pact broker should start correctly Actual behaviour I got an error during kubernetes deployment. For information, i did some test with different version and the changeset who broke the deployment appears with version 2.87.0.1 The logs below come from version 2.107.0.1 (it's similar issue with version 2.87.0.1).
Copy code
I [7:3120] pact-broker -- Connecting to database: -- {:adapter=>"postgres", :user=>"pact_broker", :password=>"*****", :host=>"<http://ad06pg-pactbroker.cnx.cdbdx.biz|ad06pg-pactbroker.cnx.cdbdx.biz>", :database=>"pact_broker", :encoding=>"utf8", :sslmode=>"require", :sql_log_level=>:debug, :enable_caller_logging=>false, :log_warn_duration=>5.0, :pool_timeout=>5, :driver_options=>{:options=>"-c statement_timeout=15s"}, :connect_max_retries=>5}
I [7:3120] pact-broker -- Error connecting to database (Sequel::DatabaseConnectionError). Waiting 3 seconds and trying again. 5 tries to go.
I [7:3120] pact-broker -- Error connecting to database (Sequel::DatabaseConnectionError). Waiting 3 seconds and trying again. 4 tries to go.
I [7:3120] pact-broker -- Error connecting to database (Sequel::DatabaseConnectionError). Waiting 3 seconds and trying again. 3 tries to go.
I [7:3120] pact-broker -- Error connecting to database (Sequel::DatabaseConnectionError). Waiting 3 seconds and trying again. 2 tries to go.
I [7:3120] pact-broker -- Error connecting to database (Sequel::DatabaseConnectionError). Waiting 3 seconds and trying again. 1 tries to go.
! Unable to load application: Sequel::DatabaseConnectionError: PG::ConnectionBad: connection to server at "10.10.241.33", port 5432 failed: ERROR:  Unsupported startup parameter: options
Steps to reproduce Deploy image docker v 2.107.0.1 with config below (for information, i use postgre in version 11) :
Copy code
apiVersion: apps/v1
kind: Deployment
metadata:
  name: pact-broker
  namespace: pact-broker
  labels:
    app: pact-broker
spec:
  replicas: 1
  selector:
    matchLabels:
      app: pact-broker
  template:
    metadata:
      labels:
        app: pact-broker
    spec:
      containers:
      - name: pact-broker
        image: 2.107.0.1
        resources:
          limits:
              cpu: "1"
              memory: 2048
        livenessProbe:
          httpGet:
            path: /hal-browser/browser.html
        readinessProbe:
          httpGet:
            path: /hal-browser/browser.html
        volumeMounts:
          - name: configmap
            mountPath: /run/dotnet/config
          - name: secrets
            mountPath: /run/dotnet/secrets
        envs: >-
            "PLATFORM": "$(platform)",
            "PERIMETER":"$(namespace)",
            "PACT_BROKER_PORT": "9292",
            "PACT_BROKER_DATABASE_URL":"<postgres://user:password@host/name>",
            "PACT_BROKER_DATABASE_CONNECT_MAX_RETRIES": "5",
            "PACT_BROKER_DATABASE_SSLMODE": "require",
            "PACT_BROKER_PUBLIC_HEARTBEAT": "true",
            "PACT_BROKER_LOG_LEVEL": "DEBUG",
            "PACT_BROKER_SQL_LOG_LEVEL": "DEBUG"
  service:
    ports: '[9292]'
  secretFilename: 'secret.yml'
Relevent log files Here the log file from Kubernetes during deployment ``` Puma starting in single mode... * Puma version: 5.6.5 (ruby 2.7.7-p221) ("Birdie's Version") * Min threads: 0 * Max threads: 5 * Environment: production * PID: 7 2023-04-13 093747.111467 I [7:3120] pact-broker -- Connecting to database: -- {:adapter=>"postgres", :user=>"user", :password=>"*****", :host=>"host", :database=>"name", :encoding=>"utf8", :sslmode=>"require", sql log level=&gt;debug, :enable_caller_logging=>false, :log_warn_duration=>5.0, :pool_timeout=>5, driver options=&gt;{options=>"-c statement_timeout=15s"}, :connect_max_retries=>5} 2023-04-13 093747.218007 I [7:3120] pact-broker -- Error connecting to database (Sequel::DatabaseConnectionError). Waiting 3 seconds and trying again. 5 tries to go. 2023-04-13 093750.266645 I [7:3120] pact-broker -- Error connecting to database (Sequel::DatabaseConnectionError). Waiting 3 seconds and trying again. 4 tries to go. 2023-04-13 093753.316706 I [7:3120] pact-broker -- Error connecting to database (Sequel::DatabaseConnectionError). Waiting 3 seconds and trying again. 3 tries to go. 2023-04-13 093756.364629 I [7:3120] pact-broker -- Error connecting to database (Sequel::DatabaseConnectionError). Waiting 3 seconds and trying again. 2 tries to go. 2023-04-13 093759.412661 I [7:3120] pact-broker -- Error connecting to database (Sequel::DatabaseConnectionError). Waiting 3 seconds and trying again. 1 tries to go. ! Unable to load application: Sequel:DatabaseConnectionError PG:ConnectionBad connection to server at "20.20.20.42", port 5432 failed: ERROR: Unsupported startup parameter: options bundler: failed to load command: puma (/pact_broker/vendor/bundle/ruby/2.7.0/bin/puma) /pact_broker/vendor/bundle/ruby/2.7.0/gems/pg-1.4.6/lib/pg/connection.rb633in `async_connect_or_reset': PG:ConnectionBad connection to server at "20.20.20.42", port 5432 failed: ERROR: Unsupported startup parameter: options (Sequel::DatabaseConnectionError) from /pact_broker/vendor/bundle/ruby/2.7.0/gems/pg-1.4.6/lib/pg/connection.rb761in `connect_to_hosts' from /pact_broker/vendor/bundle/ruby/2.7.0/gems/pg-1.4.6/lib/pg/connection.rb696in `new' from /pact_broker/vendor/bundle/ruby/2.7.0/gems/sequel-5.66.0/lib/sequel/adapters/postgres.rb231in `connect' from /pact_broker/vendor/bundle/ruby/2.7.0/gems/sequel-5.66.0/lib/sequel/database/connecting.rb248in `new_connection' from /pact_broker/vendor/bundle/ruby/2.7.0/gems/sequel-5.66.0/lib/sequel/connection_pool.rb154in `make_new' from /pact_broker/vendor/bundle/ruby/2.7.0/gems/sequel-5.66.0/lib/sequel/connection_pool/threaded.rb209in `assign_connection' from /pact_broker/vendor/bundle/ruby/2.7.0/gems/sequel-5.66.0/lib/sequel/connection_pool/threaded.rb139in `acquire' from /pact_broker/vendor/bundle/ruby/2.7.0/gems/sequel-5.66.0/lib/sequel/connection_pool/threaded.rb91in `hold' from /pact_broker/vendor/bundle/ruby/2.7.0/gems/sequel-5.66.0/lib/sequel/database/connecting.rb293in `synchronize' from /pact_broker/vendor/bundle/ruby/2.7.0/gems/sequel-5.66.0/lib/sequel/database/connecting.rb302in `test_connection' from /pact_broker/vendor/bundle/ruby/2.7.0/gems/sequel-5.66.0/lib/sequel/database/misc.rb188in `initialize' from /pact_broker/vendor/bundle/ruby/2.7.0/gems/sequel-5.66.0/lib/sequel/database/connecting.rb57in `new' from /pact_broker/vendor/bundle/ruby/2.7.0/gems/sequel-5.66.0/lib/sequel/database/connecting.rb57in `connect' from /pact_broker/vendor/bundle/ruby/2.7.0/gems/sequel-5.66.0/lib/sequel/core.rb124in `connect' from /pact_broker/vendor/bundle/ruby/2.7.0/gems/pact_broker-2.106.0/lib/pact_broker/initializers/database_connection.rb17in `block in create_database_connection' from /pact_broker/vendor/bundle/ruby/2.7.0/gems/pact_broker-2.106.0/lib/pact_broker/initializers/database_connection.rb31in `with_retries' from /pact_broker/vendor/bundle/ruby/2.7.0/gems/pa… pact-foundation/pact-broker-docker