3

Many Drush commands are reporting this error once or more:

hostname: Name or service not known

The commands seem to run fine, though.

This is Drupal 7 running on a local development environment on OpenSUSE 13.1. The status reported by Drush is the following one. (I have edited out username and password.)

Drupal version: 7.34
Site URI: http://default
Database driver: mysql
Database username:
Database name:
Database: Connected
Drupal bootstrap: Successful
Drupal user: Anonymous
Default theme: zen
Administration theme: seven
PHP executable: /usr/bin/php
PHP configuration: /etc/php5/cli/php.ini
PHP OS: Linux
Drush version: 6.2.0
Drush configuration:
Drush alias files:
Drupal root: /srv/www/htdocs
Site path: sites/default
File directory path: sites/default/files
Private file directory path: ../files/private
Temporary file directory path: /tmp

Running "drush up --debug" shows the error message:

Cache MISS cid: 6.2.0-alias-path--c4cc2b4982c6401ca3d49ce3d0e075b4
hostname: Name or service not known

How can I fix this error message?

4

Drush calls the hostname program to determine if a given fqdn for a remote site alias is actually the localhost. There appear be other incidental uses for this program, since it is called when you run drush status.

If your system is saying 'name or service unknown', it means that you networking is not completely configured on the host server. This isn't a Drupal/Drush issue, but see:

http://www.linuxquestions.org/questions/linux-networking-3/ssh-name-or-service-not-known-479307/

If that does not solve your problems, try asking in a SuSe forum.

  • I can run hostname from the cli. Also, I do not receive the error when calling 'drush status'. Is there not an issue with the debug message saying "cache-MISS", as opposed to "cache-HIT" on other similar lines? – John Dec 15 '14 at 17:59
  • Got it... I did not have an FQDN set for the machine's IP, but for 127.0.0.1. Setting it in /etc/hosts fixed it. Thank you. – John Dec 15 '14 at 18:42
2

I fixed this issue by updating both /etc/hosts and /etc/hostname. In other words, I ensured that the content of /etc/hosts matched what returned by /etc/hostname.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.