You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/12/06 16:00:48 UTC

[GitHub] [airflow] bskim45 opened a new issue #12855: Unable to import Airflow plugins

bskim45 opened a new issue #12855:
URL: https://github.com/apache/airflow/issues/12855


   <!--
   
   Welcome to Apache Airflow!  For a smooth issue process, try to answer the following questions.
   Don't worry if they're not all applicable; just try to include what you can :-)
   
   If you need to include code snippets or logs, please put them in fenced code
   blocks.  If they're super-long, please use the details tag like
   <details><summary>super-long log</summary> lots of stuff </details>
   
   Please delete these comment blocks before submitting the issue.
   
   -->
   
   <!--
   
   IMPORTANT!!!
   
   PLEASE CHECK "SIMILAR TO X EXISTING ISSUES" OPTION IF VISIBLE
   NEXT TO "SUBMIT NEW ISSUE" BUTTON!!!
   
   PLEASE CHECK IF THIS ISSUE HAS BEEN REPORTED PREVIOUSLY USING SEARCH!!!
   
   Please complete the next sections or the issue will be closed.
   These questions are the first thing we need to know to understand the context.
   
   -->
   
   **Apache Airflow version**:
   `1.10.14rc1`
   
   **Kubernetes version (if you are using kubernetes)** (use `kubectl version`):
   nop
   
   **Environment**:
   
   - **Cloud provider or hardware configuration**: docker (linux)
   - **OS** (e.g. from /etc/os-release): Debian GNU/Linux 10 (buster) (official docker image)
   - **Kernel** (e.g. `uname -a`): Linux 5.4.39
   - **Install tools**: official docker image with docker-compose
   - **Others**:
   
   **What happened**:
   
   Unable to import Airflow plugins.
   
   Here is a bit more context:
   [2020-12-06 15:33:25,513] {plugins_manager.py:159} ERROR - Failed to import plugin AirflowPrometheus
   worker_1     | Traceback (most recent call last):
   worker_1     |   File "/home/airflow/.local/lib/python3.8/site-packages/airflow/plugins_manager.py", line 150, in load_entrypoint_plugins
   worker_1     |     plugin_obj.__usable_import_name = entry_point.module
   worker_1     | AttributeError: 'EntryPoint' object has no attribute 'module'
   worker_1     | Traceback (most recent call last):
   worker_1     |   File "/home/airflow/.local/lib/python3.8/site-packages/airflow/plugins_manager.py", line 150, in load_entrypoint_plugins
   worker_1     |     plugin_obj.__usable_import_name = entry_point.module
   worker_1     | AttributeError: 'EntryPoint' object has no attribute 'module'
   
   
   **What you expected to happen**:
   Airflow plugins are loaded without problem.
   
   **How to reproduce it**:
   From official latest docker image:
   ```
   FROM apache/airflow:1.10.13-python3.8
   RUN pip install --no-cache-dir --user -U apache-airflow==1.10.14rc1 airflow-exporter==1.3.0
   ```
   
   **Anything else we need to know**:
   
   I guess it's related to recent changes in apache/airflow#12694. I have little knowledge on `importlib`, but it seems like there's no `module` nor `module_name` in `importlib.metadata.EntryPoint`.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on issue #12855: Unable to import Airflow plugins

Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #12855:
URL: https://github.com/apache/airflow/issues/12855#issuecomment-739547430


   > OH GAD.
   > 
   > Paging @mjpieters -- turns out we _do_ need the backported module more often :(
   
   I guess it is the same story as with importlib_resources Sounds like rc2 IMHO ? 
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] mjpieters commented on issue #12855: Unable to import Airflow plugins

Posted by GitBox <gi...@apache.org>.
mjpieters commented on issue #12855:
URL: https://github.com/apache/airflow/issues/12855#issuecomment-739549115


   > i.e. remove `; python_version<"3.8"` bit 
   
   Not *remove*; update 3.8 to 3.9.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] kaxil commented on issue #12855: Unable to import Airflow plugins

Posted by GitBox <gi...@apache.org>.
kaxil commented on issue #12855:
URL: https://github.com/apache/airflow/issues/12855#issuecomment-739549338


   Does 3.9 contain the `.module` parameter though? I know we officially don't support Py3.9 yet with 1.10.14 but do why do we not want to install it for 3.9 ?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] kaxil commented on issue #12855: Unable to import Airflow plugins

Posted by GitBox <gi...@apache.org>.
kaxil commented on issue #12855:
URL: https://github.com/apache/airflow/issues/12855#issuecomment-739549536


   Aah ok, Cool 👍 Will create PRs / cherry-picks straigh-away too cut 1.10.14rc2 tonight 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] kaxil commented on issue #12855: Unable to import Airflow plugins

Posted by GitBox <gi...@apache.org>.
kaxil commented on issue #12855:
URL: https://github.com/apache/airflow/issues/12855#issuecomment-739542915


   cc @ashb -- Any ideas here?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] kaxil commented on issue #12855: Unable to import Airflow plugins

