Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARGO_LOG_LEVEL has no effect #41

Closed
juliev0 opened this issue Oct 9, 2023 · 12 comments · Fixed by argoproj/argo-workflows#11978
Closed

ARGO_LOG_LEVEL has no effect #41

juliev0 opened this issue Oct 9, 2023 · 12 comments · Fixed by argoproj/argo-workflows#11978
Labels
bug Something isn't working

Comments

@juliev0
Copy link

juliev0 commented Oct 9, 2023

If I set:

- name: controller
  env:
    - ARGO_LOG_LEVEL=debug

in argo-workflows' tasks.yaml file, it seems to have no effect. (I haven't tried the other environment variables.)

@alexec
Copy link
Collaborator

alexec commented Oct 10, 2023

WFM?

Can you try this:

apiVersion: kit/v1
kind: Tasks
metadata:
  name: kit
spec:
  semaphores:
    two: 2
  tasks:
  - name: test
    command: sh -c "echo FOO=$FOO"
    env:
      - FOO=bar
CI=1 kit test

You should see:

■ test       running  FOO=bar

@alexec alexec added the bug Something isn't working label Oct 10, 2023
@juliev0
Copy link
Author

juliev0 commented Oct 10, 2023

yes, I see something similar at least:

jvogelman@macos-VF3V14X2QJ test % CI=1 kit test
2023/10/09 17:59:05 tag=v0.1.5

2023/10/09 17:59:05 isTerminal=true, isCI=true
2023/10/09 17:59:05 tasks: [{test   <nil> <nil> sh -c echo FOO=$FOO    [FOO=bar] [] [] false     }]
2023/10/09 17:59:05 semaphores=&{0xc000268c60 map[two:2]}
2023/10/09 17:59:05 test: starting process
2023/10/09 17:59:05 test: resetting process
2023/10/09 17:59:05 test: running process
2023/10/09 17:59:05 test: starting process "sh -c echo FOO=$FOO"
2023/10/09 17:59:05 test: started process "sh -c echo FOO=$FOO": <nil>
2023/10/09 17:59:05 test: getting pgid for 98388
2023/10/09 17:59:05 test: pgid for 98388 is 98388 <nil>
2023/10/09 17:59:05 test: waiting for process 98388 pgid 98388 ("sh -c echo FOO=$FOO")
test: FOO=bar
2023/10/09 17:59:05 test: process exited 98388: <nil>
2023/10/09 17:59:05 test: starting downstream tasks
2023/10/09 17:59:05 test: context cancelled, stopping process
2023/10/09 17:59:05 test: stopping process 98388
2023/10/09 17:59:05 test: finding process 98388
2023/10/09 17:59:05 test: terminating process 98388
2023/10/09 17:59:05 test: waiting 3s before killing 98388

@juliev0
Copy link
Author

juliev0 commented Oct 10, 2023

if it works for you and not for me, maybe I'm on an old version?

@alexec
Copy link
Collaborator

alexec commented Oct 10, 2023

It could be something subtle going on, e.g. typo in name?

Try a newer version and see if you can repro in a Codespace.

@juliev0
Copy link
Author

juliev0 commented Oct 10, 2023

confirmed it is newest version I'm running:

jvogelman@macos-VF3V14X2QJ argo-workflows % which kit
/usr/local/bin/kit
jvogelman@macos-VF3V14X2QJ argo-workflows % ls -l /usr/local/bin/kit
lrwxr-xr-x  1 jvogelman  admin  28 Oct  9 18:06 /usr/local/bin/kit -> ../Cellar/kit/0.1.13/bin/kit

What are you running from argo-workflows directory? make start? kit up?

@juliev0
Copy link
Author

juliev0 commented Oct 10, 2023

Please correct me where my process could be wrong:

  1. Modify tasks.yaml file to change "info" to "debug" for "ARGO_LOG_LEVEL" in both places
  2. Run "make start" or "kit up"
  3. tail controller.log and see "level=debug" in the log lines

@juliev0
Copy link
Author

juliev0 commented Oct 10, 2023

It seems like the only way this can work is if the workflow-controller actually reads the environment variable $ARGO_LOG_LEVEL, which I don't think it does. Rather, I believe it can take the "--loglevel" as a command line argument.

So, does that imply that the command listed in tasks.yaml should have all of those command line arguments passed in? e.g. command: "./dist/workflow-controller --loglevel $ARGO_LOG_LEVEL"

@juliev0
Copy link
Author

juliev0 commented Oct 10, 2023

seems to be that you need to use "ARGO_LOGLEVEL" rather than "ARGO_LOG_LEVEL", but the latter is what's used in workflows

@alexec
Copy link
Collaborator

alexec commented Oct 10, 2023

So, not an issue?

@alexec alexec closed this as completed Oct 10, 2023
@juliev0
Copy link
Author

juliev0 commented Oct 10, 2023

An issue with Argo Workflows repo

@agilgur5
Copy link

agilgur5 commented Oct 10, 2023

ARGO_LOG_LEVEL is used in a few places. Simple to fix if that is the case.
Guess no one expected it was a simple misconfiguration from Alex and instead thought it must've been a more complex bug somewhere 😄

Also confirmed myself that the flag is loglevel and with the automatic env prefix, that becomes ARGO_LOGLEVEL. I can make a quick fix for that.

Thank you both for debugging!

@agilgur5
Copy link

agilgur5 commented Oct 10, 2023

Raised PR to fix this in Workflows: argoproj/argo-workflows#11978

Can confirm that it is working there after the fix. Though I found another issue in Workflows that the Server currently ignores the env var for loglevel as well 😅 (similarly not a Kit issue though)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants