Error: "invalid character '<' looking for beginning of value" when configuring Harbor replication to Bitnami Secure Image registry
search cancel

Error: "invalid character '<' looking for beginning of value" when configuring Harbor replication to Bitnami Secure Image registry

book

Article ID: 418124

calendar_today

Updated On:

Products

VMware Tanzu Platform - Kubernetes VMware Tanzu Kubernetes Grid Integrated Edition VMware Tanzu Kubernetes Grid Integrated Edition (Core)

Issue/Introduction

This issue happens during Harbor replication, when following the documentation for Consuming Bitnami Secure Images using a Private Harbor Repo

The error message observed on the replication failure can look similar to the following:

failed to fetch artifacts: failed to list artifacts of repository hosted-registry-##########/<image_name>: invalid character '<' looking for beginning of value

 

When reviewing the harbor-container-registry deployment logs, you will be able to see errors similar to the following in the harbor-app-logs. In the core.log you may find "http status code: 403".

month ## ##:##:## ###.##.#.# core[####]: ####-##-##T##:##:##Z [ERROR] [/pkg/reg/adapter/googlegcr/adapter.go:137]: failed to ping registry http://us-docker.pkg.dev/vmw-app-catalog/hosted-registry-##########: http status code: 403, body: 
month ## ##:##:## ###.##.#.# core[####]: <!DOCTYPE html>
month ## ##:##:## ###.##.#.# core[####]: <html lang=en>
month ## ##:##:## ###.##.#.# core[####]:   <meta charset=utf-8>
month ## ##:##:## ###.##.#.# core[####]:   <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
month ## ##:##:## ###.##.#.# core[####]:   <title>Error 403 (Forbidden)!!1</title>
month ## ##:##:## ###.##.#.# core[####]:   <style>

 

Cause

This issue can be caused by a mismatch between name of the registry used in the Replication Rule on the field Source resource filter:

And the name registered in Bitnami Secure Images:

Resolution

In the Replication Rule verify the following:

  • The name used in the Source resource filter matches exactly the information from the Bitnami Secure Images. To find this you need to go to:
    • Bitnami secure images -> Registries -> VMware Hosted Registries -> Registry URL

  • Make sure that in the Source resource filter you include only the reference to the Bitnami Secure Image catalog:
    • For example in the following URL: http://us-docker.pkg.dev/vmw-app-catalog/hosted-registry-##########
      • The catalog reference is only: vmw-app-catalog/hosted-registry-##########