Install error : Protocol violation

Hi guys,

I am following this guide (Beginners Guide to Install Discourse on macOS for Development). I’m having an issue with installing Discourse (the same error as, https://meta.discourse.org/t/install-error-protocol-violation-with-postgresql/35160) and have ensured that the ‘config/database.yml’ attribute ‘prepared_statements = false’.

My versions:

➜ discourse git:(master) ruby -v
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin15]
➜  discourse git:(master) rails -v
Rails 4.2.4
➜  discourse git:(master) psql --version
psql (PostgreSQL) 9.4.5

   List of installed extensions
  Name   | Version |   Schema   |                            Description
---------+---------+------------+-------------------------------------------------------------------
 hstore  | 1.3     | public     | data type for storing sets of (key, value) pairs
 pg_trgm | 1.1     | public     | text similarity measurement and index searching based on trigrams
 plpgsql | 1.0     | pg_catalog | PL/pgSQL procedural language
(3 rows)

The error:

== Seed from /Users/ivanrlio/discourse/db/fixtures/002_groups.rb
rake aborted!
ActiveRecord::StatementInvalid: PG::ProtocolViolation: ERROR:  bind message supplies 1 parameters, but prepared statement "a1" requires 0
: SELECT  "groups".* FROM "groups" WHERE "groups"."id" = 0 LIMIT 1
/Users/ivanrlio/discourse/app/models/group.rb:236:in `lookup_group'
/Users/ivanrlio/discourse/app/models/group.rb:222:in `block in ensure_automatic_groups!'
/Users/ivanrlio/discourse/app/models/group.rb:221:in `each_key'
/Users/ivanrlio/discourse/app/models/group.rb:221:in `ensure_automatic_groups!'
(eval):1:in `block (2 levels) in run_file'
PG::ProtocolViolation: ERROR:  bind message supplies 1 parameters, but prepared statement "a1" requires 0
/Users/ivanrlio/discourse/app/models/group.rb:236:in `lookup_group'
/Users/ivanrlio/discourse/app/models/group.rb:222:in `block in ensure_automatic_groups!'
/Users/ivanrlio/discourse/app/models/group.rb:221:in `each_key'
/Users/ivanrlio/discourse/app/models/group.rb:221:in `ensure_automatic_groups!'
(eval):1:in `block (2 levels) in run_file'

Any help would be much appreciated.

Thanks

Did you add prepared_statements: false to both the development and test sections of the database.yml file? Also, you used an = sign in your post which wouldn’t work.

3 Likes

Hi Neil,

It was missing from the ‘test’ section of the file.

Thanks!

1 Like