'Error — PG::InvalidParameterValue: ERROR: invalid value for parameter "client_min_messages": "panic"
I'm having issues getting a ruby on rails project running with Docker. I have a hunch it has something to do with running macOS Catalina (10.15.1). The issue comes when I try to docker-compose run web rake db:create.
When I run docker-compose run web rake db:create I get this output:
Starting vft_db_1 ... done
PG::InvalidParameterValue: ERROR: invalid value for parameter "client_min_messages": "panic"
HINT: Available values: debug5, debug4, debug3, debug2, debug1, log, notice, warning, error.
: SET client_min_messages TO 'panic'
/usr/local/bundle/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql/database_statements.rb:155:in `async_exec'
/usr/local/bundle/gems/activerecord-
...
Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "host"=>"db", "username"=>"postgres", "password"=>nil, "pool"=>5, "database"=>"vft_test", "client_min_messages"=>"warning"}
Here is my database.yml
default: &default
adapter: postgresql
encoding: unicode
host: db
username: postgres
password:
pool: 5
development:
<<: *default
database: vft_development
min_messages: warning
test:
<<: *default
database: vft_test
min_messages: warning
(I also tried client_min_messages: warning but encountered the same issue)
And when I run $ docker version I get:
Client: Docker Engine - Community
Version: 19.03.5
API version: 1.40
Go version: go1.12.12
Git commit: 633a0ea
Built: Wed Nov 13 07:22:34 2019
OS/Arch: darwin/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 19.03.5
API version: 1.40 (minimum version 1.12)
Go version: go1.12.12
Git commit: 633a0ea
Built: Wed Nov 13 07:29:19 2019
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.2.10
GitCommit: b34a5c8af56e510852c35414db4c1f4fa6172339
runc:
Version: 1.0.0-rc8+dev
GitCommit: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
docker-init:
Version: 0.18.0
GitCommit: fec3683
Thanks!
Solution 1:[1]
This seems to be related to PostgreSQL 12.
Here a post explaining it, it suggests several ways to fix it.
I personally used a lower version of PostgreSQL to get rid of it.
Lazy but did the job for me :)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Pierre de LESPINAY |
