vmware-archive / cfops

This is simply an automation that is based on the supported way to back up Pivotal Cloud Foundry
http://www.cfops.io
Apache License 2.0
35 stars 24 forks source link

handshake failed: ssh: unable to authenticate #112

Closed prasadpete closed 7 years ago

prasadpete commented 7 years ago

I'm using cfops 3.1.2 (PCF version 1.10).

Followed below steps just as mentioned in www.cfops.io before executing the cfops backup script.

and then executed the backup script, LOG_LEVEL=debug ./cfops backup -omh opsmanager_host -cid BACKUP_CLIENT -cis ***** -omu ubuntu -d /opt/backup -t ops-manager

Below is the log generated.

2017/06/07 13:03:30 D0607 13:03:30.706144 8582 init.go:38] not loading plugins: %!(EXTRA *os.PathError=open ./plugins: no such file or directory, []os.FileInfo=[]) 
2017/06/07 13:03:30 D0607 13:03:30.706466 8582 createCliCommand.go:85] checking registry for 'ops-manager' tile 
2017/06/07 13:03:30 D0607 13:03:30.706491 8582 createCliCommand.go:88] found tile in registry 
2017/06/07 13:03:30 D0607 13:03:30.706534 8582 createCliCommand.go:91] we have all required flags and a proper builder 
2017/06/07 13:03:30 D0607 13:03:30.706622 8582 remote_execute.go:26] using password for authn 
2017/06/07 13:03:30 D0607 13:03:30.706651 8582 opsmanager.go:90] Exporting url 'https://opsmanagerurl/api/installation_settings' 
2017/06/07 13:03:30 D0607 13:03:30.706667 8582 opsmanager.go:144] attempting to auth against%!(EXTRA string=https://opsmanagerurl/api/installation_settings) 
2017/06/07 13:03:30 D0607 13:03:30.706692 8582 opsmanager.go:196] aquiring your token from: %!(EXTRA *url.URL=https://opsmanagerurl/api/installation_settings, string=https://opsmanagerurl/api/installation_settings) 
2017/06/07 13:03:30 D0607 13:03:30.882008 8582 opsmanager.go:202] token acquired 
2017/06/07 13:03:32 D0607 13:03:32.556935 8582 opsmanager_builder.go:34] No IaaS PEM key found. Defaulting to using ssh username and password credentials 
2017/06/07 13:03:32 D0607 13:03:32.55702 8582 createCliCommand.go:74] Running backup for tile: struct { tileregistry.Tile; tileregistry.Closer }{Tile:(*opsmanager.OpsManager)(0xc420180000), Closer:(*tileregistry.DoNothingCloser)(0xbb5520)} 
2017/06/07 13:03:32 E0607 13:03:32.582085 8582 remote_execute.go:82] ssh connection issue:%!(EXTRA *errors.errorString=ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain) 
2017/06/07 13:03:32 E0607 13:03:32.582151 8582 remote_execute.go:125] un-initialized client executor 
2017/06/07 13:03:32 E0607 13:03:32.582201 8582 createCliCommand.go:52] there was an error: un-initialized client executor running backup on ops-manager tile:tile

So what does ssh: handshake failed: ssh: unable to authenticate, in this log means to ? What am I doing wrong? Please advise.

Edited: Unlike #37 I dont have any special characters in my client secret.

prasadpete commented 7 years ago

I just got it resolved by adding a single quote around my password. It has a special character in it.

brightzheng100 commented 7 years ago

I'm facing the same issue, my password is really nothing special. I followed exactly the steps mentioned in http://www.cfops.io/#ops-manager-backup.

LOG_LEVEL=debug ./cfops backup -omh xx.xx.xx.xx -cid backup -cis Password1 -omu ubuntu -d . -t ops-manager

Error:

2017/06/28 07:27:14 D0628 07:27:14.268363 19534 init.go:38] not loading plugins: %!(EXTRA *os.PathError=open ./plugins: no such file or directory, []os.FileInfo=[])
2017/06/28 07:27:14 D0628 07:27:14.268665 19534 createCliCommand.go:85] checking registry for 'ops-manager' tile
2017/06/28 07:27:14 D0628 07:27:14.268743 19534 createCliCommand.go:88] found tile in registry
2017/06/28 07:27:14 D0628 07:27:14.268802 19534 createCliCommand.go:91] we have all required flags and a proper builder
2017/06/28 07:27:14 D0628 07:27:14.268908 19534 remote_execute.go:26] using password for authn
2017/06/28 07:27:14 D0628 07:27:14.268991 19534 opsmanager.go:90] Exporting url 'https://xx.xx.xx.xx/api/installation_settings'
2017/06/28 07:27:14 D0628 07:27:14.269055 19534 opsmanager.go:144] attempting to auth against%!(EXTRA string=https://xx.xx.xx.xx/api/installation_settings)
2017/06/28 07:27:14 D0628 07:27:14.269117 19534 opsmanager.go:196] aquiring your token from: %!(EXTRA *url.URL=https://xx.xx.xx.xx/api/installation_settings, string=https://xx.xx.xx.xx/api/installation_settings)
2017/06/28 07:27:14 D0628 07:27:14.420726 19534 opsmanager.go:202] token acquired
2017/06/28 07:27:15 D0628 07:27:15.469792 19534 opsmanager_builder.go:34] No IaaS PEM key found. Defaulting to using ssh username and password credentials
2017/06/28 07:27:15 D0628 07:27:15.469932 19534 createCliCommand.go:74] Running backup for tile: struct { tileregistry.Tile; tileregistry.Closer }{Tile:(*opsmanager.OpsManager)(0xc420138000), Closer:(*tileregistry.DoNothingCloser)(0xbb5520)}
2017/06/28 07:27:15 E0628 07:27:15.485118 19534 remote_execute.go:82] ssh connection issue:%!(EXTRA *errors.errorString=ssh: handshake failed: ssh: unable to authenticate, attempted methods [none], no supported methods remain)
2017/06/28 07:27:15 E0628 07:27:15.485183 19534 remote_execute.go:125] un-initialized client executor
2017/06/28 07:27:15 E0628 07:27:15.485215 19534 createCliCommand.go:52] there was an error: un-initialized client executor running backup on ops-manager tile:tile
NAME:
   cfops backup - creates a backup archive of the target tile
...

What's wrong?

prasadpete commented 7 years ago

Hi @brightzheng100 - Can you please try elastic-runtime tile backup and see if you're getting the same error ?

brightzheng100 commented 7 years ago

Thanks you @prasadpete for the prompt followup. By changing the ops-manager to elastic-runtime, I still encountered errors and the logs were like that:

2017/07/01 04:28:37 D0701 04:28:37.992298 966 init.go:38] not loading plugins: %!(EXTRA *os.PathError=open ./plugins: no such file or directory, []os.FileInfo=[])
2017/07/01 04:28:37 D0701 04:28:37.992514 966 createCliCommand.go:85] checking registry for 'elastic-runtime' tile
2017/07/01 04:28:37 D0701 04:28:37.992584 966 createCliCommand.go:88] found tile in registry
2017/07/01 04:28:37 D0701 04:28:37.992631 966 createCliCommand.go:91] we have all required flags and a proper builder
2017/07/01 04:28:37 D0701 04:28:37.992811 966 remote_execute.go:26] using password for authn
2017/07/01 04:28:37 D0701 04:28:37.992878 966 opsmanager.go:90] Exporting url 'https://xx.xx.xx.xx/api/installation_settings'
2017/07/01 04:28:37 D0701 04:28:37.992921 966 opsmanager.go:144] attempting to auth against%!(EXTRA string=https://xx.xx.xx.xx/api/installation_settings)
2017/07/01 04:28:37 D0701 04:28:37.99297 966 opsmanager.go:196] aquiring your token from: %!(EXTRA *url.URL=https://xx.xx.xx.xx/api/installation_settings, string=https://xx.xx.xx.xx/api/installation_settings)
2017/07/01 04:28:38 D0701 04:28:38.155602 966 opsmanager.go:202] token acquired
2017/07/01 04:28:39 D0701 04:28:39.232437 966 createCliCommand.go:74] Running backup for tile: struct { tileregistry.Tile; tileregistry.Closer }{Tile:(*elasticruntime.ElasticRuntime)(0xc4202be0a0), Closer:(*elasticruntime.TempFile)(0xc42000e160)}
2017/07/01 04:28:39 D0701 04:28:39.524265 966 elasticruntime.go:63] Retrieving All CC VMs
2017/07/01 04:28:39 D0701 04:28:39.524405 966 elasticruntime.go:100] Entering getAllCloudControllerVMs() function
2017/07/01 04:28:39 D0701 04:28:39.843691 966 elasticruntime.go:72] Setting up CC jobs
2017/07/01 04:29:09 D0701 04:29:09.175684 966 elasticruntime.go:81] Running db action
2017/07/01 04:29:09 D0701 04:29:09.175743 966 elasticruntime.go:134] RunDbAction info: cf nfs_server
2017/07/01 04:29:09 D0701 04:29:09.175756 966 remote_execute.go:26] using password for authn
2017/07/01 04:29:09 I0701 04:29:09.175768 966 elasticruntime.go:164] Exporting nfs_server
2017/07/01 04:29:09 E0701 04:29:09.434402 966 remote_execute.go:82] ssh connection issue:%!(EXTRA *errors.errorString=ssh: handshake failed: ssh: unable to authenticate, attempted methods [none], no supported methods remain)
2017/07/01 04:29:09 E0701 04:29:09.434587 966 remote_execute.go:125] un-initialized client executor
2017/07/01 04:29:09 D0701 04:29:09.434651 966 elasticruntime.go:169] Done backing up %!(EXTRA string=nfs_server, *errors.errorString=un-initialized client executor)
2017/07/01 04:29:09 E0701 04:29:09.434726 966 elasticruntime.go:85] Error backing up db%!(EXTRA *errors.errorString=un-initialized client executor)
2017/07/01 04:30:26 E0701 04:30:26.105112 966 createCliCommand.go:52] there was an error: failed to backup database running backup on elastic-runtime tile:tile
NAME:
   cfops backup - creates a backup archive of the target tile

BTW:

  1. I'm using latest version:
    $ ./cfops version
    cfops version v3.1.2
  2. how can I get verbose logs?
brightzheng100 commented 7 years ago

I believe my error is because I'm using external databases. Do we have options to opt out the backup without databases, or even the blobstore, so that we backup only the necessary bits other than the external databases and blobstore?

Kindly advise.

henryaj commented 7 years ago

Unfortunately not , @brightzheng100 - cfops only supports backing up PCF deployments that use the internal MySQL database.

If you're looking to backup PCF without databases or blobstore, an Ops Manager export will provide all the other state in the system.