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

upload-salt-reports hanging or killed #84

Closed
tek0011 opened this issue Jan 18, 2024 · 1 comment
Closed

upload-salt-reports hanging or killed #84

tek0011 opened this issue Jan 18, 2024 · 1 comment

Comments

@tek0011
Copy link

tek0011 commented Jan 18, 2024

We're trying to get salt reports uploaded to foreman and hitting an hang/kill issue in the script. I added some print commands to each of the functions. Looks like it gets to the run block where it appears to want to read /etc/salt/master config:

def run(*args, **kwargs):
    print("run")
    __opts__ = salt.config.master_config(
            os.environ.get('SALT_MASTER_CONFIG', '/etc/salt/master'))
    #print(__opts__)
    runner = salt.runner.Runner(__opts__)
    #print(runner)
    with io.open(os.devnull, 'w') as f:
        print("io open block")
        print(f)
        stdout_bak, sys.stdout = sys.stdout, f
        print("stdout block")
        try:
            ret = runner.cmd(*args, **kwargs)
            #print(ret)
        finally:
            sys.stdout = stdout_bak
    return ret['data'] if 'data' in ret else ret

Here is what that looks like when I run it:

[root@10-222-76-237 salt]# /usr/sbin/upload-salt-reports
get_lock
upload(jobs)
salt_config
jobs_to_upload
run
io open block
f is <_io.TextIOWrapper name='/dev/null' mode='w' encoding='UTF-8'>
Killed

Any idea what is going on here? I know that most of our salt config lives in /etc/salt/master.d/<confs> is this the issue?

@nadjaheitmann
Copy link
Contributor

Which software versions are you using? The script should not be run afaik #89 (comment)

@tek0011 tek0011 closed this as completed Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants