[solved] Hostname Resolution Failure for Services

[EDIT] I tried reinstalling drone, and for some reason it fixed the issue. Not quite sure why.

I reported a bug at Drone Github’s issues, but it was closed without even a chance for them to read or me
giving more info: https://github.com/drone/drone/issues/2340

What @bradrydzewski suggests in the answer is indeed something I’ve tried several times, and the bug persists.

It’s not that I cannot connect to the postgres database. It’s that it’s DNS name is not exported correctly by drone. If I take the minimal example that @Brad points me to, I end up with an error when running drone exec:

[ping:L1:9s] + psql -U postgres -d test -h database \n  -c "SELECT * FROM pg_catalog.pg_tables;"
[ping:L3:10s] psql: could not translate host name "database" to address: Name or service not known
[ping] exit code 2

If I stick a sleep 10000 just before the psql command in the example, and drop a shell in the ping container, its /etc/hosts just does not contain a reference to database, as I said in my github initial issue / bug report.

Also, @bradrydzewski, I would recommend that the minimal piece of code you pointed me to is amended to include a postgres:9.5 or postgres:9.6 semver specifier, as who knows if it won’t break in 9.7, making the minimal example fail.

Do any of you guys suffer from this issue too please?

We close and redirect end-user support questions to our discourse forum per our issue template. We try to limit our issue tracker to confirmed bugs and feature requests.

[EDIT] I tried reinstalling drone, and for some reason it fixed the issue. Not quite sure why.

Hostnames are supported by version 0.7 and higher. I can tell, based on the format of your output, that you were using an outdated version of the CLI. It is likely that upgrading solved the problem because you downloaded and installed a newer version with hostname support.