cmd/juju: juju ssh $SERVICE tries to work

Bug #1313862 reported by Dave Cheney
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Expired
Medium
Unassigned
juju-core
Won't Fix
Medium
Unassigned

Bug Description

Juju ssh supports two modes

juju ssh $MACHINE
juju ssh $SERVICE/$UNIT

However if you forget the $UNIT, you get this confusing message

lucky(~/src/launchpad.net/juju-core/repostory/trusty/juju-development/hooks) % juju deploy mysql
Added charm "cs:precise/mysql-42" to the environment.
lucky(~/src/launchpad.net/juju-core/repostory/trusty/juju-development/hooks) % juju status mysql
environment: us-east-1
machines:
  "9":
    agent-state: pending
    instance-id: i-063bf656
    instance-state: pending
    series: precise
    hardware: arch=amd64 cpu-cores=1 cpu-power=100 mem=1740M root-disk=8192M
services:
  mysql:
    charm: cs:precise/mysql-42
    exposed: false
    relations:
      cluster:
      - mysql
    units:
      mysql/0:
        agent-state: pending
        machine: "9"
lucky(~/src/launchpad.net/juju-core/repostory/trusty/juju-development/hooks) % juju ssh mysql
nc: getaddrinfo: Name or service not known
ERROR subprocess encountered error code 1
ssh_exchange_identification: Connection closed by remote host
ERROR subprocess encountered error code 255

John A Meinel (jameinel)
Changed in juju-core:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Jimmie Butler (jimmiebtlr) wrote :

It assumes that if it's not a machine or a unit, then it must be a hostname. It seems mysql would be a valid hostname.

Would the best approach be to wait until the hostname resolution has failed and output an error message with some suggestions?

Curtis Hovey (sinzui)
Changed in juju-core:
importance: High → Medium
Revision history for this message
Anastasia (anastasia-macmood) wrote :

Re-targeting for Juju 2.x

From Menno:
The command is trying the application (aka service) name as a hostname because it doesn't support application names. Consequently, it fails with the "Name or service not known" error.

It may be enough to improve the error to give a little more detail.

Changed in juju:
status: New → Triaged
importance: Undecided → Medium
milestone: none → 2.1.0
Changed in juju-core:
status: Triaged → Won't Fix
Curtis Hovey (sinzui)
Changed in juju:
milestone: 2.1-rc2 → none
Revision history for this message
Canonical Juju QA Bot (juju-qa-bot) wrote :

This bug has not been updated in 5 years, so we're marking it Expired. If you believe this is incorrect, please update the status.

Changed in juju:
status: Triaged → Expired
tags: added: expirebugs-bot
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.