Skip to content
This repository has been archived by the owner on Apr 9, 2020. It is now read-only.

Container can't use the azk DNS #648

Open
ReeSilva opened this issue Apr 3, 2016 · 5 comments
Open

Container can't use the azk DNS #648

ReeSilva opened this issue Apr 3, 2016 · 5 comments

Comments

@ReeSilva
Copy link

ReeSilva commented Apr 3, 2016

When I try to connect a dependent container to the container that it depends, it can't using the net.host, it fails. If I try with the IP of container it works, and also works with the IP of host.

Reproduce:
a. Clone the azkdemo project
b. Follow the steps to connect with Redis
c. Try restart

Output

captura de tela de 2016-04-03 15-28-33

Info
a. Fedora 23
b. Not using VirtualBox
c.

/**
 * Documentation: http://docs.azk.io/Azkfile.js
 */
// Adds the systems that shape your system
systems({
  azkdemo: {
    // Dependent systems
    depends: ["redis"],
    // More images:  http://images.azk.io
    image: {"docker": "azukiapp/node"},
    // Steps to execute before running instances
    provision: [
      "npm install",
    ],
    workdir: "/azk/#{manifest.dir}",
    shell: "/bin/bash",
    command: ["npm", "start"],
    wait: 20,
    mounts: {
      '/azk/#{manifest.dir}': sync("."),
      '/azk/#{manifest.dir}/node_modules': persistent("./node_modules"),
    },
    scalable: {"default": 1},
    http: {
      domains: [ "#{system.name}.#{azk.default_domain}" ]
    },
    ports: {
      // exports global variables
      http: "3000/tcp",
    },
    envs: {
      // Make sure that the PORT value is the same as the one
      // in ports/http below, and that it's also the same
      // if you're setting it in a .env file
      NODE_ENV: "dev",
      PORT: "3000",
    },
  },
  redis: {
    image: {docker: "redis"},
    export_envs: {
      "DATABASE_URL": "redis://#{net.host}:#{net.port[6379]}",
    },
  },
});
@ReeSilva
Copy link
Author

ReeSilva commented May 2, 2016

Hey guys, nothing about it?

@gullitmiranda
Copy link
Member

hi @ReeSilva. this can be a problem with the dns resolver or redis connection.

  • redis connection: are you using the env DATABASE_URL in your application?
  • dns resolver:
    run this command:
$ azk agent start
$ dig dev.azk.io

@ReeSilva
Copy link
Author

ReeSilva commented May 3, 2016

@gullitmiranda Hey guy, thanks for ur answer. Yeah, I'm using the DATABASE_URL, the application that I use to describe the error was the azkdemo application.
When I dig both from host and other containers the result is the same. But, when I telnet the port of the redis container (in that run, 32770), it fails on container but works on host (as you can see on the image above)
captura de tela de 2016-05-03 16-33-26

@gullitmiranda
Copy link
Member

so the problem is in dns-resolver.
you could send this message in the chat (https://gitter.im/azukiapp/azk) so that we can have an more quickly interaction?

@ReeSilva
Copy link
Author

ReeSilva commented May 3, 2016

Sure, I'll do that

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants