Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2009-04

Permission denied error with Firebird SS on OSX

17 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Giuseppe Luigi Punzi

Hi again.

Probably, is not the right place to ask, and sorry for this, but I'm desperate.

I'm starting some projects, and I will develop them from OSX and Windows. On windows, seems all ok, but from OSX I'm getting some troubles thath stops me now.

I fighted against the lazarus error libfbclient.so don't found, and I solved it.
I exported the paths to use the commands from command line. I created a directory to store the databases, and gives user rights to firebird user (if it exists, I don't know).

Now, I can't open any database from Lazarus/SQLdb nor Flamerobin, getting an error about 'Permission Denied'.

I can't find an updated guide to install correctly Firebird under OSX.

I'm missing something? Is better to install Classic Server instead SuperServer? If so, is enough deleting Firebird.Framework directory?

Cheers, and thanks you very much.

Reply by email

Graeme Geldenhuys
to Giuseppe Luigi Punzi
Giuseppe Luigi Punzi wrote
I'm starting some projects, and I will develop them from OSX and Windows. On windows, seems all ok, but from OSX I'm getting some troubles thath stops me now.

It's because Windows has crappy security. :-)

Now, I can't open any database from Lazarus/SQLdb nor Flamerobin, getting an error about 'Permission Denied'.

In Firebird config file (/etc/firebird/2.0/firebird.conf under Linux) you can setup what directories are allow do have database in. By default I think not all directories are allowed. It's the "DatabaseAccess" setting.

Also you need to be sure about your User and Group access writes to the database file (*.fdb) itself and the write access to the directory containing the *.fdb files.

I'm missing something? Is better to install Classic Server instead SuperServer? If so, is enough deleting Firebird.Framework directory?

Your problem has nothing to do with Classic vs Super Server installs. It's a permission issue - that's all.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Giuseppe Luigi Punzi
to Graeme Geldenhuys

It's sounds me thath I swarched over firebird.conf file, and, this option was commented (default = full access)

Otherwise, I will try some options when back to home.

Thanks

Graeme Geldenhuys escribi?:

Show quoted text 45 lines
On Thu, Apr 2, 2009 at 4:08 PM, Giuseppe Luigi Punzi wrote: > I'm starting some projects, and I will develop them from OSX and > Windows. On windows, seems all ok, but from OSX I'm getting some > troubles thath stops me now. > It's because Windows has crappy security. :-) > Now, I can't open any database from Lazarus/SQLdb nor Flamerobin, > getting an error about 'Permission Denied'. > In Firebird config file (/etc/firebird/2.0/firebird.conf under Linux) you can setup what directories are allow do have database in. By default I think not all directories are allowed. It's the "DatabaseAccess" setting. Also you need to be sure about your User and Group access writes to the database file (*.fdb) itself and the write access to the directory containing the *.fdb files. > I'm missing something? Is better to install Classic Server instead > SuperServer? If so, is enough deleting Firebird.Framework directory? > Your problem has nothing to do with Classic vs Super Server installs. It's a permission issue - that's all. Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Giuseppe Luigi Punzi Ruiz
to Graeme Geldenhuys: On Thu, Apr 2, 2009 at 4:08 PM, Giuseppe Luigi Punzi It's because Windows has crappy…

Seriously, I can't understand. I'm sure is something silly I can't see, but.............

galilea:testfb glpunzi$ ls -all /Library/Frameworks/Firebird.framework/ Versions/Current/Resources/examples/empbuild/
total 2120
drwxr-xr-x 3 firebird firebird 102 4 jun 2008 . drwxr-xr-x 10 firebird firebird 340 4 jun 2008 .. -rw-r--r-- 1 firebird firebird 1085440 2 abr 21:03 employee.fdb galilea:testfb glpunzi$

And I can open 'employee' from Flamerobin and from Lazarus without problems.

under a folder on my Documents User folder.

galilea:testfb glpunzi$ ls -all
total 1360
drwxr-xr-x 3 glpunzi staff 102 2 abr 20:48 . drwx------+ 37 glpunzi staff 1258 2 abr 21:01 .. -rw-rw---- 1 firebird firebird 696320 2 abr 20:55 test.fdb

I created this DB from isql with my user. once created, with some data (and after see I can't connect to it) I did:
sudo chown -R firebird:firebird test.fdb

And still without connection to it. From lazarus, flamerobin and isql, the same error.
From isql:
Statement failed, SQLCODE = -902
I/O error for file "test.fdb"
-Error while trying to open file
-Permission denied

from flamerobin: http://img183.imageshack.us/img183/4519/flamerobinscreensnapz00.png

If I revert the chown to:
sudo chown -R glpunzi test.fdb

Then, isql works, but still without connceting flamerobin or Lazarus.

Some idea?

Cheers.

El 02/04/2009, a las 16:54, Graeme Geldenhuys escribi?:

Show quoted text 38 lines
On Thu, Apr 2, 2009 at 4:08 PM, Giuseppe Luigi Punzi wrote: > I'm starting some projects, and I will develop them from OSX and > Windows. On windows, seems all ok, but from OSX I'm getting some > troubles thath stops me now. It's because Windows has crappy security. :-) > Now, I can't open any database from Lazarus/SQLdb nor Flamerobin, > getting an error about 'Permission Denied'. In Firebird config file (/etc/firebird/2.0/firebird.conf under Linux) you can setup what directories are allow do have database in. By default I think not all directories are allowed. It's the "DatabaseAccess" setting. Also you need to be sure about your User and Group access writes to the database file (*.fdb) itself and the write access to the directory containing the *.fdb files. > I'm missing something? Is better to install Classic Server instead > SuperServer? If so, is enough deleting Firebird.Framework directory? Your problem has nothing to do with Classic vs Super Server installs. It's a permission issue - that's all. Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20090402/e49a4e9c/attachment.html

Reply by email

Graeme Geldenhuys
to Giuseppe Luigi Punzi Ruiz

2009/4/2 Giuseppe Luigi Punzi Ruiz :

galilea:testfb glpunzi$ ls -all /Library/Frameworks/Firebird.framework/Versions/Current/Resources/examples/empbuild/

What happens if you move your database into this "examples" directory? Can you access it then?

-rw-rw---- 1 firebird firebird 696320 2 abr 20:55 test.fdb

As far as I understand, unix OS's have recursive permissions. The file might have the correct permissions, but if the directory that file lives in does not, you still can't access it.
What are the permission of each of the following directories. And who is the owner and group?

/Users/
/Users/glpunzi/
/Users/glpunzi/Documents/
/Users/glpunzi/Documents/testfb/

Also, how do you connect to the database? Via IP address or direct path (local access)?

Statement failed, SQLCODE = -902

Have you ever seen such a ridiculous error message - check the screenshot again. :-) I always laugh when I see that. Like any user will know what that means. :-)

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Giuseppe Luigi Punzi
to Graeme Geldenhuys

