Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template parsing error dip dns ip #122

Closed
tmimura39 opened this issue Apr 10, 2021 · 1 comment
Closed

Template parsing error dip dns ip #122

tmimura39 opened this issue Apr 10, 2021 · 1 comment

Comments

@tmimura39
Copy link
Contributor

Describe the bug
The following error occurred in https://github.com/bibendi/dip/releases/tag/v7.0.0.

$ dip --version
7.0.0

$ dip dns ip
Template parsing error: template: :1: unexpected unclosed action in command
ERROR: Command 'docker inspect --format {{ .NetworkSettings.Networks.frontend.IPAddress }} dnsdock' executed with error.

Therefore, DIP_DNS is not set and requests between containers will not work.

To Reproduce
Steps to reproduce the behavior:

$ docker network ls
NETWORK ID     NAME      DRIVER    SCOPE
a51e8bb8a1a5   bridge    bridge    local
ea175032c0fb   host      host      local
f3e5cf88a3a5   none      null      local

$ docker container ls -a
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES

$ dip dns up
e40f1db441cad1383d8a1b8b65e46d137c2578588c7407772f9de186839e36e6
9f30d003f9df0cf2af4b4ac3476c3677a23fffd131d6054f3ba2906cff096056

$ docker network ls
NETWORK ID     NAME       DRIVER    SCOPE
a51e8bb8a1a5   bridge     bridge    local
e40f1db441ca   frontend   bridge    local
ea175032c0fb   host       host      local
f3e5cf88a3a5   none       null      local

$ docker container ls -a
CONTAINER ID   IMAGE                           COMMAND                  CREATED          STATUS          PORTS                   NAMES
9f30d003f9df   aacebedo/dnsdock:latest-amd64   "dnsdock --domain=do…"   26 minutes ago   Up 26 minutes   0.0.0.0:56519->53/udp   dnsdock

$ docker network inspect frontend
[
    {
        "Name": "frontend",
        "Id": "e40f1db441cad1383d8a1b8b65e46d137c2578588c7407772f9de186839e36e6",
        "Created": "2021-04-10T02:38:13.757056728Z",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": {},
            "Config": [
                {
                    "Subnet": "172.20.0.0/16",
                    "Gateway": "172.20.0.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "9f30d003f9df0cf2af4b4ac3476c3677a23fffd131d6054f3ba2906cff096056": {
                "Name": "dnsdock",
                "EndpointID": "9da2d80f6e762104d27086eb31270f25ddedc710ac5f4c4cb3d500ed24216947",
                "MacAddress": "02:42:ac:14:00:02",
                "IPv4Address": "172.20.0.2/16",
                "IPv6Address": ""
            }
        },
        "Options": {},
        "Labels": {}
    }
]

$ dip --version
7.0.0

$ dip dns ip
Template parsing error: template: :1: unexpected unclosed action in command
ERROR: Command 'docker inspect --format {{ .NetworkSettings.Networks.frontend.IPAddress }} dnsdock' executed with error.

Expected behavior

No error in v6.1.0.

$ dip --version
6.1.0

$ dip dns ip
172.20.0.2

Context:

$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.15.7
BuildVersion:	19H524

$ docker -v
Docker version 20.10.5, build 55c4c88

$ dip --version
7.0.0

$ bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin19)
Copyright (C) 2007 Free Software Foundation, Inc.

Additional context

I think this commit is the cause.
71baf4e

$ docker inspect --format {{ .NetworkSettings.Networks.frontend.IPAddress }} dnsdock
Template parsing error: template: :1: unexpected unclosed action in command

$ docker inspect --format '{{ .NetworkSettings.Networks.frontend.IPAddress }}' dnsdock
172.20.0.2

$ ruby -v
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin19]

$ ruby -e "::Kernel.system({}, 'docker', 'inspect', '--format', '{{ .NetworkSettings.Networks.frontend.IPAddress }}', 'dnsdock')"
172.20.0.2

$ ruby -e "::Kernel.system({}, 'docker inspect --format {{ .NetworkSettings.Networks.frontend.IPAddress }} dnsdock')"
Template parsing error: template: :1: unexpected unclosed action in command
@bibendi
Copy link
Owner

bibendi commented Apr 12, 2021

Hi,
Thank you for reporting the bug!
Fixed at 7.0.1

@bibendi bibendi closed this as completed Apr 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants