skip to Main Content

I’m not able to run my airflow image. It builds successfully, but when I use docker-compose up and bring up the image, it throws the following error and exits.

Unable to load the config, contains a configuration error.
Traceback (most recent call last):
  File "/usr/lib64/python3.6/logging/config.py", line 390, in resolve
    found = getattr(found, frag)
AttributeError: module 'airflow.utils.log' has no attribute 'file_task_handler'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib64/python3.6/logging/config.py", line 392, in resolve
    self.importer(used)
  File "/usr/local/lib/python3.6/site-packages/airflow/utils/log/file_task_handler.py", line 24, in <module>
    import requests
  File "/usr/lib/python3.6/site-packages/requests/__init__.py", line 43, in <module>
    import urllib3
  File "/usr/lib/python3.6/site-packages/urllib3/__init__.py", line 8, in <module>
    from .connectionpool import (
  File "/usr/lib/python3.6/site-packages/urllib3/connectionpool.py", line 11, in <module>
    from .exceptions import (
  File "/usr/lib/python3.6/site-packages/urllib3/exceptions.py", line 2, in <module>
    from .packages.six.moves.http_client import (
ModuleNotFoundError: No module named 'urllib3.packages.six'

Of course I have googled around and found nothing that fixed it. I’ve tried fixing any possible errors with my dockerfile, restarting docker, rebuilding the image.

Here’s a portion of my dockerfile.

RUN pip3 install  pytz --cert root.pem 
    && pip3 install pyOpenSSL --cert root.pem 
    && pip3 install ndg-httpsclient --cert root.pem 
    && pip3 install pyasn1 --cert root.pem 
    && pip3 install teradatasql --cert root.pem 
    && pip3 install --trusted-host=files.pythonhosted.org  --trusted-host=pypi.org apache-airflow[crypto,celery,postgres,hive,jdbc,kubernetes,mysql,mssql,ssh,ldap]==${AIRFLOW_VERSION} --cert root.pem 
    && pip3 install 'redis==3.2' --cert root.pem 
    && pip3 install Cython --cert root.pem 
    && pip3 install xmlrunner --cert root.pem 
    && pip3 install unittest-xml-reporting --cert root.pem 
    && pip3 install pyodbc --cert root.pem 
    && pip3 install flask-bcrypt --cert root.pem 
    && pip3 install python-ldap --cert root.pem 
    && pip3 install ldap3 --cert root.pem 
    && pip3 install emoji --cert root.pem 
    && pip3 install urllib3 --cert root.pem 

2

Answers


  1. Chosen as BEST ANSWER

    Added these lines to my dockerfile to fix the issue

        && pip3 uninstall urllib3 -y --cert root.pem 
        && pip3 install --no-cache-dir -U urllib3 --cert root.pem
    

  2. Lower version 1.24.1,Can solve this problem.
    It is estimated that your version is 1.26

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search