Posted by GitBox <gi...@apache.org>.
kaxil commented on issue #12855:
URL: https://github.com/apache/airflow/issues/12855#issuecomment-739577775


   closed by https://github.com/apache/airflow/pull/12859


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] boring-cyborg[bot] commented on issue #12855: Unable to import Airflow plugins

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #12855:
URL: https://github.com/apache/airflow/issues/12855#issuecomment-739523090


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


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] kaxil edited a comment on issue #12855: Unable to import Airflow plugins

Posted by GitBox <gi...@apache.org>.
kaxil edited a comment on issue #12855:
URL: https://github.com/apache/airflow/issues/12855#issuecomment-739546519


   Oh looks like that might just be an issue with Python 3.8 where `importlib.metadata` does not have `.module` but if you use Python 3.7 which uses `importlib_metadata` that has `.module`  
   
   https://importlib-metadata.readthedocs.io/en/latest/using.html#entry-points:
   
   ```python
   >>> eps = entry_points()
   >>> list(eps)
   ['console_scripts', 'distutils.commands', 'distutils.setup_keywords', 'egg_info.writers', 'setuptools.installation']
   >>> scripts = eps['console_scripts']
   >>> wheel = [ep for ep in scripts if ep.name == 'wheel'][0]
   >>> wheel
   EntryPoint(name='wheel', value='wheel.cli:main', group='console_scripts')
   >>> wheel.module
   'wheel.cli'
   >>> wheel.attr
   'main'
   >>> wheel.extras
   []
   >>> main = wheel.load()
   >>> main
   <function main at 0x103528488>
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] kaxil commented on issue #12855: Unable to import Airflow plugins

Posted by GitBox <gi...@apache.org>.
kaxil commented on issue #12855:
URL: https://github.com/apache/airflow/issues/12855#issuecomment-739548146


   Indeed, we need to remove the following line from setup.py:
   
   ```
   'importlib-metadata~=2.0; python_version<"3.8"',
   ```
   
   i.e. remove `; python_version<"3.8"` bit 
   
   Time for 1.10.14rc2 :(


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] mjpieters commented on issue #12855: Unable to import Airflow plugins

Posted by GitBox <gi...@apache.org>.
mjpieters commented on issue #12855:
URL: https://github.com/apache/airflow/issues/12855#issuecomment-739548812


   Alternatively: don't use the module and attr attributes and fetch the  values yourself:
   
   ```python
   match = entrypoint.pattern.match(entrypoint.value)
   module, attr = match["module"], match["attr"]
   ```
   
   This is what those attributes fetch (as property objects).  It's trivially poked in if needed.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] kaxil edited a comment on issue #12855: Unable to import Airflow plugins

Posted by GitBox <gi...@apache.org>.
kaxil edited a comment on issue #12855:
URL: https://github.com/apache/airflow/issues/12855#issuecomment-739546519


   Oh looks like that might just be an issue with Python 3.8 where `importlib.metadata` does not have `.module` but if you use Python 3.7 which uses `importlib_metadata` that has `.module`  
   
   https://importlib-metadata.readthedocs.io/en/latest/using.html#entry-points:
   
   ```
   >>> eps = entry_points()
   >>> list(eps)
   ['console_scripts', 'distutils.commands', 'distutils.setup_keywords', 'egg_info.writers', 'setuptools.installation']
   >>> scripts = eps['console_scripts']
   >>> wheel = [ep for ep in scripts if ep.name == 'wheel'][0]
   >>> wheel
   EntryPoint(name='wheel', value='wheel.cli:main', group='console_scripts')
   >>> wheel.module
   'wheel.cli'
   >>> wheel.attr
   'main'
   >>> wheel.extras
   []
   >>> main = wheel.load()
   >>> main
   <function main at 0x103528488>
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] mjpieters commented on issue #12855: Unable to import Airflow plugins

Posted by GitBox <gi...@apache.org>.
mjpieters commented on issue #12855:
URL: https://github.com/apache/airflow/issues/12855#issuecomment-739547813


   The solution is to install the backport on 3.8 too.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ashb commented on issue #12855: Unable to import Airflow plugins

Posted by GitBox <gi...@apache.org>.
ashb commented on issue #12855:
URL: https://github.com/apache/airflow/issues/12855#issuecomment-739549436


   Yes, 3.9 does contain it https://github.com/python/cpython/blob/3.9/Lib/importlib/metadata.py#L81-L84


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] kaxil closed issue #12855: Unable to import Airflow plugins

Posted by GitBox <gi...@apache.org>.
kaxil closed issue #12855:
URL: https://github.com/apache/airflow/issues/12855


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] kaxil edited a comment on issue #12855: Unable to import Airflow plugins

