1

I have a dockerized rails 4.2 app. I also installed a firebird 3 on my local Ubuntu machine. Now, when I start my docker container and want to start developing I always get this error:

ActiveRecord::ConnectionNotEstablished
No Firebird connections established.

This is my docker run command:

docker run --rm -itP --name dev-cont --network host -v $(pwd):/data -e NO_RAKE_TASK=1 image_name

This is my database.yml

development:
  adapter: fb
  database: /var/lib/firebird/3.0/data/FELIX.FDB
  username: sysdba
  password: x
  host: localhost
  encoding: UTF-8
  charset: UTF-8
  #  create: true

I can connect to the database with my DB Admin tool (DBeaver), where the configuration looks exactly the same.

To see if the port is available in the container I installed nmap and checked if the port is open, which seems to be.

What am I missing here?

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Shimu
  • 1,137
  • 11
  • 25
  • How are you trying to connect to the db? If you use "localhost" you will have to change that to the IP of your host. – Mihai May 10 '19 at 05:22
  • You need to change your host from database.yml – shrikant1712 May 10 '19 at 05:23
  • I am using localhot, but because i am using the `--network host` run parameter it should be able to find localhost as well, shouldn't it? – Shimu May 10 '19 at 05:24
  • I changed the host to my IP address now and it didn't change anything :-/ – Shimu May 10 '19 at 05:32
  • Related: https://stackoverflow.com/questions/24319662/from-inside-of-a-docker-container-how-do-i-connect-to-the-localhost-of-the-mach – Mark Rotteveel May 10 '19 at 07:29
  • @MarkRotteveel I already tried everything mention by Thomasleveil in this thread. Neither bridge mode nor host mode seems to work... – Shimu May 10 '19 at 16:36
  • That is why I didn't vote as a duplicate, but maybe you hadn't checked everything in that question, and linking the question might help others in the future. I don't normally use Linux, but maybe you should look if commenting out or changing the `RemoteBindAddress` setting in the `firebird.conf`, or tweaking your xinetd config helps. Possibly if it is bound on 127.0.0.1 only, the docker image might not actually be able to connect (I'm not sure how docker handles this). – Mark Rotteveel May 10 '19 at 17:37
  • I ended up putting the firebird in a container as well and using docker-compose. This is working fine so far. – Shimu May 14 '19 at 08:29

0 Answers0