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

Bug: DNS is not being resolved in env.url #3372

Open
Demivan opened this issue Feb 10, 2025 · 10 comments
Open

Bug: DNS is not being resolved in env.url #3372

Demivan opened this issue Feb 10, 2025 · 10 comments
Assignees
Labels

Comments

@Demivan
Copy link

Demivan commented Feb 10, 2025

When using connection string in a format:

sqlserver://<user>:<pass>@<Hostname>:1433?...

I get an error:

Error: mssql: query server property: lookup <Hostname>: no such host

It does work when using IP of the server.

@giautm
Copy link
Member

giautm commented Feb 10, 2025

Are you sure the IP is correct, and was able to connect from your machine? Does sqlcmd command work?

@Demivan
Copy link
Author

Demivan commented Feb 10, 2025

sqlcmd -S <Hostname> -P <pass> -U <user> this worked for connecting to the database.

Actually, atlas migrate status works too, but not atlas schema diff --from='env://url' --to='env://migration.dir' for example.

@giautm
Copy link
Member

giautm commented Feb 10, 2025

aha, you put the URL in the atlas.hcl file?

@Demivan
Copy link
Author

Demivan commented Feb 10, 2025

Yes, loaded it from .env file. Just to double-check, I have hardcoded it too - same result.

When explicitly specifying the URL in a --from parameters - same result.

@giautm
Copy link
Member

giautm commented Feb 10, 2025

It's a bit weird, we used the same lib as sqlcmd, also used Go there.

There is no reason that sqlcmd works but atlas doesn't. :-/

@giautm giautm self-assigned this Feb 10, 2025
@giautm giautm added the MSSQL label Feb 10, 2025
@giautm
Copy link
Member

giautm commented Feb 10, 2025

What's the OS you run atlas-cli there? And the domain is private or public access?

@Demivan
Copy link
Author

Demivan commented Feb 10, 2025

I'm using Linux (NixOS), domain is private.

@giautm
Copy link
Member

giautm commented Feb 20, 2025

Hello @Demivan Have you find the reason for this? Do you still need help from us?

@Demivan
Copy link
Author

Demivan commented Feb 20, 2025

Hi.
I assume it is a bug in Atlas. Because atlas migrate status works and atlas schema diff does not. I can still reproduce it in the latest version.
I have checked what I can on my side, and DNS resolution works on my machine with other tools (ping, dig, etc.) And Atlas can resolve DNS too as migrate command works, so it is something internal.
For now, I have hardcoded IP instead of using a hostname.

@giautm
Copy link
Member

giautm commented Feb 21, 2025

Hi. I assume it is a bug in Atlas. Because atlas migrate status works and atlas schema diff does not. I can still reproduce it in the latest version. I have checked what I can on my side, and DNS resolution works on my machine with other tools (ping, dig, etc.) And Atlas can resolve DNS too as migrate command works, so it is something internal. For now, I have hardcoded IP instead of using a hostname.

It's quite weird, can you please share the full command including the atlas.hcl you have? please ping @giautm on Atlas' discord if you want to share in private, also more easy for me to asking more information there.

or, of course, contact us via our Intercom.

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

No branches or pull requests

2 participants