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

gbak requires exclusive access [CORE4132] #4459

Closed
firebird-automations opened this issue Jun 26, 2013 · 14 comments
Closed

gbak requires exclusive access [CORE4132] #4459

firebird-automations opened this issue Jun 26, 2013 · 14 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Thomas Beckmann (thbeckmann)

Consider this testcase:

isql -user testuser -password testpwd
create database c:\temp\test.fdb
exit;

Now:
gbak -b c:\temp\test.fdb c:\temp\test.fbk
gbak -rep c:\temp\test.fbk c:\temp\test1.fdb
works fine

Open second console and run isql
isql 127.0.0.1/3051:c:\temp\test.fdb -user testuser -password testpwd

Back to first console try
isql 127.0.0.1/3051:c:\temp\test.fdb -user testuser -password testpwd
exit;
works fine.

try
gbak -b 127.0.0.1/3051:c:\temp\test.fdb c:\temp\test.fbk -user testuser -password testpwd
yields to
gbak: ERROR:Unable to perform operation. You must be either SYSDBA or owner of the database
gbak:Exiting before completion due to errors

try
gbak -b 127.0.0.1/3051:c:\temp\test.fdb c:\temp\test.fbk -user sysdba -password masterkey
yields to
gbak: ERROR:Unable to perform operation. You must be either SYSDBA or owner of the database
gbak:Exiting before completion due to errors

Am I missing something or is this a bug?

Commits: 8524f63 FirebirdSQL/fbt-repository@66abced

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

1) gbak -b c:\temp\test.fdb c:\temp\test.fbk

Without a host name, an embedded access is used. If SharedDatabase = false in your firebird.conf (which is a default), then an error is expected (multiple processes try to share a database file).

2) gbak -b 127.0.0.1/3051:c:\temp\test.fdb c:\temp\test.fbk -user testuser -password testpwd

With a host name, you connect to the same server process, but your user is not a privileged one, hence the error.

3) gbak -b 127.0.0.1/3051:c:\temp\test.fdb c:\temp\test.fbk -user sysdba -password masterkey

This one smells like a bug.

@firebird-automations
Copy link
Collaborator Author

Commented by: Sean Leyne (seanleyne)

Thomas,

Given Dmitry's comments, please edit the case details to focus on the 1 real bug.

@firebird-automations
Copy link
Collaborator Author

Modified by: Thomas Beckmann (thbeckmann)

description: Consider this testcase:

isql -user testuser -password testpwd
create database c:\temp\test.fdb
exit;

Now:
gbak -b c:\temp\test.fdb c:\temp\test.fbk
gbak -rep c:\temp\test.fbk c:\temp\test1.fdb
works fine

Open second console and run isql
isql 127.0.0.1/3051:c:\temp\test.fdb -user testuser -password testpwd

Back to first console try
isql 127.0.0.1/3051:c:\temp\test.fdb -user testuser -password testpwd
exit;
works fine.

Try
gbak -b c:\temp\test.fdb c:\temp\test.fbk
yields to
gbak: ERROR:I/O error during "CreateFile (open)" operation for file "c:\temp\TEST.FDB"
gbak: ERROR: Error while trying to open file
gbak: ERROR: Der Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess verwendet wird.
gbak:Exiting before completion due to errors
(meaning "file is in use by another process")

try
gbak -b 127.0.0.1/3051:c:\temp\test.fdb c:\temp\test.fbk -user testuser -password testpwd
yields to
gbak: ERROR:Unable to perform operation. You must be either SYSDBA or owner of the database
gbak:Exiting before completion due to errors

try
gbak -b 127.0.0.1/3051:c:\temp\test.fdb c:\temp\test.fbk -user sysdba -password masterkey
yields to
gbak: ERROR:Unable to perform operation. You must be either SYSDBA or owner of the database
gbak:Exiting before completion due to errors

Am I missing something or is this a bug?

=>

Consider this testcase:

isql -user testuser -password testpwd
create database c:\temp\test.fdb
exit;

Now:
gbak -b c:\temp\test.fdb c:\temp\test.fbk
gbak -rep c:\temp\test.fbk c:\temp\test1.fdb
works fine

Open second console and run isql
isql 127.0.0.1/3051:c:\temp\test.fdb -user testuser -password testpwd

Back to first console try
isql 127.0.0.1/3051:c:\temp\test.fdb -user testuser -password testpwd
exit;
works fine.

try
gbak -b 127.0.0.1/3051:c:\temp\test.fdb c:\temp\test.fbk -user testuser -password testpwd
yields to
gbak: ERROR:Unable to perform operation. You must be either SYSDBA or owner of the database
gbak:Exiting before completion due to errors

try
gbak -b 127.0.0.1/3051:c:\temp\test.fdb c:\temp\test.fbk -user sysdba -password masterkey
yields to
gbak: ERROR:Unable to perform operation. You must be either SYSDBA or owner of the database
gbak:Exiting before completion due to errors

Am I missing something or is this a bug?

@firebird-automations
Copy link
Collaborator Author

Commented by: Thomas Beckmann (thbeckmann)

While SharedDatabase was not set, gbak with embedded server would not work - it's different behavior than with 2.5, but fine with me.

User "testuser" is ADMIN and creator of the database and really should be able to gbak database as SYSDBA should be able too, also...

@firebird-automations
Copy link
Collaborator Author

Commented by: Sean Leyne (seanleyne)

Please retry without performing initial backup/restore. I suspect that the gbak will run without issue, even with an active connection.

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

Thomas,

> User "testuser" is ADMIN and creator of the database

I don't see this given the command line:

gbak -rep c:\temp\test.fbk c:\temp\test1.fdb

Do you have ISC_USER set to 'testuser' behind the scenes?

@firebird-automations
Copy link
Collaborator Author

Commented by: Thomas Beckmann (thbeckmann)

No, Dimitri, not on the one connecting directly - via embedded, as you stated correctly - and that will not work because of SharedDatabase settings.

But I provided two examples explicitly connecting localhost, both with explicit user/password, one beeing admin and owner of db, the other beeing SYSDBA, both failed.

And, Sean, gbak does not run if there's a second connection to the database. First gbak-restore is just to show, that everything works fine when there's no second connection on the database.

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

Confirmed.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

assignee: Dmitry Yemanov [ dimitr ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 3.0 Alpha 2 [ 10560 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: Thomas Beckmann (thbeckmann)

Thanx.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Fix Version: 3.0 Alpha 1 [ 10331 ]

Fix Version: 3.0 Alpha 2 [ 10560 ] =>

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

QA Status: No test

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

No branches or pull requests

2 participants