Firebird Error while trying to create file, Permission denied

saimiris_devel picture saimiris_devel · Apr 29, 2015 · Viewed 17.2k times · Source

I'm trying to create a Firebird database in my home directory through Flamerobin however I always get

*** IBPP::SQLException ***
Context: Database::Create
Message: isc_dsql_execute_immediate failed

SQL Message : -902
Unsuccessful execution caused by a system error that precludes successful execution of subsequent statements

Engine Code    : 335544344
Engine Message :
I/O error during "open O_CREAT" operation for file "/home/user/test.fdb"
Error while trying to create file
Permission denied

even though the file is chmod 777, the file /etc/firebird/2.5/firebird.conf has been modified so that:

DatabaseAccess = Full

is set to allow access to all files. The service is running:

$ ps ax | grep fireb
 3909 ?        S      0:00 /usr/sbin/fbguard -daemon -forever -pidfile /var/run/firebird/2.5/fbserver.pid

even though strangely the netstat doesn't find the connection port:

netstat | grep 3050

and returns empty list.

If I connect to an existing database all works, for instance connecting to

/var/lib/firebird/2.5/system/help.fdb

correctly shows tables.

Answer

Mark Rotteveel picture Mark Rotteveel · Apr 29, 2015

I see two possible causes:

  1. You mention that the file is chmod 777, this implies that the file already exists, so creating a new database will fail.

  2. You are trying to create (or connect) to a file in a user folder (I assume yours), through the Firebird server (although the fact no server is running might indicate this isn't the case).

I assume that the Firebird server isn't running under your account (but under the firebird user), and therefore it isn't allowed to access files in your folder.

You need to create (or access) the database in a location where the Firebird user has sufficient access rights, or use a local (embedded) connection (although I am not sure if that is supported by flamerobin.