Search code examples
dockerfirebirdisql

Can't connect to a firebird server on docker


I'm a macOS user and I got weird errors just to create a database with firebird. I saw that there are some dock containers with firebird that run just fine ( i was able to create databases, perform queries and so on) but when I tried to connect from my local ISQL or razorSQL client ( through JDBC), I get some weird errors like "unavailable database" or "can't open file"

I'm also not sure how ISQL CONNECT string really works because every site I saw there is a different one.

I got this docker image: ( https://hub.docker.com/r/jacobalberty/firebird/)

I created my container like this:

docker run -d --name firebird -p 3050:3050 -v /data/firebird/databases:/databases jacobalberty/firebird:2.5-ss

my docker-machine IP is:

192.168.99.100

I tried to connect like this:

CONNECT '0.0.0.0:3050://databases/test.fdb' user 'SYSDBA' password 'masterkey';
unavailable database

And also like this:

CONNECT '192.168.99.100:/databases/test.fdb' user 'SYSDBA' password 'masterkey';
connection rejected by remote interface


CONNECT '192.168.99.100:3050:/databases/test.fdb' user 'SYSDBA' password 'masterkey';
 Statement failed, SQLSTATE = 08001
 unavailable database

When i enter the docker container, the file is there:

root@e4212b9f9d16:/databases# pwd
/databases
root@e4212b9f9d16:/databases# ls
test.fdb

Also, I'm not sure how to check if the firebird server is running ( i guess it is cause I can 'connect' to a database inside the container'.. but the docker container is definally up and running - did a successful telnet on the ip and port)

I also tried to use the container IP (172.17.0.2) but i got a timeout

Im most familiar with mysql and SQLite never touched a firebird db before and as the user got this DB, i have to mock it, develop an app using fake data and then connect it to the real firebird (so changing the DB is not an option)


Solution

  • So, the standard documentation about 'create your firebird server' don't mention but you on firebird.conf, the variable RemoteBindAddress must be empty

    File:

    /etc/firebird/2.5/firebird.conf
    

    Lines changed:

    RemoteBindAddress =
    #RemoteBindAddress = localhost
    

    Thanks for all the