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

How define the connection to database postgres in the configuration file #1118

Open
vitaaaaa1 opened this issue Nov 7, 2024 · 4 comments
Open

Comments

@vitaaaaa1
Copy link

vitaaaaa1 commented Nov 7, 2024

Hi, How should I define the url format for connecting to the postgres database in the configuration file?

I use

 database_url: "postgres://user_name:password@postgres_host:5432/warpgate"

This format of configuration, program startup error

this is error logs

07:16:30  INFO Warpgate version=0.11.0
07:16:30  INFO Using config: "/data/warpgate.yaml"
07:16:30  WARN Looks like your `external_host` config option contains a port - it will be ignored.
07:16:30  WARN Set the external port via the `http.external_port`, `ssh.external_port` or `mysql.external_port` options.
07:16:30 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
@vitaaaaa1 vitaaaaa1 changed the title Connect to the postgres database in url format How define the connection to database postgres in the configuration file Nov 7, 2024
@vitaaaaa1
Copy link
Author

Seems incompatible with postgres?

@Eugeny
Copy link
Member

Eugeny commented Nov 7, 2024

Run it with --debug for more verbose logs

@vitaaaaa1
Copy link
Author

Run it with --debug for more verbose logs使用“for”命令可以获得更详细的日志信息。
This is my docker compose file

version: '3'
services:
  warpgate:
    image: ghcr.io/warp-tech/warpgate:v0.10.2
    ports:
      - 2222:2222
      - 8888:8888
      - 33306:33306
    volumes:
      - ../data:/data
    stdin_open: true
    tty: true
    command: ['--debug', 'run']

But there doesn't seem to be any output in the log

warpgate-1  | 09:06:40  INFO Warpgate version=0.10.2
warpgate-1  | 09:06:40  INFO Using config: "/data/warpgate.yaml"
warpgate-1  | 09:06:40  WARN Looks like your `external_host` config option contains a port - it will be ignored.
warpgate-1  | 09:06:40  WARN Set the external port via the `http.external_port`, `ssh.external_port` or `mysql.external_port` options.
warpgate-1  | 09:06:40 ERROR Fatal error error=Execution Error: error returned from database: current transaction is aborted, commands ignored until end of transaction block
warpgate-1  | 
warpgate-1  | Caused by:
warpgate-1  |     0: error returned from database: current transaction is aborted, commands ignored until end of transaction block
warpgate-1  |     1: error returned from database: current transaction is aborted, commands ignored until end of transaction block
warpgate-1  |     2: current transaction is aborted, commands ignored until end of transaction block

@vitaaaaa1
Copy link
Author

Run it with --debug for more verbose logs

I retested with mariadb and the connection is fine, but is there any good way to migrate data to mariadb

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