Uploaded image for project: 'Red Hat Internal Developer Platform'
  1. Red Hat Internal Developer Platform
  2. RHIDP-4078

Trailing slash in ArgoCD URL plugin config results in HTTP errors

Prepare for Y ReleasePrepare for Z ReleaseRemove QuarterXMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False
    • Low

      Description of problem:

      A trailing slash in the Argo CD URL results in a "Method Not Allowed" error at runtime.

      Prerequisites (if any, like setup, operators/versions):

      A cluster with Argo CD and Developer Hub installed. Also, a Component registered in RHDH that references an Argo CD Application.

      Steps to Reproduce

      1. Configure Argo CD per the docs (https://docs.redhat.com/en/documentation/red_hat_developer_hub/1.2/html-single/configuring_plugins_in_red_hat_developer_hub/index#rhdh-argocd)
      2. Leave a trailing slash on the Argo CD URL, e.g "url: https://argoInstance1.com/"
      3. Access the CD tab for the Component in the RHDH Catalog.

      Actual results:

      The CD page shows a 500 error. Logs for the RHDH Pod show that Argo CD returns a "Method Not Allowed Error".

      {{

      {"level":"info","message":"Getting apps for selector rhdh.app/name=parasol on appsargocd","plugin":"argocd","service":"backstage","timestamp":"2024-09-18 13:23:53"}

      }}
      {{

      {"level":"error","message":"failed to get argo token: https://openshift-gitops-server-openshift-gitops.apps-crc.testing/","plugin":"argocd","service":"backstage","timestamp":"2024-09-18 13:23:53"}

      }}
      2024-09-18T13:23:53.873Z backstage error Request failed with status 500 invalid json response body at https://openshift-gitops-server-openshift-gitops.apps-crc.testing/api/v1/session reason: Unexpected token 'M', "Method Not Allowed
      " is not valid JSON type=invalid-json stack=FetchError: invalid json response body at https://openshift-gitops-server-openshift-gitops.apps-crc.testing/api/v1/session reason: Unexpected token 'M', "Method Not Allowed
      " is not valid JSON

      Expected results:

      The trailing slash should be handled correctly by the RHDH backend, or the backend should produce a validation error on startup.

      Reproducibility (Always/Intermittent/Only Once):

      Always.

      Build Details:

      RHDH Version: 1.2.2
      Backstage Version: 1.26.5
      Upstream: janus-idp/backstage-showcase 1.2.x @ c14d6dac
      Midstream: gitlab.cee.redhat.com/rhidp/rhdh rhdh-1.2-rhel-9 @ 01df3afc
      Build Time: 2024-08-19T03:35:16Z

      Additional info (Such as Logs, Screenshots, etc):

            Unassigned Unassigned
            eshortis Evan Shortiss
            RHIDP - Plugins
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: