debug-log doesn't work with lxc provider

Bug #1202682 reported by Andreas Hasenack
86
This bug affects 18 people
Affects Status Importance Assigned to Milestone
juju-core
Fix Released
High
Tim Penhey

Bug Description

andreas@nsn7:~$ juju debug-log -v
2013-07-18 13:38:27 INFO juju.environs.local environprovider.go:32 opening environment "local"
2013-07-18 13:38:27 INFO juju open.go:69 state: opening state; mongo addresses: ["10.0.3.1:37017"]; entity ""
2013-07-18 13:38:27 INFO juju open.go:107 state: connection established
2013-07-18 13:38:27 INFO juju ssh.go:79 looking up address for machine 0...
Warning: Permanently added '10.0.3.1' (ECDSA) to the list of known hosts.
Permission denied (publickey).
2013-07-18 13:38:27 ERROR juju supercommand.go:235 command failed: exit status 255
error: exit status 255
andreas@nsn7:~$

It probably shouldn't even try to ssh, and instead grab the log file(s) directly.

Related branches

Stuart Bishop (stub)
Changed in juju-core:
status: New → Confirmed
Revision history for this message
Matthew Williams (mattyw) wrote :

This looks similar to a bug I'm getting trying to "juju ssh" into a unit deployed using the lxc provider. Is it likely to be the same root cause?

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 1202682] Re: debug-log doesn't work with lxc provider

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2013-09-05 16:44, Matthew Williams wrote:
> This looks similar to a bug I'm getting trying to "juju ssh" into a
> unit deployed using the lxc provider. Is it likely to be the same
> root cause?
>

I would expect if 'juju ssh' doesn't work with the local provider,
then definitely "juju debug-log" won't work, since it goes via "juju ssh".

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlIsNSwACgkQJdeBCYSNAAN12gCgjNQtEwzTsyeUvjh4sN/Qb3Y1
gwMAn12BHGmQdkY4YSqe/ks/Gd8uR1yg
=LECa
-----END PGP SIGNATURE-----

Jonathan Davies (jpds)
tags: added: cts
Curtis Hovey (sinzui)
Changed in juju-core:
status: Confirmed → Triaged
importance: Undecided → High
Revision history for this message
Curtis Hovey (sinzui) wrote :

This looks very similar to the errors I see testing on lxc and canonistack. My quick fix was to remove all the 10.0.3.* from my known hosts. This isn't a true juju problem, it is an ssh issue that is obfuscated by juju. We are accepting the keys to all the machines we create, but do not remove them when the machine is destroyed. Juju could suggest that known_hosts may have a key from a previous machine registered machine and that can be addressed by adding
    ssh-keygen -R 10.0.3.1

tags: added: ui
tags: added: papercut
Curtis Hovey (sinzui)
tags: added: debug-log ssh
tags: added: local-provider
Curtis Hovey (sinzui)
tags: added: cts-cloud-review
removed: cts
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: none → 2.0
Revision history for this message
Adam Stokes (adam-stokes) wrote :

Even removing the offending ip in known_hosts the problem persists:

~ » ssh-keygen -R 10.0.3.1 adam@beatnuts
/home/adam/.ssh/known_hosts updated.
Original contents retained as /home/adam/.ssh/known_hosts.old
------------------------------------------------------------
~ » sudo juju debug-log adam@beatnuts
[sudo] password for adam:
ssh: connect to host 10.0.3.1 port 22: Connection refused
ERROR exit status 255
------------------------------------------------------------
~ » sudo juju status adam@beatnuts
environment: local
machines:
  "0":
    agent-state: started
    agent-version: 1.16.0.1
    dns-name: 10.0.3.1
    instance-id: localhost
    series: saucy
  "1":
    agent-state: started
    agent-version: 1.16.0.1
    instance-id: adam-local-machine-1
    series: precise
services:
  joomla:
    charm: cs:precise/joomla-1
    exposed: false
    units:
      joomla/0:
        agent-state: pending
        agent-version: 1.16.0.1
        machine: "1"
        public-address: 10.0.3.152

 Running juju-core 1.16.0-0ubuntu1 on saucy amd64

Revision history for this message
Marco Ceppi (marcoceppi) wrote :

As a work around, you will find all the log files that debug-log scans in ~/.juju/local/log where "local" is the name of your bootstrapped local environment. To duplicate debug-log in some sense, you could `tail -f ~/.juju/local/logs/unit-*.log` which will follow all the unit logs for your deployment.

Curtis Hovey (sinzui)
Changed in juju-core:
assignee: nobody → Frank Mueller (themue)
Frank Mueller (themue)
Changed in juju-core:
status: Triaged → In Progress
Revision history for this message
Frank Mueller (themue) wrote :

Latest information: debug-log will get an own API command instead of using ssh and tail. The CLI command will then use that API command.

The ssh addressing issue with the local provider is an own issue and already in the backlog.

Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 2.0 → 1.18.0
Changed in juju-core:
assignee: Frank Mueller (themue) → nobody
assignee: nobody → Dimiter Naydenov (dimitern)
Changed in juju-core:
status: In Progress → Triaged
assignee: Dimiter Naydenov (dimitern) → nobody
Tim Penhey (thumper)
Changed in juju-core:
assignee: nobody → Tim Penhey (thumper)
status: Triaged → In Progress
Revision history for this message
Adam Stokes (adam-stokes) wrote :

Should note also if you run debug-log against a local provider using kvm it will also fail with a publickey denied ssh error. Just fyi as it looks like it'll be interfacing with the api going forward.

Tim Penhey (thumper)
Changed in juju-core:
status: In Progress → Fix Committed
milestone: 1.20.0 → 1.19.0
Curtis Hovey (sinzui)
Changed in juju-core:
status: Fix Committed → Fix Released
Revision history for this message
Matt Rae (mattrae) wrote :

i was trying juju debug-log using the local provider with the latest juju fixing lp:1202682. so far i'm only seeing what looks like the machine agent/api logs, and not unit agent logs.. if i check under /var/log/syslog i can see the unit logs being logged there.

For example, generally i'd see output from 'apt-get' in the debug-log output. Now juju debug-log --replay | grep apt-get shows nothing. Tailing /var/log/syslog shows the unit log as normal. Is this expected?

tags: added: landscape
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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