cloudfoundry / credhub-cli

CredHub CLI provides a command line interface to interact with CredHub servers
Apache License 2.0
39 stars 44 forks source link

exporting and then importing results in `the server does not support credential metadata, requires >= 2.6.x` error #104

Closed jtarchie closed 4 years ago

jtarchie commented 4 years ago

What version of the credhub server you are using?

1.9.3

What version of the credhub cli you are using?

$ credhub --version
CLI Version: 2.8.0
Server Version: 0.0.0

If you were attempting to accomplish a task, what was it you were attempting to do?

With the current CLI (2.8.0), when we credhub export and then credhub import we receive an error on many credentials of the server does not support credential metadata, requires >= 2.6.x. It appears that the export includes an empty field for each credential of metadata: {}. The import is then not able to use this and errors on the import.

What did you expect to happen?

Not to receive this error. Most likely, credhub export would export a field that is unsupported by the server it is exporting from.

What was the actual behavior?

This error message on every credential trying to be imported -- the server does not support credential metadata, requires >= 2.6.x

The 2 that we manually added, which did not have the metadata: {} worked. As can be seen in the following output.

Example output:

Import complete.
Successfully set: 2
Failed to set: 123
.... more of the same ...
 - Credential '/concourse/main/abrown-deploy-key' at index 113 could not be set: the server does not support credential metadata, requires >= 2.6.x
 - Credential '/concourse/main/networking_poe_ssl_certs' at index 114 could not be set: the server does not support credential metadata, requires >= 2.6.x
 - Credential '/concourse/main/s3_access_key_id' at index 115 could not be set: the server does not support credential metadata, requires >= 2.6.x
 - Credential '/concourse/main/docs-ref-pipeline-repo-uri' at index 116 could not be set: the server does not support credential metadata, requires >= 2.6.x
 - Credential '/concourse/main/docs-ref-pipeline-repo-key' at index 117 could not be set: the server does not support credential metadata, requires >= 2.6.x
 - Credential '/concourse/main/s3_region_name' at index 118 could not be set: the server does not support credential metadata, requires >= 2.6.x
 - Credential '/concourse/main/s3_pivnet_products_bucket' at index 119 could not be set: the server does not support credential metadata, requires >= 2.6.x
 - Credential '/concourse/main/s3_secret_access_key' at index 120 could not be set: the server does not support credential metadata, requires >= 2.6.x
 - Credential '/ab-opsman-ssh-key' at index 121 could not be set: the server does not support credential metadata, requires >= 2.6.x
 - Credential '/concourse/main/reference-pipeline-development/vsphere_ssh_key' at index 122 could not be set: the server does not support credential metadata, requires >= 2.6.x
 - Credential '/concourse/main/reference-pipeline-development/opsman-ssl' at index 123 could not be set: the server does not support credential metadata, requires >= 2.6.x
 - Credential '/concourse/main/reference-pipeline/opsman-ssl' at index 124 could not be set: the server does not support credential metadata, requires >= 2.6.x
One or more credentials failed to import.
cf-gitbot commented 4 years ago

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/174536502

The labels on this github issue will be updated when the story is started.

peterhaochen47 commented 4 years ago

Fixed by #105. Will be released in the next version of cli. Thanks for reporting the issue!