Hi Graeme,

Graeme Geldenhuys escribi?:

Show quoted text 9 lines
2009/4/2 Giuseppe Luigi Punzi Ruiz : > galilea:testfb glpunzi$ ls -all > /Library/Frameworks/Firebird.framework/Versions/Current/Resources/examples/empbuild/ > What happens if you move your database into this "examples" directory? Can you access it then?

I will test later at home.

Show quoted text 18 lines
> -rw-rw---- 1 firebird firebird 696320 2 abr 20:55 test.fdb > As far as I understand, unix OS's have recursive permissions. The file might have the correct permissions, but if the directory that file lives in does not, you still can't access it. What are the permission of each of the following directories. And who is the owner and group? /Users/ /Users/glpunzi/ /Users/glpunzi/Documents/ /Users/glpunzi/Documents/testfb/ Also, how do you connect to the database? Via IP address or direct path (local access)?

I don't think is necessary to change all this permissions to all folders to access. Is ridiculous.
I always accesed Interbase/Firebird v?a local path. I need to publish with an alias to try from IP true?
I will try to document me a little this morning.

Show quoted text 7 lines
> Statement failed, SQLCODE = -902 > Have you ever seen such a ridiculous error message - check the screenshot again. :-) I always laugh when I see that. Like any user will know what that means. :-)

