local hostname is invalid when $USER is not set

Bug #1274780 reported by Curtis Hovey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
juju-core
Fix Released
Low
Andrew Wilkins

Bug Description

juju local deploy no longer works with the wordpress charm. The agent errors. The issue first appears with r2264, though might be older. The wordpress charm has not changed, and there is no issue deploying it to canonistack or aws. The all-machines.log found at
    http://162.213.35.54:8080/job/local-deploy/780/
doesn't say what exactly went wrong.

Related branches

Revision history for this message
Curtis Hovey (sinzui) wrote :
Download full text (4.2 KiB)

I tailed the mysql unit log as it was being installed.

fatal: file /etc/postfix/main.cf: parameter myhostname: bad parameter value: -local-machine-1

2014-01-31 02:40:06 INFO install Setting up postfix (2.9.6-1~12.04.1) ...
2014-01-31 02:40:07 INFO install Adding group `postfix' (GID 113) ...
2014-01-31 02:40:07 INFO install Done.
2014-01-31 02:40:07 INFO install Adding system user `postfix' (UID 106) ...
2014-01-31 02:40:07 INFO install Adding new user `postfix' (UID 106) with group `postfix' ...
2014-01-31 02:40:08 INFO install Not creating home directory `/var/spool/postfix'.
2014-01-31 02:40:08 INFO install Creating /etc/postfix/dynamicmaps.cf
2014-01-31 02:40:08 INFO install Adding tcp map entry to /etc/postfix/dynamicmaps.cf
2014-01-31 02:40:08 INFO install Adding sqlite map entry to /etc/postfix/dynamicmaps.cf
2014-01-31 02:40:08 INFO install Adding group `postdrop' (GID 114) ...
2014-01-31 02:40:08 INFO install Done.
2014-01-31 02:40:08 INFO install setting myhostname: -local-machine-1
2014-01-31 02:40:08 INFO install setting alias maps
2014-01-31 02:40:08 INFO install setting alias database
2014-01-31 02:40:08 INFO install mailname is not a fully qualified domain name. Not changing /etc/mailname.
2014-01-31 02:40:08 INFO install setting destinations: localdomain, localhost, localhost.localdomain, localhost
2014-01-31 02:40:08 INFO install setting relayhost:
2014-01-31 02:40:08 INFO install setting mynetworks: 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
2014-01-31 02:40:08 INFO install setting mailbox_size_limit: 0
2014-01-31 02:40:08 INFO install setting recipient_delimiter: +
2014-01-31 02:40:08 INFO install setting inet_interfaces: all
2014-01-31 02:40:10 INFO install /etc/aliases does not exist, creating it.
2014-01-31 02:40:10 INFO install WARNING: /etc/aliases exists, but does not have a root alias.
2014-01-31 02:40:10 INFO install
2014-01-31 02:40:10 INFO install Postfix is now set up with a default configuration. If you need to make
2014-01-31 02:40:10 INFO install changes, edit
2014-01-31 02:40:10 INFO install /etc/postfix/main.cf (and others) as needed. To view Postfix configuration
2014-01-31 02:40:10 INFO install values, see postconf(1).
2014-01-31 02:40:10 INFO install
2014-01-31 02:40:10 INFO install After modifying main.cf, be sure to run '/etc/init.d/postfix reload'.
2014-01-31 02:40:10 INFO install
2014-01-31 02:40:10 INFO install Running newaliases
2014-01-31 02:40:10 INFO install newaliases: warning: valid_hostname: misplaced hyphen: -local-machine-1
2014-01-31 02:40:10 INFO install newaliases: fatal: file /etc/postfix/main.cf: parameter myhostname: bad parameter value: -local-machine-1
2014-01-31 02:40:10 INFO install dpkg: error processing postfix (--configure):
2014-01-31 02:40:10 INFO install subprocess installed post-installation script returned error exit status 75
2014-01-31 02:40:10 INFO install dpkg: dependency problems prevent configuration of mailutils:
2014-01-31 02:40:10 INFO install mailutils depends on default-mta | mail-transport-agent; however:
2014-01-31 02:40:10 INFO install Package default-mta is not installed.
2014-01-31 02:40:10 INFO install Package postfix which provides defaul...

Read more...

Revision history for this message
Tim Penhey (thumper) wrote :

It seems that postfix is being overly restrictive:

From wikipedia:

The Internet standards (Request for Comments) for protocols mandate that component hostname labels may contain only the ASCII letters 'a' through 'z' (in a case-insensitive manner), the digits '0' through '9', and the hyphen ('-'). The original specification of hostnames in RFC 952, mandated that labels could not start with a digit or with a hyphen, and must not end with a hyphen. However, a subsequent specification (RFC 1123) permitted hostname labels to start with digits. No other symbols, punctuation characters, or white space are permitted.

Revision history for this message
Curtis Hovey (sinzui) wrote :

The leading dash was the problem. That was caused by the env missing a user when sudo was used to pass the env and bootstrap, jenkins-local-machine-1 was the name of the unit. Now that sudo is not required, USER must be passed to juju on bootstrap. For many users this is not an issue. CI sees this because the test env is sparce compared to the common bash env.

Revision history for this message
Curtis Hovey (sinzui) wrote :

I updated the local test scripts to export USER=jenkins. The tests now pass.

Curtis Hovey (sinzui)
summary: - Wordpress charm no longer works with local deploy.
+ local hostname is invalid when $USER is not set
Changed in juju-core:
importance: High → Low
Andrew Wilkins (axwalk)
Changed in juju-core:
status: Triaged → In Progress
assignee: nobody → Andrew Wilkins (axwalk)
milestone: none → 1.18.0
Andrew Wilkins (axwalk)
Changed in juju-core:
status: In Progress → Fix Committed
milestone: 1.18.0 → 1.17.3
Curtis Hovey (sinzui)
Changed in juju-core:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.