Closed Gilbert2015 closed 1 year ago
Your report is appreciated. Please star this repository to motivate its developers! :star:
Are you using one of our docker-compose examples? Homer is not a single container application.
Indeed, I have structured my Docker image deployment according to the examples provided in the docker-compose repository. Since my intention is to deploy the applications on an Openshift Kubernetes cluster, I have created a separate Dockerfile for each application.
Got it. Then you must have converted something wrong since the bundle works and its quite simple. Agents send to heplify-server, which writes to the database. The Homer-app reads from database. That's about it.
Sadly, there are literally HUNDREDS of homer users running on k8s but none of the users ever shared their config back with the community.... magic of one-way opensource, I guess.
Thank you for your response and explanation. I wanted to discuss an error message I encountered in my code. The error message looks like this:
{"time":"2023-07-10T19:31:46.087296323Z","level":"FATAL","prefix":"echo","file":"main.go","line":"882","message":"Couldn't start server"}
Upon investigating, I found that the error originates from the main.go
file at line 882, which contains the following code snippet:
if httpEnable {
/* need excute it in background because HTTP locks */
httpHost := viper.GetString("http_settings.host")
httpPort := viper.GetString("http_settings.port")
httpURL := fmt.Sprintf("%s:%s", httpHost, httpPort)
if viper.GetBool("https_settings.enable") {
go func(url string) {
e.Logger.Fatal(e.Start(url))
}(httpURL)
} else {
err := e.Start(httpURL)
if err != nil {
logger.Error(err.Error())
e.Logger.Fatal("Couldn't start server")
}
}
}
The error is related to the http_settings
configuration in the webconfig
file, which looks like this:
"http_settings": {
"host": "0.0.0.0",
"port": homer_web_port,
"root": "/usr/local/homer/dist",
"path": "homer_serve_path",
"gzip": true,
"debug": false
}
Interestingly, removing the line "port": homer_web_port,
from the http_settings
configuration resolved the error. However, I'm unsure if this change impacts the functionality of the heplify-server
. If I still want to utilize the http_settings
, how can I resolve the issue?
I appreciate your assistance in clarifying the consequences of removing that line and suggesting a solution to the problem while still being able to utilize the http_settings
configuration.
Hi, I was able to resolve the issue by changing the port from 80 to 8080
Upon attempting to deploy the Homer 7 application using the Docker image (sipcapture/webapp:latest), the configuration process completed successfully. However, when attempting to start the server, an error message was encountered. The error message is as follows:
Pre-Flight provisioning completed! [33m CONNECT to DB ROOT STRING: [host=devperconacluster.development.svc.cluster.local user=postgres dbname=postgres sslmode=disable port=5432 password=] [0m {"level":"info","msg":"init logging system","time":"2023-07-10T19:31:44Z"} [31m HOMER - create db [homer_config] with [name=postgres] [0m
[35m(/homer-app/migration/migration.go:85)[0m [33m[2023-07-10 19:31:44][0m [31;1m pq: database "homer_config" already exists [0m
[35m(/homer-app/migration/migration.go:85)[0m [33m[2023-07-10 19:31:44][0m [36;1m[1.15ms][0m CREATE DATABASE homer_config OWNER postgres
[36;31m[0 rows affected or returned ][0m [33m DONE [0m [31m HOMER - show users [0m Role name | Attributes
[33m DONE [0m {"level":"info","msg":"init logging system","time":"2023-07-10T19:31:44Z"} [33m CONNECT to DB ROOT STRING: [host=devperconacluster.development.svc.cluster.local user=postgres dbname=postgres sslmode=disable port=5432 password=LFjcErEEFxKIoxACytbW9Nol] [0m [31m HOMER - create db [homer_data] with [name=postgres] [0m
[35m(/homer-app/migration/migration.go:85)[0m [33m[2023-07-10 19:31:44][0m [31;1m pq: database "homer_data" already exists [0m
[35m(/homer-app/migration/migration.go:85)[0m [33m[2023-07-10 19:31:44][0m [36;1m[1.16ms][0m CREATE DATABASE homer_data OWNER postgres
[36;31m[0 rows affected or returned ][0m [33m DONE [0m [31m HOMER - show users [0m Role name | Attributes
[33m DONE [0m {"level":"info","msg":"init logging system","time":"2023-07-10T19:31:44Z"} [32m HOMER - creating tables for the config DB [dbname=homer_config] [0m [33m DONE [0m {"level":"info","msg":"init logging system","time":"2023-07-10T19:31:45Z"} [31m HOMER - filling tables for the config DB [dbname=homer_config] [0m [33m DONE [0m time="2023-07-10T19:31:45Z" level=info msg="SELECT * FROM \"versions\" " module=gorm type=sql Database provisioning completed! {"level":"info","msg":"init logging system","time":"2023-07-10T19:31:45Z"} Successful ping: devperconacluster.development.svc.cluster.local, Type: data, Node: LocalNode[34m PostgreSQL version: 14.7 [0m time="2023-07-10T19:31:46Z" level=info msg="INSERT INTO \"applications\" (\"guid\",\"name\",\"host\",\"version\",\"created_at\") VALUES ($1,$2,$3,$4,$5) ON CONFLICT (name,host) DO UPDATE SET version = EXCLUDED.version, guid = EXCLUDED.guid RETURNING \"applications\".\"id\"" module=gorm type=sql [31m
[0m [32m Version: homer-app 1.4.59. [0m {"time":"2023-07-10T19:31:46.087296323Z","level":"FATAL","prefix":"echo","file":"main.go","line":"882","message":"Couldn't start server"}