Raised https://github.com/drone/drone/issues/2362 earlier which describes the problem.
drone exec is not consistent with the following drone.yml
pipeline: ping: image: postgres commands: - sleep 10 - psql -U postgres -d test -h database -c "SELECT * FROM pg_catalog.pg_tables;" services: database: image: postgres environment: - POSTGRES_USER=postgres - POSTGRES_DB=test
Sometimes succeeds but most of the time it fails with the following error
[ping:L15:10s] psql: could not translate host name "database" to address: Name or service not known
To trigger a success I need to change the service name from ‘database’ to something else and then it succeeds for the next run or for a couple of runs then it goes back to the above error. Very annoying.