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

Recursion error loading SSH config #564

Closed
acdha opened this issue Aug 15, 2018 · 1 comment
Closed

Recursion error loading SSH config #564

acdha opened this issue Aug 15, 2018 · 1 comment

Comments

@acdha
Copy link

acdha commented Aug 15, 2018

I was attempting to use Fabric 2 to perform a couple basic tasks and hit an error where Invoke recursively its config until it gets a RecursionError. I suspect this is related to a non-trivial SSH config with a gateway but there's not an obvious connection.

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
fabric = "*"
patchwork = "*"
invoke = "*"

[dev-packages]

[requires]
python_version = "3.7"
from invoke import task

@task
def create_logging_directory(connection):
    connection.sudo("install -d -o ndnp -g ndnp -m 755 /var/log/chronam")

invoke.program.parse_collection: No default namespace provided, trying to load one from disk
invoke.loader.find: FilesystemLoader find starting at '/Users/cadams/Projects/chronam-deployment/legacy'
invoke.loader.find: Found module: '/Users/cadams/Projects/chronam-deployment/legacy/fabfile.py'
invoke.config._load_file: Didn't see any /Users/cadams/Projects/chronam-deployment/legacy/fabric.yaml, skipping.
invoke.config._load_file: Didn't see any /Users/cadams/Projects/chronam-deployment/legacy/fabric.yml, skipping.
invoke.config._load_file: Didn't see any /Users/cadams/Projects/chronam-deployment/legacy/fabric.json, skipping.
invoke.config.merge: Merging config sources in order onto new empty _config...
invoke.config.merge: Defaults: {'run': {'warn': False, 'hide': None, 'shell': '/bin/bash', 'pty': False, 'fallback': True, 'env': {}, 'replace_env': True, 'echo': False, 'encoding': None, 'out_stream': None, 'err_stream': None, 'in_stream': None, 'watchers': [], 'echo_stdin': None}, 'runners': {'local': <class 'invoke.runners.Local'>, 'remote': <class 'fabric.runners.Remote'>}, 'sudo': {'prompt': '[sudo] password: ', 'password': None, 'user': None}, 'tasks': {'dedupe': True, 'auto_dash_names': True, 'collection_name': 'fabfile', 'search_root': None}, 'connect_kwargs': {}, 'forward_agent': False, 'gateway': None, 'inline_ssh_env': False, 'load_ssh_configs': True, 'port': 22, 'ssh_config_path': None, 'timeouts': {'connect': None}, 'user': 'cadams'}
invoke.config.merge: Collection-driven: {}
invoke.config._merge_file: System-wide config file (/etc/fabric.py): {}
invoke.config._merge_file: Per-user config file (/Users/cadams/.fabric.py): {}
invoke.config._merge_file: Per-project config file (/Users/cadams/Projects/chronam-deployment/legacy/fabric.py): {'get_config': <function get_config at 0x10538f598>, 'connect_kwargs': {'password': b''}}
invoke.config.merge: Environment variable config: {}
invoke.config._merge_file: Runtime config file has not been loaded yet, skipping
invoke.config.merge: Overrides: {}
invoke.config.merge: Modifications: {}
invoke.config.merge: Deletions: {}
invoke.parser.__init__: Adding <parser/Context 'create-logging-directory'>
invoke.program.parse_tasks: Parsing tasks against <Collection 'fabfile': create-logging-directory>
invoke.parser.__init__: Initialized with context: <parser/Context: {'complete': <Argument: complete [bool]>, 'debug': <Argument: debug (d) [bool]>, 'prompt-for-sudo-password': <Argument: prompt-for-sudo-password [bool]>, 'write-pyc': <Argument: write-pyc [bool]>, 'echo': <Argument: echo (e) [bool]>, 'config': <Argument: config (f)>, 'help': <Argument: help (h) ?>, 'hide': <Argument: hide>, 'list': <Argument: list (l) ?>, 'list-depth': <Argument: list-depth (D) [int]>, 'list-format': <Argument: list-format (F)>, 'pty': <Argument: pty (p) [bool]>, 'version': <Argument: version (V) [bool]>, 'warn-only': <Argument: warn-only (w) [bool]>, 'S': <Argument: S (ssh-config)>, 'H': <Argument: H (hosts)>, 'i': <Argument: i (identity) [list]>, 'prompt-for-login-password': <Argument: prompt-for-login-password [bool]>, 'prompt-for-passphrase': <Argument: prompt-for-passphrase [bool]>, 'collection': <Argument: collection (c)>, 'no-dedupe': <Argument: no-dedupe [bool]>, 'search-root': <Argument: search-root (r)>}>
invoke.parser.__init__: Available contexts: {'create-logging-directory': <parser/Context 'create-logging-directory'>}
invoke.parser.complete_context: Wrapping up context None
invoke.parser.parse_argv: Starting argv: ['create-logging-directory']
invoke.parser.handle: Handling token: 'create-logging-directory'
invoke.parser.changing_state: ParseMachine: 'context' => 'context'
invoke.parser.complete_context: Wrapping up context None
invoke.parser.switch_to_context: Moving to context 'create-logging-directory'
invoke.parser.switch_to_context: Context args: {}
invoke.parser.switch_to_context: Context flags: {}
invoke.parser.switch_to_context: Context inverse_flags: {}
invoke.parser.changing_state: ParseMachine: 'context' => 'end'
invoke.parser.complete_context: Wrapping up context 'create-logging-directory'
invoke.program.parse_tasks: Resulting task contexts: [<parser/Context 'create-logging-directory'>]
…
  File "/Users/cadams/.virtualenvs/legacy-4Y3otAMs/lib/python3.7/site-packages/fabric/connection.py", line 331 in __init__
  File "/Users/cadams/.virtualenvs/legacy-4Y3otAMs/lib/python3.7/site-packages/fabric/connection.py", line 331 in __init__
  File "/Users/cadams/.virtualenvs/legacy-4Y3otAMs/lib/python3.7/site-packages/fabric/connection.py", line 331 in __init__
  ...
@bitprophet
Copy link
Member

Yea, this is in Fabric 2 itself and seems to be around how we translate SSH configs, specifically ProxyJump gateways. It shouldn't be terrifically relevant to the Invoke config layer so I'm moving it to the Fabric repo - see fabric/fabric#1850

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