Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use "-1" for database_connection_validation_timeout #526

Closed
3 tasks done
cybe opened this issue Nov 22, 2021 · 3 comments
Closed
3 tasks done

Unable to use "-1" for database_connection_validation_timeout #526

cybe opened this issue Nov 22, 2021 · 3 comments

Comments

@cybe
Copy link

cybe commented Nov 22, 2021

Pre issue-raising checklist

  • Upgraded to the latest Pact Broker OR
  • Checked the CHANGELOG to see if the issue I am about to raise has been fixed
  • Created an executable example that demonstrates the issue

Software versions

  • pact-broker gem version: 2.91.0
  • pact-broker docker version: 2.91.0.0
  • OS: Linux

Expected behaviour

Ability to use the value -1 for database_connection_validation_timeout that was the default prior version 2.86.0 by setting the env var PACT_BROKER_DATABASE_CONNECTION_VALIDATION_TIMEOUT to -1.

As stated in the documentation.

Actual behaviour

2021-11-22 07:58:39.146360 I [9:70100092426760] pact-broker -- Connecting to database: -- "{:adapter=>\"sqlite\", :encoding=>\"utf8\", :sql_log_level=>:debug, :log_warn_duration=>5.0, :pool_timeout=>5, :connect_max_retries=>0, :connection_validation_timeout=>\"-1\", :password=>\"*****\"}"
2021-11-22 07:58:39.182338 D [9:70100092426760] PactBroker -- (0.000152s) PRAGMA foreign_keys = 1
2021-11-22 07:58:39.182421 D [9:70100092426760] PactBroker -- (0.000017s) PRAGMA case_sensitive_like = 1
2021-11-22 07:58:39.182472 I [9:70100092426760] pact-broker -- Connected to database
2021-11-22 07:58:39.183969 D [9:70100092426760] PactBroker -- (0.000109s) SELECT sqlite_version()
! Unable to load application: ArgumentError: comparison of Float with String failed

Steps to reproduce

docker run --rm \
    -e PACT_BROKER_DATABASE_ADAPTER=sqlite \
    -e PACT_BROKER_DATABASE_CONNECTION_VALIDATION_TIMEOUT=-1 \
    pactfoundation/pact-broker:2.91.0.0

Relevant log files

Gist

@bethesque
Copy link
Member

I'll get this fixed. In the meantime, can you mount a volume with the config file? Then you can set it in the pact_broker.yml config file as an integer (I've just checked that this works) See the top of https://docs.pact.io/pact_broker/configuration/settings for the details.

# pact_broker.yml
database_connection_validation_timeout: -1

@cybe
Copy link
Author

cybe commented Nov 23, 2021

Thanks! The config file mount does work as expected.

@bethesque
Copy link
Member

The fix for this is released in the latest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants