question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error in SSHOperator " 'NoneType' object has no attribute 'startswith' "

See original GitHub issue

Apache Airflow version: 1.10.10

What happened:

I wrote the following piece of code:

from datetime import datetime
from airflow import DAG
from airflow.contrib.operators.ssh_operator import SSHOperator


args = {
    'owner': 'airflow',
    'start_date': datetime(year=2020, month=7, day=21,
                           hour=3, minute=0, second=0),
    'provide_context': True,
}

dag = DAG(
    dag_id='test_ssh_operator',
    default_args=args,
    schedule_interval='@daily',
)

ssh_command = """
echo 'hello work'
"""
task = SSHOperator(
    task_id="check_ssh_perator",
    ssh_conn_id='ssh_default',
    command=ssh_command,
    do_xcom_push=True,
    dag=dag,
)

task

What you expected to happen: And I got the following error:

Broken DAG: [/etc/airflow/dags/dag_test_sshoperator.py] 'NoneType' object has no attribute 'startswith'

Anything else we need to know: I add new ssh connection in Admin–> Connections. and in Extra field, I put the following JSON:

{"key_file":"/root/.ssh/airflow-connector/id_ed25519",
"timeout": "10",
"compress": "false",
"no_host_key_check": "false",
"allow_host_key_change": "false"}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
kaxilcommented, Sep 12, 2020

Let us know if you need any help @MahsaSeifikar

1reaction
boring-cyborg[bot]commented, Aug 31, 2020

Thanks for opening your first issue here! Be sure to follow the issue template!

Read more comments on GitHub >

github_iconTop Results From Across the Web

[jira] [Commented] (AIRFLOW-6402) SSH operator exception
[jira] [Commented] (AIRFLOW-6402) SSH operator exception - 'NoneType' object has no attribute 'startswith' · ASF GitHub Bot (Jira) Mon, ...
Read more >
AttributeError: 'NoneType' object has no attribute 'startswith ...
while running the command >python manage.py runserver to launch the app. getting the below error, is there ...
Read more >
[GitHub] [airflow] kaxil edited a comment on issue #10656: Error in ...
This email appears to be a reply to another email, as it contains an ... #10656: Error in SSHOperator " 'NoneType' object has...
Read more >
AttributeError: 'NoneType' object has no attribute 'startswith'
I've been working on setting up a "simple" Flask app with a cloud-hosted postgres database. My app's config.py file includes the following ...
Read more >
AttributeError: 'NoneType' object has no attribute 'startswith'
If [phpdoc] html_output = isn't set then the plugin will fail with the error message "AttributeError: 'NoneType' object has no attribute 'startswith'" ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found