airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "SANGAMESH PATIL (Jira)" <j...@apache.org>
Subject [jira] [Updated] (AIRFLOW-5557) Mongo Replica connection Hostname causing a crash
Date Thu, 26 Sep 2019 00:59:00 GMT

     [ https://issues.apache.org/jira/browse/AIRFLOW-5557?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

SANGAMESH PATIL updated AIRFLOW-5557:
-------------------------------------
    Description: 
Hi,

 

I tried to provide mongo hostname in replicated format as follows as hitting this error.. 

 hello-1:27017,hello-2:27017,hello-3:27017/?replicaSet=MongoReplica

Traceback (most recent call last):

File "/usr/local/bin/airflow", line 32, in <module>

   args.func(args)

File "/usr/local/lib/python3.6/site-packages/airflow/utils/cli.py", line 74, in wrapper

   return f(*args, **kwargs)

File "/usr/local/lib/python3.6/site-packages/airflow/bin/cli.py", line 523, in run

   _run(args, dag, ti)

File "/usr/local/lib/python3.6/site-packages/airflow/bin/cli.py", line 442, in _run

   pool=args.pool,

File "/usr/local/lib/python3.6/site-packages/airflow/utils/db.py", line 73, in wrapper

   return func(*args, **kwargs)

File "/usr/local/lib/python3.6/site-packages/airflow/models/__init__.py", line 1441, in _run_raw_task

   result = task_copy.execute(context=context)

File "/usr/local/lib/python3.6/site-packages/airflow/operators/python_operator.py", line 112,
in execute

   return_value = self.execute_callable()

File "/usr/local/lib/python3.6/site-packages/airflow/operators/python_operator.py", line 117,
in execute_callable

   return self.python_callable(*self.op_args, **self.op_kwargs)

File "/usr/local/airflow/dags/tasks/hooks/mongo.py", line 166, in __init__

   self._hook = MongoHook(conn_id="my_db")

File "/usr/local/lib/python3.6/site-packages/airflow/contrib/hooks/mongo_hook.py", line 40,
in __init__

   self.connection = self.get_connection(conn_id)

File "/usr/local/lib/python3.6/site-packages/airflow/hooks/base_hook.py", line 80, in get_connection

   conn = random.choice(cls.get_connections(conn_id))

File "/usr/local/lib/python3.6/site-packages/airflow/hooks/base_hook.py", line 71, in get_connections

   conn = cls._get_connection_from_env(conn_id)

File "/usr/local/lib/python3.6/site-packages/airflow/hooks/base_hook.py", line 66, in _get_connection_from_env

   conn = Connection(conn_id=conn_id, uri=environment_uri)

File "<string>", line 4, in __init__

File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/state.py", line 428, in _initialize_instance

   manager.dispatch.init_failure(self, args, kwargs)

File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 67, in
__exit__

   compat.reraise(exc_type, exc_value, exc_tb)

File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 277, in reraise

   raise value

File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/state.py", line 425, in _initialize_instance

   return manager.original_init(*mixed[1:], **kwargs)

File "/usr/local/lib/python3.6/site-packages/airflow/models/connection.py", line 117, in __init__

   self.parse_from_uri(uri)

File "/usr/local/lib/python3.6/site-packages/airflow/models/connection.py", line 142, in parse_from_uri

   self.port = uri_parts.port

File "/usr/local/lib/python3.6/urllib/parse.py", line 169, in port

   port = int(port, 10)

  was:
Hi,

 

I tried to provide mongo hostname in replicated format as follows as hitting this error.. 

 

Traceback (most recent call last):

 File "/usr/local/bin/airflow", line 32, in <module>

   args.func(args)

 File "/usr/local/lib/python3.6/site-packages/airflow/utils/cli.py", line 74, in wrapper

   return f(*args, **kwargs)

 File "/usr/local/lib/python3.6/site-packages/airflow/bin/cli.py", line 523, in run

   _run(args, dag, ti)

 File "/usr/local/lib/python3.6/site-packages/airflow/bin/cli.py", line 442, in _run

   pool=args.pool,

 File "/usr/local/lib/python3.6/site-packages/airflow/utils/db.py", line 73, in wrapper

   return func(*args, **kwargs)

 File "/usr/local/lib/python3.6/site-packages/airflow/models/__init__.py", line 1441, in _run_raw_task

   result = task_copy.execute(context=context)

 File "/usr/local/lib/python3.6/site-packages/airflow/operators/python_operator.py", line
112, in execute

   return_value = self.execute_callable()

 File "/usr/local/lib/python3.6/site-packages/airflow/operators/python_operator.py", line
117, in execute_callable

   return self.python_callable(*self.op_args, **self.op_kwargs)

 File "/usr/local/airflow/dags/tasks/hooks/mongo.py", line 166, in __init__

   self._hook = MongoHook(conn_id="my_db")

 File "/usr/local/lib/python3.6/site-packages/airflow/contrib/hooks/mongo_hook.py", line 40,
in __init__

   self.connection = self.get_connection(conn_id)

 File "/usr/local/lib/python3.6/site-packages/airflow/hooks/base_hook.py", line 80, in get_connection

   conn = random.choice(cls.get_connections(conn_id))

 File "/usr/local/lib/python3.6/site-packages/airflow/hooks/base_hook.py", line 71, in get_connections

   conn = cls._get_connection_from_env(conn_id)

 File "/usr/local/lib/python3.6/site-packages/airflow/hooks/base_hook.py", line 66, in _get_connection_from_env

   conn = Connection(conn_id=conn_id, uri=environment_uri)

 File "<string>", line 4, in __init__

 File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/state.py", line 428, in _initialize_instance

   manager.dispatch.init_failure(self, args, kwargs)

 File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 67, in
__exit__

   compat.reraise(exc_type, exc_value, exc_tb)

 File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 277, in reraise

   raise value

 File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/state.py", line 425, in _initialize_instance

   return manager.original_init(*mixed[1:], **kwargs)

 File "/usr/local/lib/python3.6/site-packages/airflow/models/connection.py", line 117, in
__init__

   self.parse_from_uri(uri)

 File "/usr/local/lib/python3.6/site-packages/airflow/models/connection.py", line 142, in
parse_from_uri 

   self.port = uri_parts.port

 File "/usr/local/lib/python3.6/urllib/parse.py", line 169, in port

   port = int(port, 10)


> Mongo Replica connection Hostname causing a crash 
> --------------------------------------------------
>
>                 Key: AIRFLOW-5557
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-5557
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: models
>    Affects Versions: 1.10.5
>            Reporter: SANGAMESH PATIL
>            Priority: Major
>
> Hi,
>  
> I tried to provide mongo hostname in replicated format as follows as hitting this error.. 
>  hello-1:27017,hello-2:27017,hello-3:27017/?replicaSet=MongoReplica
> Traceback (most recent call last):
> File "/usr/local/bin/airflow", line 32, in <module>
>    args.func(args)
> File "/usr/local/lib/python3.6/site-packages/airflow/utils/cli.py", line 74, in wrapper
>    return f(*args, **kwargs)
> File "/usr/local/lib/python3.6/site-packages/airflow/bin/cli.py", line 523, in run
>    _run(args, dag, ti)
> File "/usr/local/lib/python3.6/site-packages/airflow/bin/cli.py", line 442, in _run
>    pool=args.pool,
> File "/usr/local/lib/python3.6/site-packages/airflow/utils/db.py", line 73, in wrapper
>    return func(*args, **kwargs)
> File "/usr/local/lib/python3.6/site-packages/airflow/models/__init__.py", line 1441,
in _run_raw_task
>    result = task_copy.execute(context=context)
> File "/usr/local/lib/python3.6/site-packages/airflow/operators/python_operator.py", line
112, in execute
>    return_value = self.execute_callable()
> File "/usr/local/lib/python3.6/site-packages/airflow/operators/python_operator.py", line
117, in execute_callable
>    return self.python_callable(*self.op_args, **self.op_kwargs)
> File "/usr/local/airflow/dags/tasks/hooks/mongo.py", line 166, in __init__
>    self._hook = MongoHook(conn_id="my_db")
> File "/usr/local/lib/python3.6/site-packages/airflow/contrib/hooks/mongo_hook.py", line
40, in __init__
>    self.connection = self.get_connection(conn_id)
> File "/usr/local/lib/python3.6/site-packages/airflow/hooks/base_hook.py", line 80, in
get_connection
>    conn = random.choice(cls.get_connections(conn_id))
> File "/usr/local/lib/python3.6/site-packages/airflow/hooks/base_hook.py", line 71, in
get_connections
>    conn = cls._get_connection_from_env(conn_id)
> File "/usr/local/lib/python3.6/site-packages/airflow/hooks/base_hook.py", line 66, in
_get_connection_from_env
>    conn = Connection(conn_id=conn_id, uri=environment_uri)
> File "<string>", line 4, in __init__
> File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/state.py", line 428, in _initialize_instance
>    manager.dispatch.init_failure(self, args, kwargs)
> File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 67,
in __exit__
>    compat.reraise(exc_type, exc_value, exc_tb)
> File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 277, in
reraise
>    raise value
> File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/state.py", line 425, in _initialize_instance
>    return manager.original_init(*mixed[1:], **kwargs)
> File "/usr/local/lib/python3.6/site-packages/airflow/models/connection.py", line 117,
in __init__
>    self.parse_from_uri(uri)
> File "/usr/local/lib/python3.6/site-packages/airflow/models/connection.py", line 142,
in parse_from_uri
>    self.port = uri_parts.port
> File "/usr/local/lib/python3.6/urllib/parse.py", line 169, in port
>    port = int(port, 10)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message