There are some expected errors in the logs of Cartographer during normal operation.
search cancel

There are some expected errors in the logs of Cartographer during normal operation.

book

Article ID: 414764

calendar_today

Updated On:

Products

VMware Tanzu Platform - Kubernetes

Issue/Introduction

During the new workload deploying, there are 3 specific errors.

  • failed to evaluate json path '.status.template': failed to evaluate spec.configPath [.status.template]: jsonpath returned empty list: .status.template
  • unable to retrieve outputs [.status.template] from stamped object [namespace/workload_name] of type [podintents.conventions.carto.run] for resource [config-provider] in supply chain [source-test-to-url]: failed to evaluate json path '.status.template': failed to evaluate spec.configPath [.status.template]: jsonpath returned empty list: .status.template
  • unable to apply ytt template: ytt: Error: 
    - struct has no .config field or method (did you mean .configs?)
        in delivery
          stdin.yml:30 |   template: #@ data.values.config
        in <toplevel>
          stdin.yml:104 |   delivery.yml: #@ yaml.encode(delivery())

Cause

Cartographer creates an object on the cluster and then immediately tries to read a field from that object. For example, creating a kpack Image from the ootb templates, Cartographer will immediately attempt to read the .status.latestImage field of that kpack Image. The kpack Image has just been created and has to do its own reconciliation loop. There's no latestImage field yet in its status.

Cartographer will log that it can't read that value. It will also update the workload's status to indicate that it can't read a value from the object.

- type: ResourcesSubmitted
  status: Unknown
  reason: MissingValueAtPath
  message: Waiting to read value [.status.latestImage] from resource [images.kpack.io/my-app] in namespace [default]

The workload Ready status will remain Unknown, indicating that the workload is still reconciling.

Meanwhile, the kpack controller will have been notified that there's a new Image object which requires attention. When the kpack controller finishes reconciling the object, it will update the Image status and add a value for the latestImage key. Cartographer will be notified by the API server that the Image has been updated. Cartographer will read the newly available value and then propagate it to the next object in the supply chain.

 

Similar reasoning applies to the log message

unable to apply ytt template: ytt: Error:
- struct has no .SOME_NAME field or method

 

During each workload's reconcile, Cartographer creates an internal representation (the struct from the error message) of the values it has read from the created child objects. When it attempts to create a new child object it refers to these values (as well as referring to the workload spec, supply chain params, etc.). If an object relies on a value that has not been created yet, Cartographer logs that fact. Later, when child object N updates its status, Cartographer will then attempt to stamp out all the objects of the supply chain again. Step N+1 should succeed, Cartographer can propagate the information from step N. Step N+2 likely depends on step N+1, so Cartographer will continue to log that it cannot create object N+2.

Resolution

The three log messages:

  • failed to evaluate json path
  • unable to retrieve outputs
  • unable to apply ytt template

They are not problematic on their own. Users can expect to see such errors in the logs of Cartographer during normal operation.