0

When I execute Firebird 3.0.x backup command:

c:\Db>"C:\Program Files\Firebird\Firebird_3_0\gbak.exe"  -b c:\Db\Db1.fdb c:\Db\Db1_backup.fbk -garbage_collect -transportable -verify -user SYSDBA -pas PASSWORD

Error 1 happend:

gbak: ERROR:I/O error during "CreateFile (open)" operation for file "C:\DB\DB1.FDB"
gbak: ERROR:    Error while trying to open file
gbak: ERROR:    The process cannot access the file because it is being used by another process.
gbak:Exiting before completion due to errors

Example 2 with TCP/INET/localhost/remote protocols:

c:\Db>"c:\Program Files\Firebird\Firebird_3_0\gbak.exe" -backup inet://c:\Db\Db1.fdb d:\_Backups\Db1_20180702_230546.fbk -garbage_collect -transportable -verify -skip_data SOMETAB_TO_SKIP -user SYSDBA -password PASSWORD123

Error 2 happend:

gbak: ERROR:Your user name and password are not defined. Ask your database administrator to set up a Firebird login.

First of all ... to be honest I am not sure when this started or why. I did not look at my server maybe 3 months but today my backup disk broke down so I had to. I just saw this error first time today and I lived in conviction that my backup works. But I had Firebird 2.5 before.

The question is: is this specific only for Firebird 3 SuperServer on Windows? And there is no way how to backup Firebird 3 SuperServer database when is used by FB server?

Tested and failed on Firebird server 3.0.2 and 3.0.3 on Windows Server 2016.

Firebird is running as a service

Nothing is changed in firebird.config except:

WireCompression = true
RemoteServicePort = 1234
CpuAffinityMask = 8
ServerMode = Super or SuperClassic (when I testing it)

When I execute first command on SuperClassic it works.

When I execute first command on SuperServer 2.5.x it works.

mojmir.novak
  • 2,920
  • 3
  • 24
  • 32
  • I can't reproduce it; this command works fine for me, even when the database is in use. Exactly which version of Firebird are you using (full version number)? – Mark Rotteveel Jul 01 '18 at 08:29
  • It is ```3.0.2``` version. Row ```ServerMode = Super``` in ```firebird.conf``` must be enaled. (FB restart is required). With ```ServerMode = SuperClassic``` or just Classic it works just fine but i prefer SuperServer because of less memory consumpion. – mojmir.novak Jul 01 '18 at 13:39
  • What happens if you upgrade to 3.0.3? Could you post the config of the `Providers` setting in `firebird.conf`? – Mark Rotteveel Jul 01 '18 at 13:41
  • I have providers set to default (it means unchanged): ```#Providers = Remote,Engine12,Loopback``` I think that upgrade to 3.0.3 would not change it. I think this is standard behaviour for super server version 3+ – mojmir.novak Jul 01 '18 at 13:43
  • I have tested it with 3.0.3 SuperServer and it works fine for me. So unless you still have the problem with 3.0.3, I will assume this could have been a bug that was fixed with 3.0.3. – Mark Rotteveel Jul 01 '18 at 15:40
  • This should have mean your gbak command tries to use Embedded Server mode, which is a bit less predictable in Windows with FB3 (on UNIX border between stand-alone and embedded server was less etched always). Try putting TCP/IP prefixes into gbak connection string, that would coincidentally prohibit Embedded Server mode. https://www.firebirdsql.org/file/documentation/release_notes/html/en/3_0/rnfb30-apiods-api.html#rnfb30-apiods-api-winlocal – Arioch 'The Jul 02 '18 at 09:11
  • Additionally, I wonder if somehow gbak uses different Firebird.conf than the server process and maybe gbak thinks he still works in Classic mode. Check gbak files I/O using tools like SysInternals Process Monitor, which files it reads, maybe there are old configs saved in Windows VirtualStore or something. – Arioch 'The Jul 02 '18 at 09:15
  • I have tried version 3.0.3 but behaviour is the same. I have checked my PC with "Everything Search" utiltiy for "firebird.conf" but found only 1. It is new Win Server 2016 so it is clean. When I try TCP/IP prefixes different error is shown. ```gbak: ERROR:Your user name and password are not defined. Ask your database administrator to set up a Firebird login. gbak:Exiting before completion due to errors``` – mojmir.novak Jul 02 '18 at 21:14
  • and my cmd line: ```"c:\Program Files\Firebird\Firebird_3_0\gbak.exe" -backup inet://c:\Db\Db1.fdb d:\_Backups\Db1_20180702_230546.fbk -garbage_collect -transportable -verify -skip_data SOMETAB_TO_SKIP -user SYSDBA -pas SOMEPASS``` – mojmir.novak Jul 02 '18 at 21:15
  • Please edit your question and add that information to the question itself. BTW: Is Firebird running as a service or as an application? Are you sure the password is correct? Have you tried using the full command line option `-password`? – Mark Rotteveel Jul 03 '18 at 06:53
  • Should have mean he did not created one or both of SYSDBA users... (or set one of them other password than SOMEPASS) – Arioch 'The Jul 03 '18 at 17:20
  • password is correct, because it works with SuperClassic option. -pas or -password the same behaviour. I updated the question with those information. – mojmir.novak Jul 04 '18 at 01:00

1 Answers1

0

Ok, so I finally figured out where is the issue. Here is the explanation:

My password is wrong!

BUT!

When I use SuperClassic I can use WRONG password and Firebird allows access to the database. (as local user)

When I use SuperServer I can use WRONG password and Firebird allows access to the database WHEN I am the FIRST connection! (as local user with and also without remote protocols)

When I use SuperServer and I use WRONG password Firebird denied access to the database WHEN I am the second (and more) connection! (local also remote user)

With only remote protocols you can not access database with wrong password.

(By remote protocols I mean this.)

This are the reasons of the differences in behavior and why I did not see using of WRONG password. Thanks to everybody who tried to help me.

mojmir.novak
  • 2,920
  • 3
  • 24
  • 32