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

Running yq command via SSH will not close the output #2103

Closed
tjsturos opened this issue Jul 12, 2024 · 1 comment
Closed

Running yq command via SSH will not close the output #2103

tjsturos opened this issue Jul 12, 2024 · 1 comment
Labels

Comments

@tjsturos
Copy link

tjsturos commented Jul 12, 2024

When running a shell script (bash) that contains a yq command OR directly using yq via ssh command, the script or command will not terminate.

E.g. ssh my-ssh-config-hostname "yq '.settings.log_file' <path-to-config-file" will output the expected output from the file, but then will not terminate. My scripts then get hung up and will not continue.

When I run the same command from a logged in shell (not executing via ssh command), i.e. if I do ssh <ssh-config-hostname> and then in the logged in terminal run the same command, 'yq '.settings.log_file' " it outputs just fine and terminates awaiting the next command as expected.

Version of yq: 4.20.1
Operating system: Ubuntu 22.04 server
Installed via: download

#!/bin/bash
VERSION=v4.20.1
BINARY=yq_linux_amd64
COMPRESSED_FILENAME=${BINARY}.tar.gz
sudo wget -q https://github.com/mikefarah/yq/releases/download/${VERSION}/${COMPRESSED_FILENAME} 
tar -xzf $COMPRESSED_FILENAME &> /dev/null

if [ -f /usr/bin/yq ]; then
    sudo rm /usr/bin/yq
fi

sudo mv $BINARY /usr/bin/yq
sudo rm $COMPRESSED_FILENAME

Input Yaml
Concise yaml document(s) (as simple as possible to show the bug, please keep it to 10 lines or less)
data1.yml:

settings:
    cpulimit:
        enabled: false
        limit_percentage: 70
    install:
        ssh:
            disable_password_login: true
    debug: false
    log_file: debug.log

Command
The command you ran:

ssh my-host "yq '.settings.log_file' config.yml" 
// or
ssh my-host "command-that-calls-above-yq.sh"

Actual behavior

debug.log
<cursor awaiting command termination>

Expected behavior

debug.log
user@local-hostname:~/tools$
@tjsturos
Copy link
Author

This appears to be fixed when upgrading to 4.44.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant