Pivotal Knowledge Base

Follow

Applying changes for Stemcell fails with Error: "wrong number of arguments (0 for 1)"

Environment

 Product  Version
 Pivotal Cloud Foundry  All

Symptom

Apply changes fails with the following error: 

"bundle exec bosh -n upload stemcell  --skip-if-exists" wrong number of arguments (0 for 1)

Cause

This error occurs when Floating Stemcells are disabled.

If it is required to update the Stemcell for a changed deployment, an unavailable Stemcell will cause the above error.

Analysis

Review the installation logs to make sure the changed deployment is attempting to upload the Stemcell.

Installation logs can be found by clicking Changelog button under the Apply changes button on the Ops Manager dashboard:

Usage: upload stemcell <stemcell_location> [--skip-if-exists] [--fix] [--sha1 SHA1] [--name NAME] [--version VERSION]
===== 2017-04-24 13:14:58 UTC Finished "bundle exec bosh -n upload stemcell --skip-if-exists"; Duration: 0s; Exit Status: 1
===== 2017-04-24 13:14:58 UTC Running "bundle exec bosh -n upload stemcell --skip-if-exists"
wrong number of arguments (0 for 1).

Check if the floating Stemcells are disabled using this article: How to disable floating stemcells in PCF

Resolution

This can be fixed by following one of the two steps below:

  1. Upload stemcell manually
    1. List metadata files of all tiles to narrow down the floating stemcells option as false:
      • cd /var/tempest/workspaces/default/metadata
      • sudo grep -B1 enable_patch_security_updates *.yml
      • For example:
      • ubuntu@opsman-21:~$ cd /var/tempest/workspaces/default/metadata
        ubuntu@opsman-21:/var/tempest/workspaces/default/metadata$ sudo grep -B1 enable_patch_security_updates *.yml
        25abb5b68c90.yml- version: '3363.15'
        25abb5b68c90.yml: enable_patch_security_updates: false
        --
        4800a1800279.yml- version: '3363'
        4800a1800279.yml: enable_patch_security_updates: true
        --
        685eb755adf3.yml- version: '3312.24'
        685eb755adf3.yml: enable_patch_security_updates: true
    2. Download the latest Stemcell sub-version. In the above example, we need to download the latest version of Stemcell; version 3363.x
    3. Upload the Stemcell manually under the Tile -> Stemcell ta
    4. Click Apply changes on the Ops Manager dashboard.
  2. Enable floating Stemcells
    1. Connect via SSH to the Ops Manager VM
    2. cd /var/tempest/workspaces/default/metadata
    3. List the metadata files of all tiles which have floating Stemcells enabled or disabled
      • sudo grep -B1 enable_patch_security_updates *.yml
    4. Make sure that the Stemcell version listed in this output is old and has the option enable_patch_security_updates set as false
    5. Change enable_patch_security_updates under stemcell_criteria to true to enable the floating Stemcell of the required tile(s) using: sudo vi <file name> from the above output
      • For example:
      • ubuntu@opsman-21:~$ cd /var/tempest/workspaces/default/metadata
        ubuntu@opsman-21:/var/tempest/workspaces/default/metadata$ sudo grep -B1 enable_patch_security_updates *.yml
        25abb5b68c90.yml- version: '3363.15'
        25abb5b68c90.yml: enable_patch_security_updates: false
        --
        4800a1800279.yml- version: '3363'
        4800a1800279.yml: enable_patch_security_updates: true
      • Open the file 25abb5b68c90.yml in this example and change the value of enable_patch_security_updates under stemcell_criteria to true:
      • ubuntu@opsman-21:/var/tempest/workspaces/default/metadata$ vi 4800a1800279.yml
        stemcell_criteria:
        os: ubuntu-trusty
        version: '3363.15'
        enable_patch_security_updates: true
      • Confirm by running the grep command again:
      • ubuntu@opsman-21:/var/tempest/workspaces/default/metadata$ sudo grep -B1 enable_patch_security_updates *.yml
        25abb5b68c90.yml- version: '3363.15'
        25abb5b68c90.yml: enable_patch_security_updates: true
        --
        4800a1800279.yml- version: '3363'
        4800a1800279.yml: enable_patch_security_updates: true
    6. After saving the above file(s), continue with "Apply changes"

Comments

Powered by Zendesk