sipcapture / heplify-server

HEP Capture Server for HOMER
https://sipcapture.org
GNU Affero General Public License v3.0
184 stars 85 forks source link

DBConfTable is not created #511

Closed filipprosovsky closed 1 year ago

filipprosovsky commented 1 year ago

Hey all,

Is this intented? Can it be fixed?

DBConfTable is not being created if DBDriver is set to postgres. Running heplify and homer in kubernetes and homer-app would not start without homer_config table.

MYSQL vs PSQL

Many thanks

lmangani commented 1 year ago

heplify-server will only create the tables it uses. Tables used by homer-app are created by homer-app. This is intentional.

lmangani commented 1 year ago

FYI: there's no MYSQL support in HOMER 7.x (only 5.xx mode) and for our next gen we're also moving away from PSQL.

adubovikov commented 1 year ago

./homer-app -create-config-db -database-root-user=postgres -database-host=localhost -database-root-password=postgres -database-homer-user=homer_user ./homer-app -create-data-db -database-root-user=postgres -database-host=localhost -database-root-password=postgres -database-homer-user=homer_user

Please check it here: https://github.com/sipcapture/homer-app

filipprosovsky commented 1 year ago

https://github.com/sipcapture/homer-app

Yes I understand the mysql(h5) and psql(h7) support, but I would like to automate the creation of databases. If Heplify wont create just blank DB homer_config, homer-app will NOT start. Container is on error homer_config db does not exist. I also tried to use init-container (with homer image) to run -create-config-db but I think there is some step when starting the app, which checks the homer_config table. So the only options is to use separate image for init-container to create blank homer_config db? Thanks a lot for your fast response both of you :)

adubovikov commented 1 year ago

see up, you have to create homer_config by using homer-app and -create-config-db param

adubovikov commented 1 year ago

https://github.com/sipcapture/homer-app#initialization

adubovikov commented 1 year ago

also, you can check our docker containers, it will explain all that you need. https://github.com/sipcapture/homer7-docker/blob/master/heplify-server/hom7-prom-all/docker-compose.yml

filipprosovsky commented 1 year ago

Maybe I am wrong but after checking code here it just creates the database named homer_config. This is the only step missing as it does not start up without that and want to avoid manual step. After startup, the homer-app will do the rest and runs just fine.

adubovikov commented 1 year ago

@filipprosovsky did you see the link that I posted above ?

https://github.com/sipcapture/homer-app#create-homer-dbs ./homer-app -create-table-db-config

and after you do

https://github.com/sipcapture/homer-app#populate-db

./homer-app -populate-table-db-config

filipprosovsky commented 1 year ago

Yes I know about these args, but as I mentioned I would like to avoid manual steps and want the helm chart to do it automatically. Thus why I was asking about some other way. Thanks again for the info and your help!

adubovikov commented 1 year ago

No, there is no way that homer-app will create homer_config and will populate everything if the database doesn't exists, but you can alway go similar way like here:

something like this: https://github.com/sipcapture/homer7-docker/blob/master/heplify-server/hom7-prom-all/docker-compose.yml#L191

also, you can make a script that checks if DB doesn't exist - create+populate and after run homer-app