cloudfoundry-attic / bosh-init

bosh-init is a tool used to create and update the Director VM
Apache License 2.0
31 stars 33 forks source link

bosh upload-release returns "Error: version format" but should not #105

Closed gu-bin closed 8 years ago

gu-bin commented 8 years ago

For boshcli v1, the release can be uploaded successfully:

root@gubin-boshcli2:~# bosh upload release /root/releases/admin-ui/1.5.0.131/admin-ui.tgz
RSA 1024 bit CA certificates are loaded due to old openssl compatibility
Acting as user 'admin' on 'bosh'

Verifying manifest...
Extract manifest                                             OK
Manifest exists                                              OK
Release name/version                                         OK

File exists and readable                                     OK
Read package 'libyaml' (1 of 5)                              OK
Package 'libyaml' checksum                                   OK
Read package 'sqlite' (2 of 5)                               OK
Package 'sqlite' checksum                                    OK
Read package 'admin_ui_v2' (3 of 5)                          OK
Package 'admin_ui_v2' checksum                               OK
Read package 'libpq' (4 of 5)                                OK
Package 'libpq' checksum                                     OK
Read package 'ruby' (5 of 5)                                 OK
Package 'ruby' checksum                                      OK
Package dependencies                                         OK
Checking jobs format                                         OK
Read job 'admin_ui_v2' (1 of 1), version 1a0fe355cdc529540ee0661c04a701dab3270058 OK
Job 'admin_ui_v2' checksum                                   OK
Extract job 'admin_ui_v2'                                    OK
Read job 'admin_ui_v2' manifest                              OK
Check template 'admin_ui_v2_ctl.erb' for 'admin_ui_v2'       OK
Check template 'cf-registrar_ctl' for 'admin_ui_v2'          OK
Check template 'config.yml.erb' for 'admin_ui_v2'            OK
Check template 'cf-registrar.config.yml.erb' for 'admin_ui_v2' OK
Check template 'varz.yml.erb' for 'admin_ui_v2'              OK
Check template 'varz.log4j.properties.erb' for 'admin_ui_v2' OK
Job 'admin_ui_v2' needs 'libyaml' package                    OK
Job 'admin_ui_v2' needs 'libpq' package                      OK
Job 'admin_ui_v2' needs 'sqlite' package                     OK
Job 'admin_ui_v2' needs 'ruby' package                       OK
Job 'admin_ui_v2' needs 'admin_ui_v2' package                OK
Monit file for 'admin_ui_v2'                                 OK

Release info
------------
Name:    opsapps
Version: 0+dev.1

Packages
  - libyaml (b3c0cfd5bfb41332f14188bf80097cb305d7e30f)
  - sqlite (af44d44e58fffd069459cb63f6fcc37c6326e370)
  - admin_ui_v2 (cc6be0446ad9136ec5466acd78a440ea4ffaa202)
  - libpq (115be273a310e311463707695745f1bdd89b5592)
  - ruby (2710a273a1fa47c139df9b24be1facd19eb7ae32)

Jobs
  - admin_ui_v2 (1a0fe355cdc529540ee0661c04a701dab3270058)

License
  - none

Checking if can repack release for faster upload...
libyaml (b3c0cfd5bfb41332f14188bf80097cb305d7e30f) UPLOAD
sqlite (af44d44e58fffd069459cb63f6fcc37c6326e370) UPLOAD
admin_ui_v2 (cc6be0446ad9136ec5466acd78a440ea4ffaa202) UPLOAD
libpq (115be273a310e311463707695745f1bdd89b5592) UPLOAD
ruby (2710a273a1fa47c139df9b24be1facd19eb7ae32) UPLOAD
admin_ui_v2 (1a0fe355cdc529540ee0661c04a701dab3270058) UPLOAD
Uploading the whole release

Uploading release
admin-ui.tgz:   96% |oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo    |  39.8MB  10.8MB/s ETA:  00:00:00
Director task 15
  Started extracting release > Extracting release. Done (00:00:01)

  Started verifying manifest > Verifying manifest. Done (00:00:00)

  Started resolving package dependencies > Resolving package dependencies. Done (00:00:00)

  Started creating new packages
  Started creating new packages > libyaml/b3c0cfd5bfb41332f14188bf80097cb305d7e30f. Done (00:00:00)
  Started creating new packages > sqlite/af44d44e58fffd069459cb63f6fcc37c6326e370. Done (00:00:00)
  Started creating new packages > admin_ui_v2/cc6be0446ad9136ec5466acd78a440ea4ffaa202. Done (00:00:00)
  Started creating new packages > libpq/115be273a310e311463707695745f1bdd89b5592. Done (00:00:00)
  Started creating new packages > ruby/2710a273a1fa47c139df9b24be1facd19eb7ae32. Done (00:00:01)
     Done creating new packages (00:00:01)

  Started creating new jobs > admin_ui_v2/1a0fe355cdc529540ee0661c04a701dab3270058. Done (00:00:00)

  Started release has been created > admin-ui/1.5.0.131. Done (00:00:00)

Task 15 done

Started     2016-08-31 08:45:23 UTC
Finished    2016-08-31 08:45:25 UTC
Duration    00:00:02
admin-ui.tgz:   96% |oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo    |  39.8MB   5.6MB/s Time: 00:00:07

Release uploaded

But it fails to upload using boshcli v2, returning "Error: version format": version: bosh-cli-0.0.46-linux-amd64

root@gubin-boshcli2:~# bosh2 upload-release /root/releases/admin-ui/1.5.0.131/admin-ui.tgz
Using environment '10.113.109.124' as user 'admin'
########################################################## 100.00% 11.15 MB/s 3s

Task 20

08:50:02 | Extracting release: Extracting release (00:00:00)

08:50:02 | Verifying manifest: Verifying manifest (00:00:00)

08:50:02 | Resolving package dependencies: Resolving package dependencies (00:00:00)

08:50:02 | Creating new packages: libyaml/YjNjMGNmZDViZmI0MTMzMmYxNDE4OGJmODAwOTdjYjMwNWQ3ZTMwZg== (00:00:00)
            L Error: version format

08:50:02 | Error: version format

Started  Wed Aug 31 08:50:02 UTC 2016
Finished Wed Aug 31 08:50:02 UTC 2016
Duration 00:00:00

Task 20 error

Uploading release file:
  Expected task '20' to succeed but was state is 'error'

Exit code 1

/cc @maximilien @mattcui @jianqiu

cppforlife commented 8 years ago

@cunnie has described similar issue in detail here: https://github.com/cloudfoundry-incubator/bosh-softlayer-cpi-release/issues/31. solution is to re-encode so that versions are not base64 encoded.

gu-bin commented 8 years ago

The releases work good with bosh cli v1. So bosh cli v2 doesn't work compatibly with v1? We have a lot of releases that the versions are base64 encoded. Re-encoding them will be a lot of work. Can bosh cli v2 automatically decode base64 to be compatible with bosh cli v1? Thanks.

cppforlife commented 8 years ago

we can provide a ruby script you can run once per repo to do this if you are interested.

Sent from my iPhone

On Aug 31, 2016, at 8:57 PM, Gu Bin notifications@github.com wrote:

The releases work good with bosh cli v1. So bosh cli v2 doesn't work compatibly with v1? We have a lot of releases that the versions are base64 encoded. Re-encoding them will be a lot of work. Can bosh cli v2 automatically decode base64 to be compatible with bosh cli v1? Thanks.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.

gu-bin commented 7 years ago

@cppforlife Would you please provide this ruby script? Thanks.

dpb587-pivotal commented 7 years ago

Answered in cloudfoundry/bosh-cli#181