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

[Bug] heplify-server start successfully but heplify-server.log file not create ? #313

Closed
hangocanh2303 opened this issue Feb 14, 2020 · 18 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@hangocanh2303
Copy link

hangocanh2303 commented Feb 14, 2020

I'm using CentOS Linux release 7.7.1908 (Core)
I'm install heplify-server via this link: https://github.com/sipcapture/homer/wiki/homer-seven-setup#the-heplify-capture-agent
Result: heplify-server start successfully but heplify-server.log file not create
image

Here is heplify-server.toml file:
HEPAddr = "0.0.0.0:9060"
HEPTCPAddr = ""
HEPTLSAddr = "0.0.0.0:9060"
ESAddr = ""
ESDiscovery = false
LokiURL = ""
LokiBulk = 200
LokiTimer = 4
LokiBuffer = 100000
LokiHEPFilter = []
ForceHEPPayload = []
PromAddr = "0.0.0.0:9096"
PromTargetIP = ""
PromTargetName = ""
DBShema = "homer7"
DBDriver = "postgres"
DBAddr = "localhost:5432"
DBUser = "homer_user"
DBPass = "FT5QRbUOflpHMrWqXGUwu39r9cQ"
DBDataTable = "homer_data"
DBConfTable = "homer_config"
DBBulk = 200
DBTimer = 4
DBBuffer = 400000
DBWorker = 32
DBRotate = true
DBPartLog = "2h"
DBPartSip = "1h"
DBPartQos = "6h"
DBDropDays = 14
DBDropDaysCall = 0
DBDropDaysRegister = 0
DBDropDaysDefault = 0
DBDropOnStart = false
Dedup = false
DiscardMethod = ["OPTIONS","NOTIFY"]
AlegIDs = []
CustomHeader = []
SIPHeader = []
LogDbg = "hep,sql"
LogLvl = "info"
LogStd = false
LogSys = false
Config = "./heplify-server.toml"
ConfigHTTPAddr = ""

@negbie
Copy link
Member

negbie commented Feb 14, 2020

Mby some permission issue?

@hangocanh2303
Copy link
Author

Mby some permission issue?

No, I changed permission of heplify-server folder to 777 and log file still not create

@negbie
Copy link
Member

negbie commented Feb 14, 2020

Does LogSys = true work?

@hangocanh2303
Copy link
Author

Does LogSys = true work?

No, When I set LogSys = true, no log in /var/log/heplify-server.log

@negbie
Copy link
Member

negbie commented Feb 14, 2020

LogSys = true should write into syslog, normally under /var/log/syslog

@hangocanh2303
Copy link
Author

LogSys = true should write into syslog, normally under /var/log/syslog
@negbie No syslog folder in /var/log

@negbie
Copy link
Member

negbie commented Feb 14, 2020

Red Hat family distributions (including CentOS and Fedora) use /var/log/messages and /var/log/secure

Maybe there?

@negbie
Copy link
Member

negbie commented Feb 14, 2020

I use for almost everything Debian and there it's /var/log/syslog

@negbie
Copy link
Member

negbie commented Feb 14, 2020

Since this seems to be an CentOS specific issue maybe someone else could help you out here? Let tag this issue properly.

@negbie negbie added the help wanted Extra attention is needed label Feb 14, 2020
@hangocanh2303
Copy link
Author

I use for almost everything Debian and there it's /var/log/syslog

@negbie /var/log/messages printed some log of heplify, I will check it later.
But, I don't know why if syslog = false, heplify-server.log not create. It seem like centOS bug.

@hangocanh2303
Copy link
Author

hangocanh2303 commented Feb 14, 2020

here is some log in /var/log/message
Feb 14 20:14:54 /opt/heplify-server/heplify-server[27016]: server.go:83: start heplify-server 1.15 with config.HeplifyServer{HEPAddr:"0.0.0.0:9060", HEPTCPAddr:"", HEPTLSAddr:"0.0.0.0:9060", ESAddr:"", ESDiscovery:false, ESUser:"", ESPass:"", LokiURL:"", LokiBulk:200, LokiTimer:4, LokiBuffer:100000, LokiHEPFilter:[]int{}, ForceHEPPayload:[]int{}, PromAddr:"0.0.0.0:9096", PromTargetIP:"", PromTargetName:"", DBShema:"homer7", DBDriver:"postgres", DBAddr:"localhost:5432", DBUser:"homer_user", DBPass:"FT5QRbUOflpHMrWqXGUwu39r9cQ", DBDataTable:"homer_data", DBConfTable:"homer_config", DBBulk:200, DBTimer:4, DBBuffer:400000, DBWorker:32, DBRotate:true, DBPartLog:"2h", DBPartIsup:"6h", DBPartSip:"1h", DBPartQos:"6h", DBDropDays:14, DBDropDaysCall:0, DBDropDaysRegister:0, DBDropDaysDefault:0, DBDropOnStart:false, Dedup:false, DiscardMethod:[]string{"OPTIONS", "NOTIFY"}, AlegIDs:[]string{}, CustomHeader:[]string{}, SIPHeader:[]string{}, LogDbg:"hep,sql", LogLvl:"debug", LogStd:false, LogSys:true, Config:"/opt/heplify-server/heplify-server.toml", ConfigHTTPAddr:"", ConfigHTTPPW:"", Version:false}
Feb 14 20:14:54 /opt/heplify-server/heplify-server[27016]: prometheus.go:38: expose metrics without or unbalanced targets
Feb 14 20:14:54 /opt/heplify-server/heplify-server[27016]: rotator.go:331: start creating tables (2020-02-14 20:14:54.864650105 +0700 +07 m=+0.018368067)
Feb 14 20:14:55 /opt/heplify-server/heplify-server[27016]: rotator.go:344: end creating tables (2020-02-14 20:14:55.544802807 +0700 +07 m=+0.698520771)
Feb 14 20:14:55 /opt/heplify-server/heplify-server[27016]: postgres.go:62: postgres connection established

@negbie
Copy link
Member

negbie commented Feb 14, 2020

Looks good. Maybe you or someone else will find out why the normal log file can't be written on CentOS. For me it's currently to low prio so help is wanted.

@negbie negbie added the good first issue Good for newcomers label Feb 19, 2020
@systemcrash
Copy link
Contributor

systemcrash commented Mar 10, 2020

My first thoughts are SELinux.

ls -Z /opt/heplify/heplify.log

Try to touch /opt/heplify/heplify.log as root the target logfile (then chown appropriately for heplify user:group) and systemctl restart heplify. See if that helps. If so, 99% certain it's SELinux perms.

@negbie
Copy link
Member

negbie commented Mar 25, 2020

Thank you. I hope this helps some other user!

@negbie negbie closed this as completed Mar 25, 2020
@ffloimair
Copy link

ffloimair commented Nov 14, 2024

It's a general bug. There is another issue #360 that clearly points to the root cause of problems: A hardcoded path in the working directory.
If you install from qxip repository the binary will be in /usr/local/bin (which is ok), but you certainly don't want to log there.
Why not choose a logical default in /var/log and a configuration option to divert it elsewhere?

As it is now, logging to a file is basically unusable/inoperable (at least outside of dedicated containers).

Sure there is logs in syslog but if you want to have it separated this is currently not easily possible.

@lmangani
Copy link
Member

As it is now, logging to a file is basically unusable/inoperable (at least outside of dedicated containers).

This is a 4 years old issue you're commenting on so I'm not sure what the value is. If there's a PR or a proposal, we're happy to hear it and implement it.

@ffloimair
Copy link

@lmangani No reason to be offended here.
The value of my comment is very straightforward:
I just wanted to cross-link to the still open issue that is 100% related in case someone (like I did) stumbles upon this while searching for the problem.

@lmangani
Copy link
Member

Hey @ffloimair i'm absolutely not offended but I think opening a fresh issue with your comments, proposals, etc would be more useful than commenting on a very old closed one. Feel free to do so and we'll be happy to look at this again for a solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants