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

ERROR: invalid configuration parameter name "request.header.content-length" #1985

Closed
aodhan-domhnaill opened this issue Oct 19, 2021 · 2 comments

Comments

@aodhan-domhnaill
Copy link

Environment

Logstash HTTP Output is pushing data into Postgrest,

input {
    couchdb_changes {
        always_reconnect => true
        db => "${COUCHDB_DB}"
        host => "couchdb"
        username => "${COUCHDB_USER}"
        password => "${COUCHDB_PASSWORD}"
        keep_id => true
        keep_revision => true
        #sequence_path => "/var/couchdb/sequence"
    }
}

output {
    http {
        format => "json"
        http_method => "post"
        url => "http://proxy/${POSTGRES_DB}"
    }
    stdout { codec => json }
}

My Docker Compose file (part of it),

  logstash:
    image: logstash:7.14.1
    depends_on:
      - couchdb
      - elasticsearch
    volumes:
      - ./logstash/pipeline:/usr/share/logstash/pipeline
    environment:
      - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
      - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
      - COUCHDB_USER=${COUCHDB_USER}
      - COUCHDB_PASSWORD=${COUCHDB_PASSWORD}
      - COUCHDB_DB=${COUCHDB_DB}
      - POSTGRES_DB=${POSTGRES_DB}
    restart: on-failure:5

  postgres:
    image: postgres
    command: ["postgres", "-c", "log_statement=all"]
    environment:
      - POSTGRES_USER=${POSTGRES_USER}
      - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
      - POSTGRES_DB=${POSTGRES_DB}


  proxy:
    image: nginx
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
    command: [nginx-debug, '-g', 'daemon off;']

  postgrest:
    image: postgrest/postgrest
    environment:
      - PGRST_DB_URI=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
      - PGRST_DB_SCHEMA=public
      # CHANGE FOR PROD!!!!
      - PGRST_DB_ANON_ROLE=${POSTGRES_USER}

Description of issue

set_config in Postgres is failing,

postgres_1         | 2021-10-19 18:14:24.359 UTC [73] LOG:  execute 0: BEGIN ISOLATION LEVEL READ COMMITTED READ WRITE
postgres_1         | 2021-10-19 18:14:24.359 UTC [73] LOG:  execute 1: select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true), set_config($9, $10, true), set_config($11, $12, true), set_config($13, $14, true), set_config($15, $16, true), set_config($17, $18, true), set_config($19, $20, true), set_config($21, $22, true)
postgres_1         | 2021-10-19 18:14:24.359 UTC [73] DETAIL:  parameters: $1 = 'search_path', $2 = 'public, public', $3 = 'role', $4 = 'hive', $5 = 'request.jwt.claim.role', $6 = 'hive', $7 = 'request.method', $8 = 'POST', $9 = 'request.path', $10 = '/couchdb', $11 = 'request.header.host', $12 = 'postgrest:3000', $13 = 'request.header.connection', $14 = 'close', $15 = 'request.header.content-length', $16 = '154', $17 = 'request.header.content-type', $18 = 'application/json', $19 = 'request.header.user-agent', $20 = 'Manticore 0.7.1', $21 = 'request.header.accept-encoding', $22 = 'gzip,deflate'
postgres_1         | 2021-10-19 18:14:24.359 UTC [73] ERROR:  invalid configuration parameter name "request.header.content-length"
postgres_1         | 2021-10-19 18:14:24.359 UTC [73] DETAIL:  Custom parameter names must be two or more simple identifiers separated by dots.
postgres_1         | 2021-10-19 18:14:24.359 UTC [73] STATEMENT:  select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true), set_config($9, $10, true), set_config($11, $12, true), set_config($13, $14, true), set_config($15, $16, true), set_config($17, $18, true), set_config($19, $20, true), set_config($21, $22, true)
postgres_1         | 2021-10-19 18:14:24.359 UTC [73] LOG:  execute 2: ABORT
@wolfgangwalther
Copy link
Member

Duplicate of #1857.

@steve-chavez
Copy link
Member

This is an error with postgres 14. See #1857.

Try pinning the postgres version in:

  postgres:
    image: postgres:13

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

No branches or pull requests

3 participants