warp-tech / warpgate

Smart SSH, HTTPS and MySQL bastion that requires no additional client-side software
Apache License 2.0
3.74k stars 115 forks source link

Fail to setup/start for PostgreSQL database #1039

Open gdm257 opened 3 weeks ago

gdm257 commented 3 weeks ago

Environment

Problem

Fail to setup/start warpgate with PostgreSQL database. I'm sure that postgres works well and other applications depending on postgres still work. Any idea for this problem?

docker-compose file:

services:
  warpgate:
    container_name: warpgate
    image: ghcr.io/warp-tech/warpgate:${VERSION:-latest}
    networks:
      - stack
      - services-network
    volumes:
      # you should generate config first
      # docker compose run --rm warpgate setup
      - ./data/warpgate:/data
networks:
  stack: {}
  services-network:
    external: true

Setup log

$ docker compose run --rm warpgate setup --database-url postgres://warpgate:xxxxxxxxxxxx@postgres:5432/warpgate?sslmode=disable
22:53:57  INFO Welcome to Warpgate 0.10.1
22:53:57  INFO Let's do some basic setup first.
22:53:57  INFO The new config will be written in /data/warpgate.yaml.
✔ Do you want to record user sessions? · yes
✔ Set a password for the Warpgate admin user · ********
22:54:24  INFO Generated configuration:
---
sso_providers: []
recordings:
  enable: true
  path: /data/recordings
external_host: ~
database_url: "postgres://warpgate:xxxxxxxxxxx@postgres:5432/warpgate?sslmode=disable"
ssh:
  enable: true
  listen: "0.0.0.0:2222"
  external_port: ~
  keys: /data/ssh-keys
  host_key_verification: prompt
  inactivity_timeout: 5m
http:
  enable: true
  listen: "0.0.0.0:8888"
  external_port: ~
  certificate: /data/tls.certificate.pem
  key: /data/tls.key.pem
  trust_x_forwarded_headers: false
  session_max_age: 30m
  cookie_max_age: 1day
mysql:
  enable: true
  listen: "0.0.0.0:33306"
  external_port: ~
  certificate: /data/tls.certificate.pem
  key: /data/tls.key.pem
log:
  retention: 7days
  send_to: ~
config_provider: database

22:54:24  INFO Saved into /data/warpgate.yaml
22:54:24  INFO Using config: "/data/warpgate.yaml"
22:54:24 ERROR Fatal error error=Execution Error: error returned from database: current transaction is aborted, commands ignored until end of transaction block

Caused by:
    0: error returned from database: current transaction is aborted, commands ignored until end of transaction block
    1: error returned from database: current transaction is aborted, commands ignored until end of transaction block
    2: current transaction is aborted, commands ignored until end of transaction block

Startup log

$ docker stack deploy -c warpgate/compose.yaml warpgate
$ docker logs warpgate_warpgate.1.yjwf4qex89ds28afpzha3ep77
23.08.2024 23:13:21  INFO warpgate::commands::run: Warpgate version=0.10.2
23.08.2024 23:13:21  INFO warpgate::config: Using config: "/data/warpgate.yaml"
23.08.2024 23:13:21 ERROR warpgate: Fatal error error=Execution Error: error returned from database: current transaction is aborted, commands ignored until end of transaction block

Caused by:
    0: error returned from database: current transaction is aborted, commands ignored until end of transaction block
    1: error returned from database: current transaction is aborted, commands ignored until end of transaction block
    2: current transaction is aborted, commands ignored until end of transaction block
gdm257 commented 3 weeks ago

It seems some compatibility problems #982 for postgres