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 · 7 comments
Open

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

Demivan opened this issue Feb 10, 2025 · 7 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.

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