Yeah. Is like an error message saying "Something was wrong". Ok, but what?

Cheers.

Reply by email

Graeme Geldenhuys
to Giuseppe Luigi Punzi
Giuseppe Luigi Punzi wrote
I don't think is necessary to change all this permissions to all folders to access. Is ridiculous.

Actually I think you are right. I think the only important directory is the last one that the database actually lives in.

I always accesed Interbase/Firebird v?a local path. I need to publish with an alias to try from IP true?

Type Connection string
===============================
Local "/opt/database/mydb.fdb"
Remote "192.168.0.10:/opt/database/mydb.fdb"

The remote one simply uses the following format:
<ip address>:<full path to db>

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Graeme Geldenhuys
to Giuseppe Luigi Punzi: Hi again. Probably, is not the right place to ask, and sorry for this, but I'm desperate.…
Giuseppe Luigi Punzi wrote
Now, I can't open any database from Lazarus/SQLdb nor Flamerobin, getting an error about 'Permission Denied'.

========= Quoted from excellent The Firebird Book =========== Linux/UNIX Users and Groups
-------------------------------------

From Firebird 1.5, the root user is no longer the default user that

runs the server software. This means you need to put non-root users into the firebird group to enable
them to access databases.

To add a user (for example, ?sparky?) to the firebird group, the root user needs to
enter:

   $ usermod -G firebird sparky

The next time sparky logs on, he or she can start working with Firebird databases.

To list the groups that a user belongs to, type the following at the command line:

   $ groups

TIP
----
The firebird user will also need read-write privileges to all databases and read-write-execute privileges to all directories where databases are located.
=====================================

I'm installing a new Linux server now which will run a Firebird server.... So I'll go through the motions as well and document what is required.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Graeme Geldenhuys
to Graeme Geldenhuys
Graeme Geldenhuys wrote
To add a user (for example, ?sparky?) to the firebird group, the root user needs to enter: ? $ usermod -G firebird sparky

Arg sh*t!!!!!

Remember to add the -a parameter! Otherwise you get removed from all other groups not specified.
eg:

   $ usermod -a -G firebird sparky

Anybody how I can restore my 'graemeg' user on the Ubuntu Linux server to be part of the 'sudoers' list again. I can execute anything via 'sudo' and by default the 'root' account is disable in Ubuntu. Maybe rebooting into single user mode would give me root access. Dammit!!!

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Giuseppe Luigi Punzi
to Graeme Geldenhuys: On Thu, Apr 2, 2009 at 4:08 PM, Giuseppe Luigi Punzi ========= Quoted from excellent The…

Cool,

