Problems with Firebird 3.0.8 on Xubuntu 22.04 and VirtualBox

1,041 views
Skip to first unread message

Stéphanie Cortelli

unread,
Oct 2, 2022, 6:15:47 AM10/2/22
to firebird-support
Hello,
I've installed with VirtualBox a Xubuntu 22.04 LTS and Firebird 3.0.8 from repositories.
I can't restore a backup made with Firebird 3.0.5 with gbak.
The message is: I/O error during "open O_CREAT" for file....
Permission denied.
Also with FlameRobin I have the same problem.
I've also tried with FlameRobin to create a new databas, but I become SQL message -902 with engine code 335544344 and the same message "I/O error drugin "open O_CREAT".
The folder that contains either backup or database have all permissions (chmod 777).
I use Firebird for 16 years and I've made backup/restore thousand of times.
I can't understand the problem.
I've remade a dpkg-reconfigure firebird3.0-server, aber the problems remains.
Thank you for any help.
Best regards,
Stephanie

Mark Rotteveel

unread,
Oct 2, 2022, 6:55:29 AM10/2/22
to firebird...@googlegroups.com
The error means that you're trying to open or create a file in a
location where you (or the Firebird server) has no permission.

Without exact reproduction steps, this is hard to diagnose any further.

As an aside, the latest Firebird 3.0 is Firebird 3.0.10.

Mark
--
Mark Rotteveel

Stéphanie Cortelli

unread,
Oct 2, 2022, 7:23:47 AM10/2/22
to firebird-support
Thank your for your reply.

I've understood that it is a permission problem, but I don't understand why.

Here is the code in the terminal of XUbuntu:

stephanie@stephanie-VirtualBox:~$ sudo chmod 777 -R /home/stephanie/MyErp/Data
stephanie@stephanie-VirtualBox:~$ gbak -c -v -user SYSDBA -password masterkey /home/stephanie/MyErp/Backup/backup_0001_20221002.fbk localhost:/home/stephanie/MyErp/Data/dbgen0001.fdb
gbak:opened file /home/stephanie/MyErp/Backup/backup_0001_20221002.fbk
gbak:transportable backup -- data in XDR format
gbak:        backup file is compressed
gbak:backup version is 10
gbak: ERROR:I/O error during "open O_CREAT" operation for file "/home/stephanie/MyErp/Data/dbgen0001.fdb"
gbak: ERROR:    Error while trying to create file
gbak: ERROR:    Permission denied
gbak: ERROR:failed to create database localhost:/home/stephanie/MyErp/Data/dbgen0001.fdb
gbak:Exiting before completion due to errors
stephanie@stephanie-VirtualBox:~$

The repository of XUbuntu 22.04 has only the 3.0.8 version of Firebird (the 3.0.10 should be manually compilated from sources).

If I copy a text file in the same directory it is ok:

stephanie@stephanie-VirtualBox:~$ cp /home/stephanie/Temp/TestFile.txt /home/stephanie/MyErp/Data

If I do the gbak with sudo I become the same problem.

Of course sudo dpkg-reconfigure is done with password masterkey.

Could the problem have to do with VirtualBox + Firebird 3.0.8?

I've read of this bug, but VirtualBox is not mentioned:


Ping of localhost on the virtual machine is ok:

stephanie@stephanie-VirtualBox:~$ ping localhost
PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.043 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.062 ms
64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.064 ms
64 bytes from localhost (127.0.0.1): icmp_seq=4 ttl=64 time=0.063 ms
64 bytes from localhost (127.0.0.1): icmp_seq=5 ttl=64 time=0.065 ms
64 bytes from localhost (127.0.0.1): icmp_seq=6 ttl=64 time=0.065 ms
^C
--- localhost ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 5116ms
rtt min/avg/max/mdev = 0.043/0.060/0.065/0.007 ms
stephanie@stephanie-VirtualBox:~$

Thank you again and best regards,

Stephanie

Norbert Saint Georges

unread,
Oct 2, 2022, 9:11:17 AM10/2/22
to firebird...@googlegroups.com

just an idea

chown firebird:firebird /home/stephanie/MyErp/Data

 

De : firebird...@googlegroups.com [mailto:firebird...@googlegroups.com] De la part de Stéphanie Cortelli

Mark Rotteveel

