[GH-ISSUE #30] it'll ignore the DB connection string from the config/oxygen.yml #1

Closed
opened 2026-03-03 18:51:28 +03:00 by kerem · 4 comments
Owner

Originally created by @naddika on GitHub (Aug 22, 2023).
Original GitHub issue: https://github.com/oxygenpay/oxygen/issues/30

Yesterday I was trying to run the project locally. I was doing it without a docker. Built it — UI and backend, created config/oxygen.yml.

oxygen:
  postgres:
    data_source: "host=localhost sslmode=disable dbname=oxygenpay_oxygen user=u1 password=1234 pool_max_conns=32"

Then - make run

But it wouldn't start because of an error in the DB connection. No parameters from the DB connection from the config would get filled in in runtime. It'd would only use the default parameters of my machine: user_name = <my_os_user_login>, for instance. Not the one that I specified in the config.yml

And the "dbname" / "database" would always be remain empty in the logs -- database=

What's the matter? Have you guys tried to run it locally without a docker?

Originally created by @naddika on GitHub (Aug 22, 2023). Original GitHub issue: https://github.com/oxygenpay/oxygen/issues/30 Yesterday I was trying to run the project locally. I was doing it without a docker. Built it — UI and backend, created config/oxygen.yml. ``` oxygen: postgres: data_source: "host=localhost sslmode=disable dbname=oxygenpay_oxygen user=u1 password=1234 pool_max_conns=32" ``` Then - `make run` But it wouldn't start because of an error in the DB connection. No parameters from the DB connection from the config would get filled in in runtime. It'd would only use the default parameters of my machine: user_name = <my_os_user_login>, for instance. Not the one that I specified in the config.yml And the "dbname" / "database" would **always** be remain empty in the logs -- `database=` What's the matter? Have you guys tried to run it locally without a docker?
kerem closed this issue 2026-03-03 18:51:29 +03:00
Author
Owner

@swift1337 commented on GitHub (Aug 24, 2023):

Hey! Yep, it works:

config/oxygen.yml


oxygen:
  postgres:
    data_source: "host=localhost sslmode=disable dbname=oxygen user=abc pool_max_conns=32"
    migrate_on_start: false

# ...

make run:

./bin/oxygen serve-web --config=$(pwd)/config/oxygen.yml
Aug 24 18:52:34.000 INF internal/db/connection/pg/postgres.go:45 > connected to postgres channel=postgres db_host=localhost db_max_connections=0 db_min_connections=32 db_name=oxygen db_user=abc env=local host=abc.local service=oxygen version=8b69c641c57c748c7f966110300935cd8dff84f5

Make sure that oxygen is a root property in your yml config. Alternatively, you can use ENV variables.

<!-- gh-comment-id:1691965671 --> @swift1337 commented on GitHub (Aug 24, 2023): Hey! Yep, it works: `config/oxygen.yml` ```yml oxygen: postgres: data_source: "host=localhost sslmode=disable dbname=oxygen user=abc pool_max_conns=32" migrate_on_start: false # ... ``` `make run`: ```shell ./bin/oxygen serve-web --config=$(pwd)/config/oxygen.yml Aug 24 18:52:34.000 INF internal/db/connection/pg/postgres.go:45 > connected to postgres channel=postgres db_host=localhost db_max_connections=0 db_min_connections=32 db_name=oxygen db_user=abc env=local host=abc.local service=oxygen version=8b69c641c57c748c7f966110300935cd8dff84f5 ``` Make sure that `oxygen` is a root property in your yml config. Alternatively, you can use [ENV variables](https://docs.o2pay.co/configuration#list-of-available-env-variables).
Author
Owner

@naddika commented on GitHub (Sep 11, 2023):

@swift1337

  • there's no instruction of how to set it and run it to begin with
  • migrate_on_start: false isn't the example config file
  • % make run ===>
ui-dashboard/embed.go:8:12: pattern dist/*: no matching files found
ui-payment/embed.go:8:12: pattern dist/*: no matching files found
./bin/oxygen serve-web --config=$(pwd)/config/oxygen.yml
/bin/sh: line 1: ./bin/oxygen: No such file or directory
make: *** [Makefile:56: run] Error 127
<!-- gh-comment-id:1712998622 --> @naddika commented on GitHub (Sep 11, 2023): @swift1337 * there's no instruction of how to set it and run it to begin with * `migrate_on_start: false` isn't the example config file * `% make run` ===> ``` ui-dashboard/embed.go:8:12: pattern dist/*: no matching files found ui-payment/embed.go:8:12: pattern dist/*: no matching files found ./bin/oxygen serve-web --config=$(pwd)/config/oxygen.yml /bin/sh: line 1: ./bin/oxygen: No such file or directory make: *** [Makefile:56: run] Error 127 ```
Author
Owner

@naddika commented on GitHub (Sep 11, 2023):

  • % docker-compose up -d ===>
Failed to load /home/me/oxygen/docker.env: open /home/me/oxygen/docker.env: no such file or directory

there's no example of docker.env

<!-- gh-comment-id:1713000550 --> @naddika commented on GitHub (Sep 11, 2023): * ```% docker-compose up -d``` ===> ``` Failed to load /home/me/oxygen/docker.env: open /home/me/oxygen/docker.env: no such file or directory ``` there's no example of `docker.env`
Author
Owner

@naddika commented on GitHub (Sep 11, 2023):

regarding the Db connection - I don't know, I've tried dozens of times.

<!-- gh-comment-id:1713003635 --> @naddika commented on GitHub (Sep 11, 2023): regarding the Db connection - I don't know, I've tried dozens of times.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/oxygen#1
No description provided.