Posted by GitBox <gi...@apache.org>.
kaxil edited a comment on issue #12855:
URL: https://github.com/apache/airflow/issues/12855#issuecomment-739546519


   Oh looks like that might just be an issue with Python 3.8 where `importlib.metadata` does not have `.module` but if you use Python 3.7 which uses `importlib_metadata` that has `.module`  
   
   https://importlib-metadata.readthedocs.io/en/latest/using.html#entry-points:
   
   ```python
   >>> eps = entry_points()
   >>> list(eps)
   ['console_scripts', 'distutils.commands', 'distutils.setup_keywords', 'egg_info.writers', 'setuptools.installation']
   >>> scripts = eps['console_scripts']
   >>> wheel = [ep for ep in scripts if ep.name == 'wheel'][0]
   >>> wheel
   EntryPoint(name='wheel', value='wheel.cli:main', group='console_scripts')
   >>> wheel.module
   'wheel.cli'
   >>> wheel.attr
   'main'
   >>> wheel.extras
   []
   >>> main = wheel.load()
   >>> main
   <function main at 0x103528488>
   ```
   
   While the same is not true for `importlib.metadata`:
   
   https://docs.python.org/3.8/library/importlib.metadata.html#entry-points
   
   ```python
   >>> eps = entry_points()  
   >>> list(eps)  
   ['console_scripts', 'distutils.commands', 'distutils.setup_keywords', 'egg_info.writers', 'setuptools.installation']
   >>> scripts = eps['console_scripts']  
   >>> wheel = [ep for ep in scripts if ep.name == 'wheel'][0]  
   >>> wheel  
   EntryPoint(name='wheel', value='wheel.cli:main', group='console_scripts')
   >>> main = wheel.load()  
   >>> main  
   <function main at 0x103528488>
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] kaxil edited a comment on issue #12855: Unable to import Airflow plugins

Posted by GitBox <gi...@apache.org>.
kaxil edited a comment on issue #12855:
URL: https://github.com/apache/airflow/issues/12855#issuecomment-739546519


   Oh looks like that might just be an issue with Python 3.8 where `importlib.metadata` does not have `.module` but if you use Python 3.7 which uses `importlib_metadata` that has `.module`  
   
   https://importlib-metadata.readthedocs.io/en/latest/using.html#entry-points:
   
   ```python
   >>> eps = entry_points()
   >>> list(eps)
   ['console_scripts', 'distutils.commands', 'distutils.setup_keywords', 'egg_info.writers', 'setuptools.installation']
   >>> scripts = eps['console_scripts']
   >>> wheel = [ep for ep in scripts if ep.name == 'wheel'][0]
   >>> wheel
   EntryPoint(name='wheel', value='wheel.cli:main', group='console_scripts')
   >>> wheel.module
   'wheel.cli'
   >>> wheel.attr
   'main'
   >>> wheel.extras
   []
   >>> main = wheel.load()
   >>> main
   <function main at 0x103528488>
   ```
   
   While the same is not true for importlib.metadata:
   
   https://docs.python.org/3.8/library/importlib.metadata.html#entry-points
   
   ```
   eps = entry_points()  
   list(eps)  
   ['console_scripts', 'distutils.commands', 'distutils.setup_keywords', 'egg_info.writers', 'setuptools.installation']
   scripts = eps['console_scripts']  
   wheel = [ep for ep in scripts if ep.name == 'wheel'][0]  
   wheel  
   EntryPoint(name='wheel', value='wheel.cli:main', group='console_scripts')
   main = wheel.load()  
   main  
   <function main at 0x103528488>
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ashb commented on issue #12855: Unable to import Airflow plugins

Posted by GitBox <gi...@apache.org>.
ashb commented on issue #12855:
URL: https://github.com/apache/airflow/issues/12855#issuecomment-739549043


   > Indeed, we need to remove the following line from setup.py:
   > 
   > ```
   > 'importlib-metadata~=2.0; python_version<"3.8"',
   > ```
   > 
   > i.e. remove `; python_version<"3.8"` bit
   
   Little bit more complicated than that -- we should keep it as `<3.9`. But also on 3.8 we need to ensure we import the backport, or add the `module` parameter to the EntryPoint class as Martijn suggests.
   
    
   > Time for 1.10.14rc2 :(
   
   Yes


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] kaxil commented on issue #12855: Unable to import Airflow plugins

Posted by GitBox <gi...@apache.org>.
kaxil commented on issue #12855:
URL: https://github.com/apache/airflow/issues/12855#issuecomment-739546519


   Oh looks like that might just be an issue with Python 3.8 where `importlib.metadata` does not have `.module` but if you use Python 3.7 which uses `importlib_metadata` that has `.module`  


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ashb commented on issue #12855: Unable to import Airflow plugins

Posted by GitBox <gi...@apache.org>.
ashb commented on issue #12855:
URL: https://github.com/apache/airflow/issues/12855#issuecomment-739546757


   OH GAD.
   
   Paging @mjpieters  -- turns out we _do_ need the backported module more often :(


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] kaxil edited a comment on issue #12855: Unable to import Airflow plugins

Posted by GitBox <gi...@apache.org>.
kaxil edited a comment on issue #12855:
URL: https://github.com/apache/airflow/issues/12855#issuecomment-739549338


   Does 3.9 contain the `.module` attribute though? I know we officially don't support Py3.9 yet with 1.10.14 but do why do we not want to install it for 3.9 ?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org