unread,
Oct 2, 2022, 10:00:48 AM10/2/22
to firebird...@googlegroups.com
On 02-10-2022 15:11, Norbert Saint Georges wrote:
> just an idea
>
> chown firebird:firebird /home/stephanie/MyErp/Data

It would probably be better to do this outside of the home directory,
then to change the owner of a directory inside the home directory. That
said, Linux is not my strong point.

Mark
--
Mark Rotteveel

Mark Rotteveel

unread,
Oct 2, 2022, 10:03:52 AM10/2/22
to firebird...@googlegroups.com
On 02-10-2022 13:23, Stéphanie Cortelli wrote:
> I've understood that it is a permission problem, but I don't understand why.
>
> Here is the code in the terminal of XUbuntu:
>
> stephanie@stephanie-VirtualBox:~$ sudo chmod 777 -R
> /home/stephanie/MyErp/Data
> stephanie@stephanie-VirtualBox:~$ gbak -c -v -user SYSDBA -password
> masterkey /home/stephanie/MyErp/Backup/backup_0001_20221002.fbk
> localhost:/home/stephanie/MyErp/Data/dbgen0001.fdb

Try using:
gbak -service localhost:service_mgr -c -v -user sysdba -password
masterky /home/stephanie/MyErp/Backup/backup_0001_20221002.fbk
/home/stephanie/MyErp/Data/dbgen0001.fdb

Mark
--
Mark Rotteveel

Tomasz Tyrakowski

unread,
Oct 2, 2022, 1:38:25 PM10/2/22
to firebird...@googlegroups.com
On 02.10.2022 at 13:23, Stéphanie Cortelli wrote:
> Thank your for your reply.
>
> I've understood that it is a permission problem, but I don't understand why.
>
> Here is the code in the terminal of XUbuntu:
>
> stephanie@stephanie-VirtualBox:~$ sudo chmod 777 -R
> /home/stephanie/MyErp/Data
> stephanie@stephanie-VirtualBox:~$ gbak -c -v -user SYSDBA -password
> masterkey /home/stephanie/MyErp/Backup/backup_0001_20221002.fbk
> localhost:/home/stephanie/MyErp/Data/dbgen0001.fdb
> gbak:opened file /home/stephanie/MyErp/Backup/backup_0001_20221002.fbk
> gbak:transportable backup -- data in XDR format
> gbak: backup file is compressed
> gbak:backup version is 10
> gbak: ERROR:I/O error during "open O_CREAT" operation for file
> "/home/stephanie/MyErp/Data/dbgen0001.fdb"
> gbak: ERROR: Error while trying to create file
> gbak: ERROR: Permission denied
> gbak: ERROR:failed to create database
> localhost:/home/stephanie/MyErp/Data/dbgen0001.fdb
> gbak:Exiting before completion due to errors
> stephanie@stephanie-VirtualBox:~$
>

What's the owner and permissions of /home/stephanie?
If they're e.g. stephanie.stephanie 700, FB won't be able to access
anything inside. Also, check the owner and permissions of
/home/stephanie/MyErp.

regards
Tomasz

Stéphanie Cortelli

unread,
Oct 2, 2022, 3:06:49 PM10/2/22
to firebird...@googlegroups.com

Thank you all!

1) sudo chown -R firebird:firebird /home/stephanie/MyErp/Data ,the problem remains;

2) sudo chmod 770 -R /home/stephanie/MyErp/Data and even sudo chmod 777 -R /home/stephanie/MyErp/Data , the problem still remains;

3) gbak -service:

stephanie@stephanie-VirtualBox:~$ gbak -service localhost:service_mgr -c -v -user SYSDBA -password masterkey /home/stephanie/MyErp/Backup/backup_0001_20221002.fbk /home/stephanie/MyErp/Data/dbgen0003.fdb
gbak: ERROR:cannot open backup file /home/stephanie/MyErp/Backup/backup_0001_20221002.fbk
gbak: ERROR:    Exiting before completion due to errors


gbak:Exiting before completion due to errors
stephanie@stephanie-VirtualBox:~$

4) If I do the restore with gbak as root with sudo and without the localhost/IP it works, but I cannot open the database, also with permissions ok:

sudo gbak -c -v -user SYSDBA -password masterkey /home/stephanie/MyErp/Backup/backup_0001_20221002.fbk /home/stephanie/MyErp/Data/dbgen0001.fdb

