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

More info to the Log when engine opening database file fails #8378

Open
TommiPrami opened this issue Jan 8, 2025 · 7 comments
Open

More info to the Log when engine opening database file fails #8378

TommiPrami opened this issue Jan 8, 2025 · 7 comments

Comments

@TommiPrami
Copy link
Contributor

If there is some other app, reserving the file, at least on Windows engine could try to check can the OS report the app holding the file.

Would help investigation very much, what actually happened.

Example code for getting info of the reserving app (on windows): https://devblogs.microsoft.com/oldnewthing/20120217-00/?p=8283

For security reasons most likely that information can only be in firebird log. Not the error sent to the client, maybe...

@TommiPrami
Copy link
Contributor Author

For information we have server with 800 databases. When we have to update all databases, now we got "no permission for read-write access to database", I would guess it is more than less situation mentioned above.

If we would possibly have now info of the process reserving the file, it would be way easier to get to the root of the problem.

@hvlad
Copy link
Member

hvlad commented Jan 10, 2025

It is not a task of database engine to query OS to find process that opens file in incompatible mode, IMHO.
More, there is no common way for this in different OS.

There is OS tools that allows what you want (and many more). On Windows - see SysInternals (ProcessExplorer or handle).

@TommiPrami
Copy link
Contributor Author

Problem is, that when some random app reserves db-file for a split second, it is impossible to diagnose afterwards.

If this happens, let's say once a year, how to find out why.

If it happens when you are not monitoring the situation, when a problem arises, there is no sane way to find the culprit.

This server has been running without this error a couple of years, previous servers never encountered this.

It is a different case if the problem is reproducible

@aafemt
Copy link
Contributor

aafemt commented Jan 10, 2025

That's why Firebird server should be run under a dedicated account and all databases to be located in a folder where only this account has access. This is an administration problem.

@TommiPrami
Copy link
Contributor Author

TommiPrami commented Jan 10, 2025 via email

@TommiPrami TommiPrami changed the title More info to the when engine opening database file fails More info to the Log when engine opening database file fails Jan 13, 2025
@TommiPrami
Copy link
Contributor Author

On other hand we have thousands of desktop installs, where we have no control what so ever, what user and it's possible installed applications do.

There this would be even more valuable.

User can be Admin, everything they install runs as admin, can be any virus scanner installed, with any settings. etc...

@TommiPrami
Copy link
Contributor Author

I was also thinking that at least on windows Firebird could give extra info, easily, with quite minimal changes.

It is really hard to think that someone would get offended if such info would be in the log.

And repeat again that most likely it is impossible to investigate after the fact. Who is that lucky that problem is easily reproducible.

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

3 participants