Error doing a backup when Database file name has extended ASCII chars

130 views
Skip to first unread message

Diego

unread,
May 30, 2025, 8:30:13 AMMay 30
to firebird-support
We have a program which makes backups of our Firebird databases.
If the database name has only ASCII chars, it works correctly.
But if the database name has extended ASCII chars (for example "Ñ" or "Ç"), the backup fails.

We tested it on Firebird-5.0.3.1659-0-f4c0f85-windows-x64.

We use Delphi 12.3, and the component TFDFBNBackup.Backup, which breaks with error "[FireDAC][Phys][FB]I/O error during "CreateFile (open)" operation for file".

Initially we thought it was a bug in Delphi component, so we contacted Delphi support.

But they say
"It seems there is a bug in Firebird isc_action_svc_nbak service (behind TFDFBNBackup). It does not support isc_spb_utf8_filename properly. All the possible combinations of isc_spb_utf8_filename and isc_spb_dbname value encoding fail with I/O or encoding errors. The issue should be reported to Firebird team."
 
We have a simple Delphi project, which shows the issue.
We attach the source code, but not the exe because it is not allowed to upload this type of files.
If you need it to reproduce the issue, we could try to send it directly by email.

With the delphi program it is possible to reproduce the issue, with the following steps:
- Copy standard EMPLOYEE.FDB database to the same folder the program.
- Make another copy of this database and rename it to EMPLOYEEÑ.fdb
- Run attached Delphi program
- When clicking the first button, it makes the backup ok.
- When clicking the second button it breaks.

The only difference is the database file name.

Could you confirm us that it is a bug in Firebird, please?

Thanks in advance
BackupBug.zip

Dimitry Sibiryakov

unread,
May 30, 2025, 8:40:43 AMMay 30
to firebird...@googlegroups.com
Diego wrote 30.05.2025 14:30:
> But if the database name has extended ASCII chars (for example "Ñ" or "Ç"), the
> backup fails.

Are these characters in ANSI code page of the server?

--
WBR, SD.

Diego

unread,
May 30, 2025, 9:24:41 AMMay 30
to firebird-support
Yes, we use ISO8859_1 charset, which includes characters like "Ñ" or "Ç".

We tryed to make an nbackup directly, with Windows command "nbackup" and it works correctly. 
The problem only happens when trying to make an nbackup of a database with extended ascii chars in the file name, using the Delphi component (as in the attached Delphi code).
So we thought it was a bug in Delphi, but they said we should report it on Firebird forums.

Thanks in advance


Dimitry Sibiryakov

unread,
May 30, 2025, 9:36:05 AMMay 30
to firebird...@googlegroups.com
Diego wrote 30.05.2025 15:24:
> Yes, we use ISO8859_1 charset, which includes characters like "Ñ" or "Ç".
>
> We tryed to make an nbackup directly, with Windows command "nbackup" and it
> works correctly.
> The problem only happens when trying to make an nbackup of a database with
> extended ascii chars in the file name, using the Delphi component (as in the
> attached Delphi code).
> So we thought it was a bug in Delphi, but they said we should report it on
> Firebird forums.

Is it reproducible with fbsvcmgr?

--
WBR, SD.

Diego

unread,
Jun 2, 2025, 2:36:49 AMJun 2
to firebird-support
Yes, we always use SuperClassic firebird service.

Thanks in advance,

Mark Rotteveel

unread,
Jun 2, 2025, 2:39:39 AMJun 2
to firebird...@googlegroups.com
On 02/06/2025 08:36, Diego wrote:
> Yes, we always use SuperClassic firebird service.
That doesn't answer the question if it's reproducible with fbsvcmgr, a
commandline tool to execute service operation.

Mark
--
Mark Rotteveel

Diego

unread,
Jun 2, 2025, 6:28:20 AMJun 2
to firebird-support
Ok. I'm sorry, I thought you were referring to the Firebird service.

I have now tried the commandline tool fbsvcmgr, and it also breaks, with the same error: "I/O error during "CreateFile (open)" operation for file ..."

Thanks in advance

Dimitry Sibiryakov

unread,
Jun 2, 2025, 6:33:07 AMJun 2
to firebird...@googlegroups.com
Diego wrote 02.06.2025 12:28:
> I have now tried the commandline tool fbsvcmgr, and it also breaks, with the
> same error: "I/O error during "CreateFile (open)" operation for file ..."

In this case you should open a ticket in the Firebird tracker providing full
fbsvcmgr command line you used.

--
WBR, SD.

Mark Rotteveel

unread,
Jun 2, 2025, 6:36:02 AMJun 2
to firebird...@googlegroups.com
On 02/06/2025 12:28, Diego wrote:
> Ok. I'm sorry, I thought you were referring to the Firebird service.
>
> I have now tried the commandline tool fbsvcmgr, and it also breaks, with
> the same error: "I/O error during "CreateFile (open)" operation for
> file ..."
What is the filename you used, and what is the filename reported in the
error?

Firebird does uppercase mangling instead of looking up the actual
filename on Windows, and that can sometimes screw things up.

Mark
--
Mark Rotteveel

Diego

unread,
Jun 2, 2025, 7:08:24 AMJun 2
to firebird-support
The database filename I used is "C:\Users\Diego\Desktop\EMPLOYEEÑ.FDB", and the backup filename is "C:\Users\Diego\Desktop\EMPLOYEEÑ.NBK"

The commandline I used is:
"C:\Program Files\Firebird\Firebird_5_0\fbsvcmgr" service_mgr -user sysdba -password masterkey -action_nbak -nbk_level 0 -dbname C:\Users\Diego\Desktop\EMPLOYEEÑ.FDB -nbk_file C:\Users\Diego\Desktop\EMPLOYEEÑ.NBK

I used the exact filename for the commandline, as the filename on Windows.

The commandline tool breaks with error:

"I/O error during "CreateFile (open)" operation for file "C:\USERS\DIEGO\DESKTOP\EMPLOYEEÃ'.FDB"
-Error while trying to open file
-El sistema no puede encontrar el archivo especificado."

Thanks in advance

Hamish Moffatt

unread,
Jun 2, 2025, 8:21:25 PMJun 2
to firebird...@googlegroups.com
On 2/6/25 21:08, Diego wrote:
> The database filename I used is
> "C:\Users\Diego\Desktop\EMPLOYEEÑ.FDB", and the backup filename is
> "C:\Users\Diego\Desktop\EMPLOYEEÑ.NBK"


Years ago I had trouble on embedded Firebird 2.5 storing a database in a
user's profile when their Windows username (and therefore their home
directory) contained non-ASCII characters. I gave up and stored the
database files elsewhere for those users.


Hamish

Hamish Moffatt

unread,
Jun 2, 2025, 8:25:26 PMJun 2
to firebird...@googlegroups.com
There are bug reports about this in the tracker eg
https://github.com/FirebirdSQL/firebird/issues/2603


Hamish

Diego

unread,
Jun 6, 2025, 6:32:13 AMJun 6
to firebird-support
We think our issue could be related to that issues. But our case is specifically about nbackup and we have tested it on a new version of Firebird (Firebird-5.0.3.1659-0-f4c0f85-windows-x64). 
So we think this could be reported as an independent issue in the Firebird tracker (https://github.com/FirebirdSQL/firebird/issues/8588).

Thank you all for your help, 
Diego

Mark Rotteveel

unread,
Jun 7, 2025, 7:04:49 AMJun 7
to firebird...@googlegroups.com
On 02/06/2025 13:08, Diego wrote:
> The database filename I used is "C:\Users\Diego\Desktop\EMPLOYEEÑ.FDB",
> and the backup filename is "C:\Users\Diego\Desktop\EMPLOYEEÑ.NBK"
>
> The commandline I used is:
> "C:\Program Files\Firebird\Firebird_5_0\fbsvcmgr" service_mgr -user
> sysdba -password masterkey -action_nbak -nbk_level 0 -dbname C:
> \Users\Diego\Desktop\EMPLOYEEÑ.FDB -nbk_file C:
> \Users\Diego\Desktop\EMPLOYEEÑ.NBK
>
> I used the exact filename for the commandline, as the filename on Windows.
>
> The commandline tool breaks with error:
>
> "I/O error during "CreateFile (open)" operation for file "C:
> \USERS\DIEGO\DESKTOP\EMPLOYEEÃ'.FDB"
> -Error while trying to open file
> -El sistema no puede encontrar el archivo especificado."
Given the

EMPLOYEEÑ.FDB
vs
EMPLOYEEÃ'.FDB

It looks like the filename was in UTF-8 at some point, and then
interpreted in windows-1252 at another point (Ñ is encoded as 0xC391 in
UTF-8, and 0xC3 is à and 0x91 is ' in windows-1252.

Mark
--
Mark Rotteveel
Reply all
Reply to author
Forward
0 new messages