Cool, I will try to do it at home this afternoon (I don't have MAC at my office), and I hope this is the solution.

Cheers.

P.D.: Still asking to me why I can open employee but not my databases.

Graeme Geldenhuys escribi?:

Show quoted text 52 lines
On Thu, Apr 2, 2009 at 4:08 PM, Giuseppe Luigi Punzi wrote: > Now, I can't open any database from Lazarus/SQLdb nor Flamerobin, > getting an error about 'Permission Denied'. > ========= Quoted from excellent The Firebird Book =========== Linux/UNIX Users and Groups ------------------------------------- From Firebird 1.5, the root user is no longer the default user that runs the server software. This means you need to put non-root users into the firebird group to enable them to access databases. To add a user (for example, ?sparky?) to the firebird group, the root user needs to enter: $ usermod -G firebird sparky The next time sparky logs on, he or she can start working with Firebird databases. To list the groups that a user belongs to, type the following at the command line: $ groups TIP ---- The firebird user will also need read-write privileges to all databases and read-write-execute privileges to all directories where databases are located. ===================================== I'm installing a new Linux server now which will run a Firebird server.... So I'll go through the motions as well and document what is required. Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

waldo kitty
to Graeme Geldenhuys: On Fri, Apr 3, 2009 at 12:45 PM, Graeme Geldenhuys Arg sh*t!!!!! Remember to add the -a…
Graeme Geldenhuys wrote 5 lines
Anybody how I can restore my 'graemeg' user on the Ubuntu Linux server to be part of the 'sudoers' list again. I can execute anything via 'sudo' and by default the 'root' account is disable in Ubuntu. Maybe rebooting into single user mode would give me root access. Dammit!!!

i've done that before, too... sudo to root and then go manually edit the list... i've had to do this with the groups list files, too, when they got all farkled up on me...

NOTE: NEW EMAIL ADDRESS!! _\/ (@@) Waldo Kitty, Waldo's Place USA __ooO_( )_Ooo_____________________ telnet://bbs.wpusa.dynip.com _|_____|_____|_____|_____|_____|_____ http://www.wpusa.dynip.com ____|_____|_____|_____|_____|_____|____ ftp://ftp.wpusa.dynip.com _|_Eat_SPAM_to_email_me!_YUM!__|_____ wkitty42 -at- windstream.net

Reply by email

Graeme Geldenhuys
to waldo kitty
waldo kitty wrote
i've done that before, too... sudo to root and then go manually edit the list...

See the flaw in your logic??? I lost sudo access so while logged in I couldn't execute anything that required root access, including the sudo or su command. Anyway, rebooting into single user mode drops you directly to the command prompt logged in as root. Simply adding the 'graemeg' user to the 'admin' group fixed the issue. :-) One to remember for next time. ;-)

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Giuseppe Luigi Punzi Ruiz
to Graeme Geldenhuys: On Fri, Apr 3, 2009 at 12:45 PM, Graeme Geldenhuys Arg sh*t!!!!! Remember to add the -a…

Now seems to work.

The DB needs to be firebird owner, and firebird group, and the user, in firebird group.

On mac, to add an user to the firebird group:

sudo dscl . append Groups/firebird GroupMembership glpunzi

Cheers, and thanks a lot for all.

El 03/04/2009, a las 12:54, Graeme Geldenhuys escribi?:

Show quoted text 32 lines
On Fri, Apr 3, 2009 at 12:45 PM, Graeme Geldenhuys wrote: > To add a user (for example, ?sparky?) to the firebird group, the root > user needs to > enter: > $ usermod -G firebird sparky Arg sh*t!!!!! Remember to add the -a parameter! Otherwise you get removed from all other groups not specified. eg: $ usermod -a -G firebird sparky Anybody how I can restore my 'graemeg' user on the Ubuntu Linux server to be part of the 'sudoers' list again. I can execute anything via 'sudo' and by default the 'root' account is disable in Ubuntu. Maybe rebooting into single user mode would give me root access. Dammit!!! Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Moshe Berlin
to Graeme Geldenhuys

How about this error msg from Flamerobin in Linux? Our Firebird works fine in Windows with Delphi, but we'd like to convert everything to FPC/Lazarus/Firebird in Linux ------------>>
context:database::connect
message:isc_attach_database failed

sql message: -923
can't format message 13:77 --message system code -4

engine code :335544421
engine message: connection rejected by remote interface <<------------
Made the permissions settings owner:group, but that does not help. The db is not remote, it is on the same machine as firebird server running in Linux Fedora 7. ISQL works, but access from FlameRobin and Lazarus do not work.

BTW, Graeme, fpGUI is really interesting.. Thanks!

Reply by email

Graeme Geldenhuys
to Moshe Berlin

2009/4/6 Moshe Berlin :

Show quoted text 13 lines
How about this error msg from Flamerobin in Linux? Our Firebird works fine in Windows with Delphi, but we'd like to convert everything to FPC/Lazarus/Firebird in Linux ------------>> context:database::connect message:isc_attach_database failed sql message: -923 can't format message 13:77 --message system code -4 engine code :335544421 engine message: connection rejected by remote interface <<------------

I guess you would have to Google those error codes to see if they reveal anything. Google for Interbase as well, seeing that Firebird was folked from Interbase.

What is your connection string?

Local or Remote connection style?
eg: "/opt/data/test.fdb"
or "localhost:/opt/data/test.fdb"

If the remote connection style is used, to you actually have the firebird server running as a daemon?
eg: ps aux | grep fb
You should see at least two fb????? entries in the output. I think it's fbserver and fbguard.

How does the windows machine connect to the firebird server?

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email