WesleyBatista opened a new issue #14359:
URL: https://github.com/apache/airflow/issues/14359


   **Apache Airflow version**: 1.10.14
   
   
   **Kubernetes version (if you are using kubernetes)** (use `kubectl version`):
   
   **Environment**:
   
   - **Cloud provider or hardware configuration**:
   - **OS** (e.g. from /etc/os-release): Debian GNU/Linux 9 (stretch)
   - **Kernel** (e.g. `uname -a`): `Linux staging-airflow1.cve.one 
4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u5 (2017-09-19) x86_64 GNU/Linux`
   - **Install tools**:
   - **Others**:
   
   **What happened**:
   
   Running `airflow upgrade_check --config upgrade.yml` returns the following 
error:
   ```
   airflow@staging-airflow1:~$ airflow upgrade_check --config upgrade.yml 
   Using config file: upgrade.yml
   
   
===========================================================================================
 STATUS 
==========================================================================================
   
   Check for latest versions of apache-airflow and 
checker............................................................................................................................FAIL
   Remove airflow.AirflowMacroPlugin 
class............................................................................................................................................SUCCESS
   Ensure users are not using custom metaclasses in custom 
operators..................................................................................................................SUCCESS
   Chain between DAG and operator not 
allowed.........................................................................................................................................SUCCESS
   Connection.conn_type is not 
nullable...............................................................................................................................................SUCCESS
   Custom Executors now require full 
path.............................................................................................................................................SUCCESS
   Hooks that run DB functions must inherit from 
DBApiHook............................................................................................................................FAIL
   Fernet is enabled by 
default.......................................................................................................................................................SUCCESS
   GCP service account key 
deprecation................................................................................................................................................SUCCESS
   Unify hostname_callable option in core 
section.....................................................................................................................................SUCCESS
   Traceback (most recent call last):
     File "/usr/local/bin/airflow", line 37, in <module>
       args.func(args)
     File "/usr/local/lib/python3.6/dist-packages/airflow/upgrade/checker.py", 
line 118, in run
       all_problems = check_upgrade(formatter, rules)
     File "/usr/local/lib/python3.6/dist-packages/airflow/upgrade/checker.py", 
line 38, in check_upgrade
       rule_status = RuleStatus.from_rule(rule)
     File "/usr/local/lib/python3.6/dist-packages/airflow/upgrade/problem.py", 
line 48, in from_rule
       messages = list(result)
     File 
"/usr/local/lib/python3.6/dist-packages/airflow/upgrade/rules/import_changes.py",
 line 126, in _check_missing_providers
       if current_airflow_version.major >= 2:
   AttributeError: 'Version' object has no attribute 'major'
   ```
   
   
   **What you expected to happen**:  commands runs through and prints helpful 
messages
   
   **How to reproduce it**: The minimum steps that should reproduce it are:
   ```
   $ python3
   Python 3.6.5 (default, May  9 2018, 10:19:36) 
   [GCC 6.3.0 20170516] on linux
   Type "help", "copyright", "credits" or "license" for more information.
   >>> from packaging.version import Version
   >>> current_airflow_version = Version(__import__("airflow").__version__)
   >>> current_airflow_version.major >= 2
   False
   ```
   Unfortunately, as we can see it works fine.
   
   **Anything else we need to know**:  These are the versions we are using:
   ```
   airflow@staging-airflow1:~$ pip3 freeze|grep airflow
   airflow-plugins==0.4.0
   apache-airflow==1.10.14
   apache-airflow-upgrade-check==1.2.0
   ```
   
   _`airflow-plugins` is an internal package that we maintain and I wouldn't 
think is related to the issue._
   
   Adding `ImportChangesRule` to the list of `ignored_rules` _(as similarly 
suggested here #14262)_ makes the command run through, but then we might be 
oblivious to important recommendations related to changes in import paths of 
hooks, operators, sensors and others.
   
   <details><summary>This is the output when we skip `ImportChangesRule` 
</summary>
   
   ```
   airflow@staging-airflow1:~$ airflow upgrade_check --config upgrade.yml 
   Using config file: upgrade.yml
   
   
===========================================================================================
 STATUS 
==========================================================================================
   
   Check for latest versions of apache-airflow and 
checker............................................................................................................................FAIL
   Remove airflow.AirflowMacroPlugin 
class............................................................................................................................................SUCCESS
   Ensure users are not using custom metaclasses in custom 
operators..................................................................................................................SUCCESS
   Chain between DAG and operator not 
allowed.........................................................................................................................................SUCCESS
   Connection.conn_type is not 
nullable...............................................................................................................................................SUCCESS
   Custom Executors now require full 
path.............................................................................................................................................SUCCESS
   Hooks that run DB functions must inherit from 
DBApiHook............................................................................................................................FAIL
   Fernet is enabled by 
default.......................................................................................................................................................SUCCESS
   GCP service account key 
deprecation................................................................................................................................................SUCCESS
   Unify hostname_callable option in core 
section.....................................................................................................................................SUCCESS
   Legacy UI is deprecated by 
default.................................................................................................................................................SUCCESS
   Logging configuration has been moved to new 
section................................................................................................................................FAIL
   Removal of Mesos 
Executor..........................................................................................................................................................SUCCESS
   No additional argument allowed in 
BaseOperator.....................................................................................................................................SUCCESS
   Users must set a kubernetes.pod_template_file 
value................................................................................................................................SKIPPED
   SendGrid email uses old airflow.contrib 
module.....................................................................................................................................SUCCESS
   Check Spark JDBC Operator default connection 
name..................................................................................................................................SUCCESS
   Changes in import path of remote task 
handlers.....................................................................................................................................SUCCESS
   Connection.conn_id is not 
unique...................................................................................................................................................SUCCESS
   Found 6 problems.
   
   
======================================================================================
 RECOMMENDATIONS 
======================================================================================
   
   Check for latest versions of apache-airflow and checker
   -------------------------------------------------------
   Check that the latest version of apache-airflow-upgrade-check is installed, 
and
   that you are on the latest 1.10.x release of apache-airflow.
   
   Problems:
   
     1.  Unable to go ask PyPI.org for latest release information: 'Version' 
object has no attribute 'is_devrelease'
   
   Hooks that run DB functions must inherit from DBApiHook
   -------------------------------------------------------
   Hooks that run DB functions must inherit from DBApiHook instead of BaseHook
   
   Problems:
   
     1.  Class <class 'airflow.hooks.http_hook.HttpHook'> incorrectly 
implements the function run while inheriting from BaseHook. Please make this 
class inherit from airflow.hooks.db_api_hook.DbApiHook instead
     2.  Class <class 
'airflow.contrib.hooks.slack_webhook_hook.SlackWebhookHook'> incorrectly 
implements the function run while inheriting from BaseHook. Please make this 
class inherit from airflow.hooks.db_api_hook.DbApiHook instead
     3.  Class <redacted> incorrectly implements the function run while 
inheriting from BaseHook. Please make this class inherit from 
airflow.hooks.db_api_hook.DbApiHook instead
   
   Logging configuration has been moved to new section
   ---------------------------------------------------
   The logging configurations have been moved from [core] to the new [logging] 
section.
   
   Problems:
   
     1.  base_log_folder has been moved from [core] to a the new [logging] 
section.
   
   Users must set a kubernetes.pod_template_file value
   ---------------------------------------------------
   Skipped because this rule applies only to environment using 
KubernetesExecutor.
   
   ```
   </details>


----------------------------------------------------------------
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:
[email protected]


Reply via email to