argo-workflows: baseUrl doesnt appear to work

Pre-requisites

  • I have double-checked my configuration
  • I can confirm the issues exists when I tested with :latest
  • I’d like to contribute the fix myself (see contributing guide)

What happened/what you expected to happen?

When running the argo-server, I have added the environment variable BASE_HREF=/argo/. However, when I port-forward the argo-server to localhost, I notice that localhost:8081 still works and redirects to localhost:8081/workflows, and I can navigate the UI. However, if I try to navigate to localhost:8081/argo/ I get Uncaught SyntaxError: Unexpected token '<' (at main.2430295409b8b54e52ad.js:1:1). I confirmed in the logs that argo is picking up the BASE_HREF env var (see logs below), but it just seems to ignore it.

I expected to be able to see the UI on localhost:8081/argo. I am trying to use the BASE_HREF in order to point an nginx instance at the UI.

Here are the logs from the server:

time="2022-12-08T21:27:31.747Z" level=info msg="not enabling pprof debug endpoints"
time="2022-12-08T21:27:31.747Z" level=info authModes="[server client]" baseHRef=/argo/ managedNamespace=quilter-dev-sergiy namespace=quilter-dev-sergiy secure=false ssoNamespace=quilter-dev-sergiy
time="2022-12-08T21:27:31.747Z" level=warning msg="You are running in insecure mode. Learn how to enable transport layer security: https://argoproj.github.io/argo-workflows/tls/"
time="2022-12-08T21:27:31.747Z" level=info msg="SSO disabled"
time="2022-12-08T21:27:31.758Z" level=info msg="Starting Argo Server" instanceID= version=v3.4.3
time="2022-12-08T21:27:31.767Z" level=info msg="Creating event controller" asyncDispatch=false operationQueueSize=16 workerCount=4
time="2022-12-08T21:27:31.769Z" level=info msg="GRPC Server Max Message Size, MaxGRPCMessageSize, is set" GRPC_MESSAGE_SIZE=104857600
time="2022-12-08T21:27:31.770Z" level=info msg="Argo Server started successfully on http://localhost:2746" url="http://localhost:2746"
time="2022-12-08T21:27:51.135Z" level=info duration="80.64µs" method=GET path=index.html size=478 status=0

Version

3.4.3 or latest

Paste a small workflow that reproduces the issue. We must be able to run the workflow; don’t enter a workflows that uses private images.

N/A

Logs from the workflow controller

N/A

Logs from in your workflow’s wait container

N/A

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15

Commits related to this issue

Most upvoted comments

I think what some folks might be looking for here is actually rootpath support, which would modify the path Argo actually serves from (and would usually be used in tandem with BASE_HREF).

See #7767 which is an open enhancement request for that.

I confirmed in the logs that argo is picking up the BASE_HREF env var (see logs below), but it just seems to ignore it.

Did a bit more digging and I believe this is working correctly. The logs do show the env var being read and set correctly.

From my comment in #11401:

Also not actually sure if this is an Argo bug per se or just a cluster misconfiguration, as #3080 has various configurations for all sorts of Ingresses to get it to work

Ok so I looked through the BASE_HREF history in the repo (search BASE_HREF and baseHref) and there have not been changes to those in 3-4+ years, so I believe this is indeed due to cluster misconfiguration and therefore working correctly.

BASE_HREF does not change where Argo serves from, it changes what Argo interprets as the base. Per the Base HREF docs, it is intended for proxying. As in, if your Ingress has the Argo Server at /argo/, you’ll need to set BASE_HREF to /argo/. But if you have no proxy in front or are serving at / (i.e. not at a subpath), then you shouldn’t set BASE_HREF. See also MDN docs on the HTML base element.

If you aren’t proxying Argo to a subpath, then setting BASE_HREF to a subpath would be a misconfiguration. Only set BASE_HREF if you are proxying to a subpath.

A port-forward to localhost is not proxying to a subpath.