Bug 248656 - security/wazuh-agent: ossec-syscheckd fails to run due to missing directory: ERROR: Couldn't create SQLite database
Summary: security/wazuh-agent: ossec-syscheckd fails to run due to missing directory: ...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords: needs-patch, needs-qa
Depends on:
Blocks:
 
Reported: 2020-08-14 13:24 UTC by Felipe Zipitria
Modified: 2021-04-12 23:33 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (m.muenz)
koobs: merge-quarterly?


Attachments
fix folder (1.24 KB, patch)
2020-08-26 10:01 UTC, Michael Muenz
m.muenz: maintainer-approval+
m.muenz: maintainer-approval+
Details | Diff
rebase fix for 4.1.4 (5.92 KB, patch)
2021-04-12 19:22 UTC, Michael Muenz
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Felipe Zipitria 2020-08-14 13:24:57 UTC
root@<myhost>:/var/ossec # tail logs/ossec.log 
2020/08/13 12:59:22 ossec-syscheckd: INFO: (6206): Ignore 'file' entry '/var/ossec/var'
2020/08/13 12:59:22 ossec-syscheckd: INFO: (6206): Ignore 'file' entry '/var/ossec/tmp'
2020/08/13 12:59:22 ossec-syscheckd: INFO: (6206): Ignore 'file' entry '/var/ossec/stats'
2020/08/13 12:59:22 ossec-syscheckd: INFO: (6207): Ignore 'file' sregex '.log$|.swp$'
2020/08/13 12:59:22 ossec-syscheckd: ERROR: Couldn't create SQLite database '/var/ossec/queue/fim/db/fim.db': unable to open database file
2020/08/13 12:59:22 ossec-syscheckd: CRITICAL: (6698): Creating Data Structure: sqlite3 db. Exiting.
2020/08/13 12:59:51 ossec-agentd: INFO: Agent is restarting due to shared configuration changes.
2020/08/13 12:59:52 ossec-agentd: INFO: (1225): SIGNAL [(15)-(Terminated)] Received. Exit Cleaning...
2020/08/13 12:59:52 ossec-execd: INFO: (1314): Shutdown received. Deleting responses.
2020/08/13 12:59:52 ossec-execd: INFO: (1225): SIGNAL [(15)-(Terminated)] Received. Exit Cleaning...

Creating the directory solves this problem:

mkdir -p /var/ossec/queue/fim/db
chown -R ossec:ossec /var/ossec/queue/fim

So I guess this could be done by the package itself. Will send a patch.
Comment 1 Michael Muenz 2020-08-22 13:46:05 UTC
Dear Felipe,

Thanks for your report, I was on vacation.
Do you plan to send a patch or shall I fix this in Makefile?

Best,
Michael
Comment 2 Michael Muenz 2020-08-26 10:01:41 UTC
Created attachment 217535 [details]
fix folder

Enclosed a patch for the reported error
Comment 3 Kevin Bowling freebsd_committer freebsd_triage 2021-04-08 21:25:10 UTC
(In reply to Michael Muenz from comment #2)
Can you rebase this patch onto the current version in ports if it is still needed?
Comment 4 Michael Muenz 2021-04-12 19:22:58 UTC
Created attachment 224065 [details]
rebase fix for 4.1.4

Please find enclosed the rebased fix
Comment 5 commit-hook freebsd_committer freebsd_triage 2021-04-12 23:33:38 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=ffe8bdaf4de4c9b7a99cd4222001d98d7069998e

commit ffe8bdaf4de4c9b7a99cd4222001d98d7069998e
Author:     Kevin Bowling <kbowling@FreeBSD.org>
AuthorDate: 2021-04-12 23:23:23 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2021-04-12 23:26:30 +0000

    security/wazuh-agent: Update to 4.1.4 and fix dirs

    Fixes dirs and permissions so the agent can start after install.

    PR:             248656
    Reported by:    Felipe Zipitria <fzipitria@perceptyx.com>
    Approved by:    Michael Muenz <m.muenz@gmail.com> (maintainer)

 security/wazuh-agent/Makefile  |  5 ++--
 security/wazuh-agent/distinfo  | 62 +++++++++++++++++++++---------------------
 security/wazuh-agent/pkg-plist |  2 ++
 3 files changed, 36 insertions(+), 33 deletions(-)
Comment 6 Kevin Bowling freebsd_committer freebsd_triage 2021-04-12 23:33:51 UTC
Thanks for your contribution!  In the future git formatted patches are preferred since the repo has switched over.