Error, 'Bad file server-installation.yaml line 1: did not find expected key' on vFunction Server Upgrade



Overview of the Issue

This issue occurs in the following circumstances:

  1. A vFunction organization uses the vFunction Installation Wizard to create a TGZ to be used for the vFunction Server installation
  2. The installation completes without issues
  3. At a later date, the vFunction organization downloads an Upgrade TGZ from the vFunction Portal
  4. The organization runs the upgrade.sh script
  5. Unexpectedly, the upgrade fails with the following error
Error: bad file '/etc/sysconfig/vfunction/installation/server-installation.yaml': yaml: line 1: did not find expected key
Error: bad file '/etc/sysconfig/vfunction/installation/server-installation.yaml': yaml: line 1: did not find expected key
Error: bad file '/etc/sysconfig/vfunction/installation/server-installation.yaml': yaml: line 1: did not find expected key

You must set properties: server.host, server.admin.email, server.admin.name, server.admin.password, server.org_name in /etc/sysconfig/vfunction/installation/server-installation.yaml
Error: bad file '/etc/sysconfig/vfunction/installation/server-installation.yaml': yaml: line 1: did not find expected key
  1. In the server-installation.yaml, unexpected formatting for Values of some Keys that contain Child Keys such as ‘{}’ and / or “null”
server:
  host: http://1.1.1.1
  org_name: VF_ORG
  admin:
    email: admin@myorg.com
    name: Admin
    password: Password1!
  smtp: '{}'
#    user:
#    password:
#    identity:
#    url:
  authentication: '{}'
#    authority:
    client_id:
    client_secret:
#    jwks_url:
#    issuer:
  tls: '{}'
#    use_letsencrypt: true

storage: '{}'
### Leave empty to use an internal docker volume for database storage
#  database:

### Leave empty to use an internal docker volume for measurements storage
#  measurements:

### Leave empty to use an internal docker volume for dm storage
#  dm:

measurements:
  S3: '{}'
### AWS S3 bucket for measurements
#    bucket:
### AWS S3 key for measurements
#    key:
### AWS S3 secret for measurements
#    secret:
### AWS S3 region for measurements
#    region:

distributed:
  otlp: "null"
#    max_folder_size_in_mb: "200"

networking: '{}'
### Run nginx docker with bound ip. E.g: bind_nginx_host_ip: 192.168.1.2 -> "-p 192.168.1.2:80:80"
#  bind_nginx_host_ip:
#  disable_ipv6: true
#  force_http: true

Solution

The following steps can be used to resolve this issue:

  1. Change directories to the etc/sysconfig/vfunction/installation/ directory
  2. Remove the unexpected Strings from the server-installation.yaml:
sed -i "s~'{}'~~g" server-installation.yaml
sed -i 's~"null"~~g' server-installation.yaml
  1. Run the upgrade.sh script again