ERROR tempest.lib.common.ssh AuthenticationException: Authentication failed.

Bug #1589380 reported by xuchao
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
refstack
Invalid
Undecided
Unassigned

Bug Description

1、Execute compute cases
# ./refstack-client test -c ~/refstack-client/.tempest/etc/tempest.conf -v -- tempest.api.compute.servers.test_create_server.ServersTestJSON.test_host_name_is_same_as_server_name

2、The test output
 2016-06-06 13:58:19,338 20767 WARNING [tempest.lib.common.ssh] Failed to establish authenticated ssh connection to root@172.16.74.234 (Authentication failed.). Number attempts: 21. Retry after 22 seconds.
    2016-06-06 13:58:41,847 20767 INFO [paramiko.transport] Connected (version 2.0, client OpenSSH_6.6.1)
    2016-06-06 13:58:41,944 20767 INFO [paramiko.transport] Authentication (publickey) failed.
    2016-06-06 13:58:43,667 20767 INFO [paramiko.transport] Authentication (password) failed.
    2016-06-06 13:58:43,672 20767 ERROR [tempest.lib.common.ssh] Failed to establish authenticated ssh connection to root@172.16.74.234 after 21 attempts
    2016-06-06 13:58:43.672 20767 ERROR tempest.lib.common.ssh Traceback (most recent call last):
    2016-06-06 13:58:43.672 20767 ERROR tempest.lib.common.ssh File "/root/refstack-client/.tempest/tempest/lib/common/ssh.py", line 75, in _get_ssh_connection
    2016-06-06 13:58:43.672 20767 ERROR tempest.lib.common.ssh timeout=self.channel_timeout, pkey=self.pkey)
    2016-06-06 13:58:43.672 20767 ERROR tempest.lib.common.ssh File "/root/refstack-client/.tempest/.venv/lib/python2.7/site-packages/paramiko/client.py", line 380, in connect
    2016-06-06 13:58:43.672 20767 ERROR tempest.lib.common.ssh look_for_keys, gss_auth, gss_kex, gss_deleg_creds, gss_host)
    2016-06-06 13:58:43.672 20767 ERROR tempest.lib.common.ssh File "/root/refstack-client/.tempest/.venv/lib/python2.7/site-packages/paramiko/client.py", line 597, in _auth
    2016-06-06 13:58:43.672 20767 ERROR tempest.lib.common.ssh raise saved_exception
    2016-06-06 13:58:43.672 20767 ERROR tempest.lib.common.ssh AuthenticationException: Authentication failed.
    2016-06-06 13:58:43.672 20767 ERROR tempest.lib.common.ssh
    2016-06-06 13:58:43,974 20767 INFO [tempest.lib.common.rest_client] Request (ServersTestJSON:test_host_name_is_same_as_server_name): 200 POST http://172.16.74.100:8774/v2/5ce444d267fd47c9aab68b404fcb1926/servers/428cef10-e2e5-4337-bd9a-ca82fb15463a/action 0.300s
======
Totals
======
Ran: 1 tests in 534.0000 sec.
 - Passed: 0
 - Skipped: 0
 - Expected Fail: 0
 - Unexpected Success: 0
 - Failed: 1

3.Compute and validation configuration section in tempest.conf file
[compute]
image_ref = f1692596-9fa2-4f2a-90ca-960d7d703fe0
image_ref_alt = 845d2fb2-543c-456b-a165-14f93c718944
flavor_ref = 2
flavor_ref_alt = 2
build_interval = 6
build_timeout = 200
ready_wait = 0
fixed_network_name = private_net
catalog_type = compute
region = RegionOne
endpoint_type = publicURL
volume_device_name = vdb
shelved_offload_time = 0
min_compute_nodes = 1
[compute-feature-enabled]
disk_config = true
api_extensions = all
change_password = false
resize = true
pause = true
shelve = true
suspend = true
live_migration = true
metadata_service = true
spice_console = true
rdp_console = true
rescue = true
enable_instance_password = true
interface_attach = true
snapshot = true
nova_cert = true
personality = true
attach_encrypted_volume = true
allow_duplicate_networks = true
config_drive = true

[validation]
run_validation = true
security_group = true
security_group_rules = true
connect_method = floating
auth_method = keypair
ip_version_for_ssh = 4
ping_timeout = 100
connect_timeout = 60
ssh_timeout = 300
image_ssh_user = "root"
image_ssh_password = "qweasd123456"
ssh_shell_prologue = set -eu -o pipefail; PATH=$$PATH:/sbin;
ping_size = 56
ping_count = 1
floating_ip_range = 172.16.74.0/24
network_for_ssh = public

4、# nova list --all-tenants
+--------------------------------------+--------------------------+----------------------------------+--------+------------+-------------+--------------------------------------+
| ID | Name | Tenant ID | Status | Task State | Power State | Networks |
+--------------------------------------+--------------------------+----------------------------------+--------+------------+-------------+------------------------------------
| 7ef4c3fa-6a09-4d2b-9fc2-7e5b911089bc | tempest-server-124910347 | 5ce444d267fd47c9aab68b404fcb1926 | ACTIVE | - | Running | private_net=10.0.0.17, 172.16.74.234 |
+--------------------------------------+--------------------------+----------------------------------+--------+------------+-------------+------------------------------------

5、# nova show 7ef4c3fa-6a09-4d2b-9fc2-7e5b911089bc
+--------------------------------------+----------------------------------------------------------+
| Property | Value |
+--------------------------------------+----------------------------------------------------------+
| OS-DCF:diskConfig | AUTO |
| OS-EXT-AZ:availability_zone | nova |
| OS-EXT-SRV-ATTR:host | cc100.chinacloud.com |
| OS-EXT-SRV-ATTR:hypervisor_hostname | cc100.chinacloud.com |
| OS-EXT-SRV-ATTR:instance_name | instance-000000b5 |
| OS-EXT-STS:power_state | 1 |
| OS-EXT-STS:task_state | - |
| OS-EXT-STS:vm_state | active |
| OS-SRV-USG:launched_at | 2016-06-07T04:57:31.000000 |
| OS-SRV-USG:terminated_at | - |
| accessIPv4 | 1.1.1.1 |
| accessIPv6 | ::babe:dc0c:1602 |
| config_drive | |
| created | 2016-06-07T04:57:20Z |
| flavor | m1.small (2) |
| hostId | 3f89afce295826b2d8c0a591407a963b1979a057e11fd7c889931fef |
| id | d02912a1-7c2c-425f-bb5e-83aae3cf12c6 |
| image | centos7-cloudinit (7f0058b7-3d10-4078-8abe-fe99a842bb52) |
| key_name | tempest-keypair-1180582342 |
| metadata | {"hello": "world"} |
| name | tempest-server-1108086439 |
| os-extended-volumes:volumes_attached | [] |
| private_net network | 10.0.0.32, 172.16.74.234 |
| progress | 0 |
| security_groups | tempest-securitygroup--1609609635 |
| status | ACTIVE |
| tenant_id | 5ce444d267fd47c9aab68b404fcb1926 |
| updated | 2016-06-07T04:57:31Z |
| user_id | 633bab33a6734582b44825ef2c521e69 |

6.Prompt the same wrong cases are:
tempest.api.compute.servers.test_create_server.ServersTestJSON.test_host_name_is_same_as_server_name
tempest.api.compute.servers.test_create_server.ServersTestManualDisk.test_verify_created_server_vcpus

xuchao (xuchao)
description: updated
xuchao (xuchao)
description: updated
xuchao (xuchao)
description: updated
xuchao (xuchao)
description: updated
description: updated
Revision history for this message
Catherine Diep (cdiep) wrote :

Are you able to manually ssh to the VM and check that the keys are properly configured since your tempest.conf defines for ssh to use keypair ( auth_method = keypair )? You may also try to increase the "ssh_timeout = 300" value to see whether it will help.

Some debug information from this link may help https://bugs.launchpad.net/tempest/+bug/1583987

Revision history for this message
xuchao (xuchao) wrote :

Yes, I am such a configuration

auth_method = keypair
ssh_timeout = 300

Revision history for this message
xuchao (xuchao) wrote :

Why the same result, success and failure are all

==============================
Failed 1 tests - output below:
==============================

tempest.api.compute.servers.test_create_server.ServersTestJSON.test_host_name_is_same_as_server_name[id-ac1ad47f-984b-4441-9274-c9079b7a0666]
---------------------------------------------------------------------------------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):
      File "/root/refstack-client/.tempest/tempest/api/compute/servers/test_create_server.py", line 140, in test_host_name_is_same_as_server_name
        self.assertTrue(linux_client.hostname_equals_servername(self.name))
      File "/root/refstack-client/.tempest/.venv/lib/python2.7/site-packages/unittest2/case.py", line 702, in assertTrue
        raise self.failureException(msg)
    AssertionError: False is not true

Captured pythonlogging:
~~~~~~~~~~~~~~~~~~~~~~~
    2016-06-12 14:38:54,099 27761 INFO [tempest.lib.common.ssh] Creating ssh connection to '172.16.74.238' as 'root' with public key authentication
    2016-06-12 14:38:57,106 27761 WARNING [tempest.lib.common.ssh] Failed to establish authenticated ssh connection to root@172.16.74.238 ([Errno None] Unable to connect to port 22 on 172.16.74.238). Number attempts: 1. Retry after 2 seconds.
    2016-06-12 14:39:00,113 27761 WARNING [tempest.lib.common.ssh] Failed to establish authenticated ssh connection to root@172.16.74.238 ([Errno None] Unable to connect to port 22 on 172.16.74.238). Number attempts: 2. Retry after 3 seconds.
    2016-06-12 14:39:03,640 27761 INFO [paramiko.transport] Connected (version 2.0, client OpenSSH_6.6.1)
    2016-06-12 14:39:03,840 27761 INFO [paramiko.transport] Authentication (publickey) failed.
    2016-06-12 14:39:06,080 27761 INFO [paramiko.transport] Authentication (password) failed.
    2016-06-12 14:39:06,089 27761 WARNING [tempest.lib.common.ssh] Failed to establish authenticated ssh connection to root@172.16.74.238 (Authentication failed.). Number attempts: 3. Retry after 4 seconds.
    2016-06-12 14:39:10,607 27761 INFO [paramiko.transport] Connected (version 2.0, client OpenSSH_6.6.1)
    2016-06-12 14:39:10,677 27761 INFO [paramiko.transport] Authentication (publickey) successful!
    2016-06-12 14:39:10,696 27761 INFO [tempest.lib.common.ssh] ssh connection to root@172.16.74.238 successfully created
======
Totals
======
Ran: 1 tests in 55.0000 sec.
 - Passed: 0
 - Skipped: 0
 - Expected Fail: 0
 - Unexpected Success: 0
 - Failed: 1

Catherine Diep (cdiep)
Changed in refstack:
status: New → Incomplete
Revision history for this message
Martin Kopec (mkopec) wrote :

This has been closed as Invalid: https://storyboard.openstack.org/#!/story/1589380

Changed in refstack:
status: Incomplete → Invalid
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.