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

Unable to Write New Scan Report to Existing Database #178

Open
Niba-nazar opened this issue Mar 4, 2025 · 3 comments
Open

Unable to Write New Scan Report to Existing Database #178

Niba-nazar opened this issue Mar 4, 2025 · 3 comments

Comments

@Niba-nazar
Copy link

Hi,

We are encountering an issue when attempting to write a new scan report generated by nmap-formatter to an old scan report. Specifically, when trying to dump the new database file to the old one, we are receiving the following error messages:

Image

Could you advise if there is an option to write a new scan report to the existing database without causing these errors?
Additionally, we would like to maintain a history of scan results within this single database by separating any session or other identifiers from each new generated DB before merging it into the main database. Is there an option for this?

Any guidance or suggestions on how to resolve this would be greatly appreciated.

@vdjagilev
Copy link
Owner

Hi @Niba-nazar
Can you check if problematic database contains nf_schema table? I think the database that you are trying to save to does not has this table and therefore nmap-formatter tries to create other database tables and fails because they exist already.

Try to run this query on your database directly:

CREATE TABLE IF NOT EXISTS nf_schema (
	version text
);
INSERT INTO nf_schema VALUES ("3.0.2");

And try re-running.

@Niba-nazar
Copy link
Author

Hi,

Yes, the table nf_schema already exists in both database files as mentioned.

Image

@vdjagilev
Copy link
Owner

@Niba-nazar does nf_schema has any records?

SELECT version FROM nf_schema LIMIT 1

If it doesn't then it makes sense that it fails. Try to add new value there:

INSERT INTO nf_schema VALUES ("3.0.2");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants