Upgrade fails with invalid syslog drain URL in Tanzu Application Service for VMs
search cancel

Upgrade fails with invalid syslog drain URL in Tanzu Application Service for VMs

book

Article ID: 298229

calendar_today

Updated On:

Products

VMware Tanzu Application Service for VMs

Issue/Introduction

When the customer is trying to upgrade to Tanzu Application Service (TAS) for VMs versions 2.11.2, 2.10.13, 2.9.21, 2.8.27, 2.7.33 or any other version that uses Metrics Registrar v1.1.5, it fails with a panic error in the Clock Global VM, metric_registrar_orchestrator job.

You see an error is similar to the following:
panic: runtime error: index out of range [1] with length 1
 
goroutine 56 [running]:
github.com/pivotal-cf/metric-registrar-release/src/metric_registrar/pkg/orchestrator.parseDrainAddress(...)
        /var/vcap/data/compile/metric_registrar/metric_registrar/pkg/orchestrator/discovery.go:180
github.com/pivotal-cf/metric-registrar-release/src/metric_registrar/pkg/orchestrator.createRegistration(0xc0002ba5c0, 0x1e, 0xc0003a8360, 0x24, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /var/vcap/data/compile/metric_registrar/metric_registrar/pkg/orchestrator/discovery.go:168 +0x14d
github.com/pivotal-cf/metric-registrar-release/src/metric_registrar/pkg/orchestrator.parseConfigurations(0xc00046fa70, 0x3e8, 0x0, 0xc00046fa70)
        /var/vcap/data/compile/metric_registrar/metric_registrar/pkg/orchestrator/discovery.go:160 +0xf2
github.com/pivotal-cf/metric-registrar-release/src/metric_registrar/pkg/orchestrator.(*RegistrationDiscovery).DiscoverRegistrations(0xc0002ae960, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /var/vcap/data/compile/metric_registrar/metric_registrar/pkg/orchestrator/discovery.go:79 +0x22d
github.com/pivotal-cf/metric-registrar-release/src/metric_registrar/pkg/orchestrator.(*Manager).term(0xc00010f3b0, 0xb0bda0, 0xc0002ccec0)
        /var/vcap/data/compile/metric_registrar/metric_registrar/pkg/orchestrator/manager.go:76 +0x30a
github.com/pivotal-cf/metric-registrar-release/src/metric_registrar/pkg/orchestrator.(*Manager).Start(0xc00010f3b0, 0x37e11d600, 0xc00002a0d1)
        /var/vcap/data/compile/metric_registrar/metric_registrar/pkg/orchestrator/manager.go:49 +0x73
created by main.orchestrate
        /var/vcap/data/compile/metric_registrar/metric_registrar/cmd/orchestrator/main.go:58 +0x2a5

When checking the "cf drains" output, you find the invalid syslog drain URL, similar to the following:
API endpoint: https://api.xxxx 
API version: 3.85.0 
user: xxxx 
org: xxxx 
space: xxxx 
App Drain Type URL 
supplier-experience splunk Logs UNKNOWN

This was working in previous versions of Metrics Registrar, however, due to a code change in the latest release it no longer accepts invalid syslog drain URLs.

Environment

Product Version: 2.10

Resolution

Certain versions of Metrics Registrar no longer accepts invalid syslog drain URLS. To work around this issue, review all syslog drain URLs in your system and confirm they are valid. 

Invalid syslog drains can resemble the following format after running the command cf drains:
App                  Drain     Type      URL
supplier-experience  splunk    Logs      UNKNOWN

Additionally, any drain URLs that are not in the proper format fail ("://").

Example

Take note of the missing colon, extra colon, and slash in the following example. Using these invalid URLs can cause negative impacts when trying to create the service bindings. 
syslog:logs.example.com:1234
syslog:////logs.example.com:1234
syslog:://logs.example.com:1234

This has been fixed in TAS for VMs 2.11.3, 2.10.15, 2.9.23.