"internal error character device (null) is not using a PTY" when using virsh console

Bug #807091 reported by Tom Ellis
48
This bug affects 6 people
Affects Status Importance Assigned to Milestone
nova (Ubuntu)
Invalid
Low
Unassigned

Bug Description

After setting up nova and launching an instance, I can't ssh to it and running virsh console shows:

Connected to domain instance-0000000f
Escape character is ^]
error: internal error character device (null) is not using a PTY

Instance is an oneiric tarball:
http://uec-images.ubuntu.com/releases/oneiric/alpha-2a/oneiric-server-uec-amd64.tar.gz

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: nova-compute 2011.2-0ubuntu1
ProcVersionSignature: Ubuntu 2.6.38-8.42-server 2.6.38.2
Uname: Linux 2.6.38-8-server x86_64
Architecture: amd64
Date: Thu Jul 7 12:23:38 2011
PackageArchitecture: all
ProcEnviron:
 LANGUAGE=en_US:
 LANG=en_US
 SHELL=/bin/bash
SourcePackage: nova
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Tom Ellis (tellis) wrote :
Revision history for this message
Tom Ellis (tellis) wrote :

After overcoming some network configuration issues, I can now launch instances and ssh to them.

Virsh console still shows this PTY error message though. I noticed the same thing on the lxc console.

Revision history for this message
Thierry Carrez (ttx) wrote :

I wonder if it's an issue with Nova (for example, does eucalyptus succeed in the same situation), with libvirt, or with the Ubuntu cloud images...

summary: - error: internal error character device (null) is not using a PTY
+ "internal error character device (null) is not using a PTY" when using
+ virsh console
Revision history for this message
Chuck Short (zulcss) wrote :

Tom,

Is this still a problem for you?

Regards
chuck

Changed in nova (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Matt Thompson (mattt416) wrote :

Hi All,

I was able to replicate this running --libvirt_type=qemu, and see similar "virsh dumpxml" output as reported in https://www.redhat.com/archives/libvir-list/2009-July/msg00460.html. If I move the <serial type='pty'> tag above <serial type="file"> in libvirt.xml (despite libvirt.xml stating that the order should be "file" first), I can connect to console but cannot see console output using using "euca-get-console-output". Previously, I couldn't connect to console, but could see console output.

Interestingly, but as an aside, when using --libvirt_type=uml, I by default can connect to the console but cannot see console output using "euca-get-console-output".

Anyway, after reading the libvirt-list post pasted above, I'm inclined to think only one <serial> tag should be defined in libvirt.xml, but perhaps someone more familiar w/ libvirt can clarify?

-Matt

Revision history for this message
Tom Ellis (tellis) wrote :

@Chuck
Yes, tried todays daily oneiric image on diablo-3 and still see the same issue:

ubuntu@sugarloaf:~/images$ euca-describe-instances
RESERVATION r-vchanq4i proj default
INSTANCE i-00000023 ami-00000008 192.168.3.3 192.168.3.3 running psekey (proj, perce) 0 m1.small 2011-08-02T10:00:06Z nova
ubuntu@sugarloaf:~/images$ ping 192.168.3.3 -c 1
PING 192.168.3.3 (192.168.3.3) 56(84) bytes of data.
64 bytes from 192.168.3.3: icmp_req=1 ttl=64 time=0.155 ms

--- 192.168.3.3 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.155/0.155/0.155/0.000 ms
ubuntu@sugarloaf:~/images$ ssh ubuntu@192.168.3.3 -i ~/creds/psekey.priv
PTY allocation request failed on channel 0

FYI, I'm using VLAN network mode.

euca-get-console-output shows: UnknownError: An unknown error has occurred. Please try your request again.

A much better error was produced in nova-api.log though, attached.

Revision history for this message
Tom Ellis (tellis) wrote :

@Matt Interesting, I'll have a play around with it.

Tom Ellis (tellis)
Changed in nova (Ubuntu):
status: Incomplete → New
Thierry Carrez (ttx)
Changed in nova (Ubuntu):
status: New → Triaged
Revision history for this message
Dave Walker (davewalker) wrote :

@Tom, can you provide an update if that resolved the issue?

Thanks.

Revision history for this message
Tom Ellis (tellis) wrote :

So, I've tried the latest oneiric cloud images from today and two days ago and I still get the "PTY allocation request failed on channel 0" connecting via ssh.

With euca-get-console-output <instance id> I still get (from nova-api.log):
(nova.api): TRACE: RemoteError: Error local variable 'fpath' referenced before assignment
(nova.api): TRACE: [u'Traceback (most recent call last):\n', u' File "/usr/lib/pymodules/python2.7/nova/rpc.py", line 232, in _process_data\n rval = node_func(context=ctxt, **node_args)\n', u' File "/usr/lib/pymodules/python2.7/nova/exception.py", line 97, in wrapped\n return f(*args, **kw)\n', u' File "/usr/lib/pymodules/python2.7/nova/compute/manager.py", line 1023, in get_console_output\n output = self.driver.get_console_output(instance_ref)\n', u' File "/usr/lib/pymodules/python2.7/nova/exception.py", line 124, in wrapped\n raise Error(str(e))\n', u"Error: local variable 'fpath' referenced before assignment\n"]

However, on the compute node I can see the correctly booted system with 'virsh -c lxc:/// console <instance-id>'

Revision history for this message
Tom Ellis (tellis) wrote :

Also, it seems moving the serial tag makes no difference for what I can see

Revision history for this message
Chuck Short (zulcss) wrote :

This should be fixed now, please re-open if you are still having problems.

Regards
chuck

Changed in nova (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Tom Haddon (mthaddon) wrote :

I'm seeing this on trusty/icehouse:

root@furud:~# virsh list --all
 Id Name State
----------------------------------------------------
 32 instance-00002bb1 running
 37 instance-00002bb2 running
 4237 instance-00006b86 running
 4238 instance-00006b87 running

root@furud:~# virsh console instance-00006b87
Connected to domain instance-00006b87
Escape character is ^]
error: internal error: character device <null> is not using a PTY

Changed in nova (Ubuntu):
status: Fix Released → New
Revision history for this message
James Page (james-page) wrote :

Its quite likely that this is intended function - the console output of the instance is mapped to a log file so that 'nova console-log' can be used to retrieve log data via the public API of nova.

Revision history for this message
James Page (james-page) wrote :

You can use the following:

virsh console --devname serial1 instance-XXXX

Changed in nova (Ubuntu):
status: New → Invalid
Revision history for this message
James Page (james-page) wrote :

However that may not be usable - anyway I think this is by design - end users won't normally have direct access to compute hosts!

Revision history for this message
Varhegyi Balazs (varh1i-balazs) wrote :

Hi, I wanted to use "virtsh console instance-xxxx" as described here: http://www.jaredlog.com/?p=1484 for debugging this issue: https://ask.openstack.org/en/question/89583/cant-ping-machine-after-unrescue/ but I encountered this problem. My goal was to connect to the instance and see the console log and get a console to the machine because ssh doesn't work (details in the referenced link)

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.