argoproj / argo-workflows

Workflow Engine for Kubernetes
https://argo-workflows.readthedocs.io/
Apache License 2.0
15.04k stars 3.2k forks source link

UI does not load at `/` if `server.baseHref` is not `/` #13426

Closed kworkbee closed 3 months ago

kworkbee commented 3 months ago

Pre-requisites

What happened? What did you expect to happen?

UI Asset does not load if server.baseHref is not root

Version(s)

v3.4.11,v3.5.9

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

Use Helm Chart Default Values and change only `server.baseHref`

Logs from the workflow controller

kubectl logs -n argo deploy/workflow-controller | grep ${workflow}

time="2024-08-02T05:42:42Z" level=info msg="index config" indexWorkflowSemaphoreKeys=true
time="2024-08-02T05:42:42Z" level=info msg="cron config" cronSyncPeriod=10s
time="2024-08-02T05:42:42Z" level=info msg="Memoization caches will be garbage-collected if they have not been hit after" gcAfterNotHitDuration=30s
time="2024-08-02T05:42:42.332Z" level=info msg="not enabling pprof debug endpoints"
time="2024-08-02T05:42:42.349Z" level=info msg="Configuration:\nartifactRepository: {}\ninitialDelay: 0s\nmetricsConfig: {}\nnodeEvents:\n  enabled: true\npodSpecLogStrategy: {}\nsso:\n  clientId:\n    key: \"\"\n  clientSecret:\n    key: \"\"\n  issuer: \"\"\n  redirectUrl: \"\"\n  sessionExpiry: 0s\ntelemetryConfig: {}\n"
time="2024-08-02T05:42:42.349Z" level=info msg="Persistence configuration disabled"
time="2024-08-02T05:42:42.349Z" level=info executorImage="quay.io/argoproj/argoexec:v3.4.11" executorImagePullPolicy= managedNamespace=testable-argo-workflows
I0802 05:42:42.351003       1 leaderelection.go:248] attempting to acquire leader lease testable-argo-workflows/workflow-controller...
time="2024-08-02T05:42:42.351Z" level=info msg="Starting dummy metrics server at localhost:9090/metrics"
I0802 05:42:42.371491       1 leaderelection.go:258] successfully acquired lease testable-argo-workflows/workflow-controller
time="2024-08-02T05:42:42.371Z" level=info msg="new leader" leader=name-workflow-controller-767bb8dfc6-xmhvs
time="2024-08-02T05:42:42.371Z" level=info msg="Starting Workflow Controller" defaultRequeueTime=10s version=v3.4.11
time="2024-08-02T05:42:42.371Z" level=info msg="Current Worker Numbers" podCleanup=4 workflow=32 workflowTtl=4
time="2024-08-02T05:42:42.371Z" level=info msg="Successfully shutdown dummy metrics server at localhost:9090/metrics"
time="2024-08-02T05:42:42.371Z" level=info msg="Watching task results" labelSelector="!workflows.argoproj.io/controller-instanceid,workflows.argoproj.io/workflow"
time="2024-08-02T05:42:42.372Z" level=info msg=Plugins executorPlugins=false
time="2024-08-02T05:42:42.372Z" level=info msg="Starting prometheus metrics server at localhost:9090/metrics"
time="2024-08-02T05:42:42.386Z" level=info msg="Manager initialized successfully"
time="2024-08-02T05:42:42.394Z" level=info msg="Received Workflow Controller config map testable-argo-workflows/name-workflow-controller-configmap update"
time="2024-08-02T05:42:42.402Z" level=info msg="Configuration:\nartifactRepository: {}\ninitialDelay: 0s\nmetricsConfig: {}\nnodeEvents:\n  enabled: true\npodSpecLogStrategy: {}\nsso:\n  clientId:\n    key: \"\"\n  clientSecret:\n    key: \"\"\n  issuer: \"\"\n  redirectUrl: \"\"\n  sessionExpiry: 0s\ntelemetryConfig: {}\n"
time="2024-08-02T05:42:42.402Z" level=info msg="Persistence configuration disabled"
time="2024-08-02T05:42:42.402Z" level=info executorImage="quay.io/argoproj/argoexec:v3.4.11" executorImagePullPolicy= managedNamespace=testable-argo-workflows
time="2024-08-02T05:42:42.502Z" level=info msg="Performing periodic GC" periodicity=5m0s
time="2024-08-02T05:42:42.502Z" level=info msg="Persistence disabled - so archived workflow GC disabled - you must restart the controller if you enable this"
time="2024-08-02T05:42:42.502Z" level=info msg="Starting CronWorkflow controller"
time="2024-08-02T05:42:42.502Z" level=info msg="Starting workflow garbage collector controller (retentionWorkers 4)"
time="2024-08-02T05:42:42.502Z" level=info msg="Started workflow garbage collection"
W0802 05:42:42.503006       1 shared_informer.go:401] The sharedIndexInformer has started, run more than once is not allowed

Logs from in your workflow's wait container

kubectl logs -n argo -c wait -l workflows.argoproj.io/workflow=${workflow},workflow.argoproj.io/phase!=Succeeded

-
kworkbee commented 3 months ago

When server.baseHref: / image

When server.baseHref: /argo/ image

Error message shows below:

Uncaught SyntaxError: Unexpected token '<' (at main.c2c2b195db7f7541a0ad.js:1:1)
kworkbee commented 3 months ago

Hello @agilgur5, Can you PTAL?

agilgur5 commented 3 months ago

When server.baseHref: /argo/

If you're setting a BASE_HREF, you need to access it through that base. Your URL is missing /argo/ in it. It's also not clear if you have a proxy in front, and setting BASE_HREF without a proxy is a misconfiguration.

Please see https://github.com/argoproj/argo-workflows/issues/11401#issuecomment-1685833712 which refers to the Base HREF docs for more details.

Duplicate of #12217, #11401, #10194, #3080, and more.

Use Helm Chart Default Values and change only server.baseHref

This repo also has no Helm Charts in it. In terms of this repo, you should use the output of that value, which is an env var, BASE_HREF

Hello @agilgur5, Can you PTAL?

I'm also not sure why you tagged me specifically. I don't recall interacting with you previously and this looks like your first ever comment in this repo. To be clear, I am a volunteer and am not paid to provide support.

If you had looked at previous issues and saw me there, then it should be clear that this is a misconfiguration and not a bug, as I have said there and as other users resolved their own configurations without any source code changes to Argo.