sudo chown -R firebird:firebird /home/stephanie/MyErp/Data

sudo chmod 777 -R /home/stephanie/MyErp/Data

5) I've tried to uninstall (with config files) and reinstall Firebird, the problem remains.

I don't know if VirtualBox has a different menage of the TCP IP protocol.

I use VirtualBox 6.1.38, Xubuntu 22.04 has Firebird 3.0.8.

The only thing I haven't done yet is uninstall Firebird and install version 3.0.10 (current version) or 3.0.5 (version that I use on a Debian Buster) from the tar.gz file.

I cannot understand the cause of this problem.

Thank you again, best regards,

Stephanie




Il 02/10/22 19:38, Tomasz Tyrakowski ha scritto:

Tomasz Tyrakowski

unread,
Oct 2, 2022, 3:21:49 PM10/2/22
to firebird...@googlegroups.com, Stéphanie Cortelli
Stephanie, all you've done was change ownership/permissions for
/home/stephanie/MyErp/Data (only the Data subdirectory was affected),
but for the permissions to be effective, all intermediate directories
have to be accessible to FB as well.
What's the output of
ls -ld /home/stephanie
and
ls -ld /home/stephanie/MyErp
?

I suspect /home/stephanie is accessible only to you.
Try
chmod a+x /home/stephanie
chmod a+x /home/stephanie/MyErp
in addition to what you did to /home/stephanie/MyErp/Data.

regards
Tomasz

Stéphanie Cortelli

unread,
Oct 2, 2022, 3:58:58 PM10/2/22
to Tomasz Tyrakowski, firebird...@googlegroups.com

Hello Tomasz,

thank you very much, now it works!!

stephanie@stephanie-VirtualBox:~$ ls -ld /home/stephanie
drwxr-x--- 21 stephanie stephanie 4096 ott  2 12:54 /home/stephanie
stephanie@stephanie-VirtualBox:~$ ls -ld /home/stephanie/MyErp
drwxrwxrwx 18 stephanie stephanie 4096 ott  1 23:50 /home/stephanie/MyErp
stephanie@stephanie-VirtualBox:~$ sudo chmod a+x /home/stephanie
[sudo] password di stephanie:
stephanie@stephanie-VirtualBox:~$ sudo chmod a+x /home/stephanie/MyErp
stephanie@stephanie-VirtualBox:~$ ls -ld /home/stephanie/MyErp
drwxrwxrwx 18 stephanie stephanie 4096 ott  1 23:50 /home/stephanie/MyErp
stephanie@stephanie-VirtualBox:~$ ls -ld /home/stephanie
drwxr-x--x 21 stephanie stephanie 4096 ott  2 12:54 /home/stephanie
stephanie@stephanie-VirtualBox:~$

I was used to installing the Data directory outside the home, but for a test I used the home on the virtual machine. But I forgot to think about the upper folders that contain the data folder for the user firebird!

Thank you again!!

Thank you all for the answers and for your time.

Best regards,

Stephanie


Il 02/10/22 21:21, Tomasz Tyrakowski ha scritto:

Mark Rotteveel

unread,
Oct 3, 2022, 6:34:03 AM10/3/22
to firebird...@googlegroups.com
On 02-10-2022 21:21, Tomasz Tyrakowski wrote:
> Stephanie, all you've done was change ownership/permissions for
> /home/stephanie/MyErp/Data (only the Data subdirectory was affected),
> but for the permissions to be effective, all intermediate directories
> have to be accessible to FB as well.
> What's the output of
> ls -ld /home/stephanie
> and
> ls -ld /home/stephanie/MyErp
> ?
>
> I suspect /home/stephanie is accessible only to you.
> Try
> chmod a+x /home/stephanie
> chmod a+x /home/stephanie/MyErp
> in addition to what you did to /home/stephanie/MyErp/Data.

Please do not do this. You shouldn't make things in your home directory
available to everyone. Use a directory *outside* your home directory.

Mark
--
Mark Rotteveel

Tomasz Tyrakowski

unread,
Oct 3, 2022, 6:46:52 AM10/3/22
to firebird...@googlegroups.com
The OP declared this was a one-shot setup in a VM, and in production env
there's a dedicated DB directory. However, the permission rules for a
directory chain apply no matter their location, that's why I decided
this info might be generally useful.

regards
Tomasz

Reply all
Reply to author
Forward
0 new messages