eladkal opened a new issue #14243:
URL: https://github.com/apache/airflow/issues/14243


   
   **What happened**:
   
   Running upgrade checker 1.2.0 on one of my repos produced the following 
errors:
   
   ChainBetweenDAGAndOperatorNotAllowedRule:
   ```
   Traceback (most recent call last):
    File "/home/airflow/.local/bin/airflow", line 37, in <module>
     args.func(args)
    File "/usr/local/lib/python3.6/site-packages/airflow/upgrade/checker.py", 
line 118, in run
     all_problems = check_upgrade(formatter, rules)
    File "/usr/local/lib/python3.6/site-packages/airflow/upgrade/checker.py", 
line 38, in check_upgrade
     rule_status = RuleStatus.from_rule(rule)
    File "/usr/local/lib/python3.6/site-packages/airflow/upgrade/problem.py", 
line 44, in from_rule
     result = rule.check()
    File 
"/usr/local/lib/python3.6/site-packages/airflow/upgrade/rules/chain_between_dag_and_operator_not_allowed_rule.py",
 line 72, in check
     problems.extend(self._check_file(file_path))
    File 
"/usr/local/lib/python3.6/site-packages/airflow/upgrade/rules/chain_between_dag_and_operator_not_allowed_rule.py",
 line 40, in _check_file
     lines = file_pointer.readlines()
    File "/usr/local/lib/python3.6/codecs.py", line 321, in decode
     (result, consumed) = self._buffer_decode(data, self.errors, final)
   UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa3 in position 14: 
invalid start byte
   ```
   
   ImportChangesRule:
   ```
   Traceback (most recent call last):
     File "/home/airflow/.local/bin/airflow", line 37, in <module>
       args.func(args)
     File "/usr/local/lib/python3.6/site-packages/airflow/upgrade/checker.py", 
line 118, in run
       all_problems = check_upgrade(formatter, rules)
     File "/usr/local/lib/python3.6/site-packages/airflow/upgrade/checker.py", 
line 38, in check_upgrade
       rule_status = RuleStatus.from_rule(rule)
     File "/usr/local/lib/python3.6/site-packages/airflow/upgrade/problem.py", 
line 44, in from_rule
       result = rule.check()
     File 
"/usr/local/lib/python3.6/site-packages/airflow/upgrade/rules/import_changes.py",
 line 145, in check
       new_problems, new_providers = self._check_file(file)
     File 
"/usr/local/lib/python3.6/site-packages/airflow/upgrade/rules/import_changes.py",
 line 114, in _check_file
       content = file.read()
     File "/usr/local/lib/python3.6/codecs.py", line 321, in decode
       (result, consumed) = self._buffer_decode(data, self.errors, final)
   UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa3 in position 14: 
invalid start byte
   ```
   
   I traced it to a `.docx` file that caused these exceptions but it took work 
to figure it out as the traceback doesn't specify what file caused it.
   
   This is a similar to https://github.com/apache/airflow/issues/13349 which 
fixed it for `AirflowMacroPluginRemovedRule`
   
   
   **Anything else we need to know**:
   Since occupied with migration it will take a while before I can raise PR to 
address this. In case someone can handle sooner you can take this.
   


----------------------------------------------------------------
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