jira-cli icon indicating copy to clipboard operation
jira-cli copied to clipboard

[MacOS] When having custom resolver configuration inside /etc/resolver/<domain> that was added by a vpn configuration, cli cannot resolve the address and connect to jira instance

Open rymek opened this issue 1 year ago • 6 comments

Describe the bug I'm using openconnect with vpn-slice configured for split-horizon DNS resolvers (ie - domains inside vpn are configured to use specific dns settings via added domain configs to /etc/resolver/<domain name>). When trying to resolve such domain (a jira instance) the setup fails with an error. When DNS is set globally to use the vpn DNS, everything works fine.

Please provide following details

  1. JiraCLI Version: (Version="1.1.0", GitCommit="3b93e147eac468ad985bdece27469153b4bb2814", CommitDate="2022-08-14T08:10:40+00:00", GoVersion="go1.18.3", Compiler="gc", Platform="darwin/arm64")

  2. Are you using Jira cloud or on-premise jira server? Also mention the version for on-premise installation. on premise, don't think the version is needed here :)

  3. What operating system are you using? Also mention version. macOS Monterey 12.5.1

  4. What terminal are you using? Also mention version. iterm2 Build 3.5.0beta6

To Reproduce

Steps to reproduce the behavior:

  1. Create domain configuration in /etc/resolver/<domain> - the domain cannot be accessible while using your usual DNS configuration otherwise it will just resolve the domain correctly
  2. Execute jira-init and try to setup jira instance that's only resolvable by dns configured in step 1
  3. See error:
? Installation type: Local
? Link to Jira server: // secret //
? Login username: // secret //

✗ Unable to generate configuration: dial tcp: lookup // secret // on // secret //: no such host

Expected behavior Configuration ended successfully

Screenshots image

Additional context I'm using openconnect with vpn-slice, but I think this can be reproduced by just adding a DNS configuration for a domain manually. When I set the DNS that sees the jira instance for the whole system (globally), everything works fine. The problem is only with custom resolver configuration.

rymek avatar Aug 23 '22 06:08 rymek

@rymek looks like you need a way to set custom DNS resolver. Just wondering if it will work if the tool allow you to set a resolver IP (and protocol) for communication with the Jira API?

ankitpokhrel avatar Sep 11 '22 08:09 ankitpokhrel

i think this might be a bug in some go library you're using. This is a os feature that you can add a resolver for a specific domain to resolver dir. Every other app I'm using on the system is working correctly. I'm suspecting w bug in this dial library but haven't got time to look though it yet and I don't really know go so it's kinda more difficult for me 🙂

rymek avatar Sep 11 '22 10:09 rymek

This indeed seem to be an issue in the standard go library https://github.com/golang/go/issues/12524 and will wait for the upstream fix.

As a workaround suggested in the comments, you can try compiling locally with cgo.

CGO_ENABLED=1 GOARCH=arm64 go build

ankitpokhrel avatar Sep 15 '22 17:09 ankitpokhrel