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

github-com-improbable-eng-metahook-buildkite-plugin-v0-4-1/hooks/run-hook.sh: line 17: !var_name: unbound variable #10

Open
improbable-mattchurch opened this issue Sep 16, 2020 · 2 comments

Comments

@improbable-mattchurch
Copy link

improbable-mattchurch commented Sep 16, 2020

Running plugin metahook pre-command hook
# A hook runner was written to "C:\users\buildkite-agent\tmp\d6018259-8f4c-4680-a375-53215e54e7cd\buildkite-agent-bootstrap-hook-runner-106667881" with the following:
> C:\users\buildkite-agent\tmp\d6018259-8f4c-4680-a375-53215e54e7cd\buildkite-agent-bootstrap-hook-runner-106667881
# Attempting to run C:\users\buildkite-agent\tmp\d6018259-8f4c-4680-a375-53215e54e7cd\buildkite-agent-bootstrap-hook-runner-106667881 with Bash for Windows
c:/users/buildkite-agent/AppData/Local/buildkite-agent/plugins/github-com-improbable-eng-metahook-buildkite-plugin-v0-4-1/hooks/run-hook.sh: line 17: !var_name: unbound variable

It appears as though if you do not define a pre-command hook, it tries to execute it anyways and fails.

example of my plugin declaration:

  annotate-errors-plugin: &annotate-errors-plugin
    # https://github.com/improbable-eng/metahook-buildkite-plugin
    improbable-eng/metahook#v0.4.1:
      pre-exit: python "GameOne/.buildkite/metahooks/annotate_errors.py"

https://buildkite.com/improbable/midwinter-code/builds/674#d6018259-8f4c-4680-a375-53215e54e7cd/267-271

example of error no longer occurring if plugin is defined as:

  annotate-errors-plugin: &annotate-errors-plugin
    # https://github.com/improbable-eng/metahook-buildkite-plugin
    improbable-eng/metahook#v0.4.1:
      pre-command: echo "test"
      pre-exit: python "GameOne/.buildkite/metahooks/annotate_errors.py"

https://buildkite.com/improbable/midwinter-code/builds/680#b4e799c4-2a07-4f59-aa87-f8e834ef74ff

@improbable-mattchurch
Copy link
Author

improbable-mattchurch commented Sep 16, 2020

another example of the failure happening if pre-command isn't defined: https://buildkite.com/improbable/midwinter-code/builds/678#edd0b44c-688c-43d2-b775-71637c6be737/303-307

@improbable-mattchurch
Copy link
Author

Spoke with @ca-johnson and it seems that it's a bad idea to invoke metahook more than once in the same step. In my case I was using it for different clean up steps. If that's a problem, we should simply improve the error messaging to let users know not to do that

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

1 participant