Skip to content

Task fails and cannot read logs. Invalid URL 'http://:8793/log/...': No host supplied #42136

Closed

Description

@pedro-cf

Apache Airflow version

Other Airflow 2 version (please specify below)

If "Other Airflow 2 version" selected, which one?

2.10.1

What happened?

I'm having an issue with an airflow instance where a task fails and I cannot read the logs.

Logs:

*** Could not read served logs: Invalid URL 'http://:8793/log/dag_id=my_dag/run_id=dynamic__apple_3_my_dag_cb353081__2024-09-09T14:41:22.596199__f73c5571719e4f35bf195ded40e5e25b/task_id=cleanup_temporary_directory/attempt=1.log': No host supplied

Event logs:

Executor CeleryExecutor(parallelism=128) reported that the task instance <TaskInstance: my_dag.cleanup_temporary_directory dynamic__apple_3_my_dag_cb353081__2024-09-09T14:41:22.596199__f73c5571719e4f35bf195ded40e5e25b [queued]> finished with state failed, but the task instance's state attribute is queued. Learn more: https://airflow.apache.org/docs/apache-airflow/stable/troubleshooting.html#task-state-changed-externally

Additionally I checked the logs directory for the dag_id/run_id and it's missing the respective task_id folder.

What you think should happen instead?

I should be able to access the logs.

How to reproduce

Not sure how to.

Operating System

Ubuntu 24.04 LTS

Versions of Apache Airflow Providers

No response

Deployment

Other Docker-based deployment

Deployment details

Deployed with docker-compose on Docker Swarm setup on 2 VMs.

Anything else?

Additionally I checked the logs directory for the dag_id/run_id and it's missing the respective task_id folder.

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. added
    kind:bug
    needs-triage
    on Sep 10, 2024
  2. andrew-stein-sp commented on Sep 10, 2024

    @andrew-stein-sp
    Contributor

    having the same issue with 2.10.1 in k8s, using the CeleryKubernetesExecutor.

    Could this be related to the inheritance issue that was discussed in #41891?

  3. pedro-cf commented on Sep 10, 2024

    @pedro-cf
    Author

    Additionally I checked the logs directory for the dag_id/run_id and it's missing the respective task_id folder.

  4. adriens commented on Sep 16, 2024

    @adriens

    Having the same issue on 2.10.0 through a podman-compose

  5. adriens commented on Sep 16, 2024

    @adriens

    We have upgraded on 2.10.1 like @andrew-stein-sp and we could reproduce the same behavior

  6. sosystems-dev commented on Sep 17, 2024

    @sosystems-dev

    got the same behavior since upgrading from version 2.9.3 to 2.10.1.
    We are using LocalExecutor

  7. mn7k commented on Sep 18, 2024

    @mn7k

    I have the same issue with 2.10.0, using the CeleryExecutor.
    It worked before I upgrading from version 2.9.0 to 2.10.0.

    *** Could not read served logs: Invalid URL 'http://:8793/log/dag_id=service_stop/run_id=manual__2024-09-18T09:42:54+09:00/task_id=make_accountlist_task/attempt=1.log': No host supplied
    

    eventlog

    Executor CeleryExecutor(parallelism=6) reported that the task instance <TaskInstance: service_stop.make_accountlist_task manual__2024-09-18T09:42:54+09:00 [queued]> finished with state failed, but the task instance's state attribute is queued. Learn more: https://airflow.apache.org/docs/apache-airflow/stable/troubleshooting.html#task-state-changed-externally
    

    Scheduler has a error log at the same hour as eventlog.

    [2024-09-18T00:43:18.036+0000] {celery_executor.py:291} ERROR - Error sending Celery task: module 'redis' has no attribute 'client'
    Celery Task ID: TaskInstanceKey(dag_id='service_stop', task_id='make_accountlist_task', run_id='manual__2024-09-18T09:42:54+09:00', try_number=1, map_index=-1)
    Traceback (most recent call last):
      File "/home/airflow/.local/lib/python3.12/site-packages/airflow/providers/celery/executors/celery_executor_utils.py", line 220, in send_task_to_executor
        result = task_to_run.apply_async(args=[command], queue=queue)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/airflow/.local/lib/python3.12/site-packages/celery/app/task.py", line 594, in apply_async
        return app.send_task(
               ^^^^^^^^^^^^^^
      File "/home/airflow/.local/lib/python3.12/site-packages/celery/app/base.py", line 797, in send_task
        with self.producer_or_acquire(producer) as P:
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/airflow/.local/lib/python3.12/site-packages/celery/app/base.py", line 932, in producer_or_acquire
        producer, self.producer_pool.acquire, block=True,
                  ^^^^^^^^^^^^^^^^^^
      File "/home/airflow/.local/lib/python3.12/site-packages/celery/app/base.py", line 1354, in producer_pool
        return self.amqp.producer_pool
               ^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/airflow/.local/lib/python3.12/site-packages/celery/app/amqp.py", line 591, in producer_pool
        self.app.connection_for_write()]
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/airflow/.local/lib/python3.12/site-packages/celery/app/base.py", line 829, in connection_for_write
        return self._connection(url or self.conf.broker_write_url, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/airflow/.local/lib/python3.12/site-packages/celery/app/base.py", line 880, in _connection
        return self.amqp.Connection(
               ^^^^^^^^^^^^^^^^^^^^^
      File "/home/airflow/.local/lib/python3.12/site-packages/kombu/connection.py", line 201, in __init__
        if not get_transport_cls(transport).can_parse_url:
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/airflow/.local/lib/python3.12/site-packages/kombu/transport/__init__.py", line 91, in get_transport_cls
        _transport_cache[transport] = resolve_transport(transport)
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/airflow/.local/lib/python3.12/site-packages/kombu/transport/__init__.py", line 76, in resolve_transport
        return symbol_by_name(transport)
               ^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/airflow/.local/lib/python3.12/site-packages/kombu/utils/imports.py", line 59, in symbol_by_name
        module = imp(module_name, package=package, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
      File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
      File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 995, in exec_module
      File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
      File "/home/airflow/.local/lib/python3.12/site-packages/kombu/transport/redis.py", line 282, in <module>
        class PrefixedRedisPipeline(GlobalKeyPrefixMixin, redis.client.Pipeline):
                                                          ^^^^^^^^^^^^
    AttributeError: module 'redis' has no attribute 'client'
    
  8. damiah commented on Sep 29, 2024

    @damiah

    same issue for us when upgrading to 2.10.2

  9. nikithapk commented on Oct 3, 2024

    @nikithapk

    We’re encountering the same issue as well.

  10. adriens commented on Oct 3, 2024

    @adriens

    We have switched from Bitnami docker-compose to official Apache docker-compose and we could make it run successfuly 🤩

  11. Dzhalolov commented on Oct 7, 2024

    @Dzhalolov

    try to check that dags exist in worker, schedule and webserver. I deploy Airflow in K8S and get this error when putting my dags into scheduler(expecting that in will replicate into another pods), but when I check dags folder in worker it was empty

  12. mn7k commented on Oct 15, 2024

    @mn7k

    At this time (#42136 (comment)), I used the airflow db upgrade command , but I realized it has been deprecated.
    I retried the upgrade using the airflow db migrate -n "2.10.2" command, and it works for me now.

    https://airflow.apache.org/docs/apache-airflow/2.10.0/installation/upgrading.html#offline-sql-migration-scripts

  13. 79 remaining items

  14. dmitrimahayana commented on Dec 1, 2025

    @dmitrimahayana

    Hi All, I am still facing the same issue in 3.1.3.
    Do we have any workaround in here?

  15. miladalahyari commented on Dec 1, 2025

    @miladalahyari

    thanks @andrew-stein-sp
    for: ariflow version 3.1.3

    I had same problem and i fix it with #42136 (comment)
    in my airflow.cfg

    [logging]
    hostname_callable = airflow.utils.net.get_host_ip_address
    ..
    [core]
    hostname_callable = airflow.utils.net.get_host_ip_address
    
    [api]
    hostname_callable = airflow.utils.net.get_host_ip_address
    
    and please don't forget secret_key 
    
    create it with
    `python3 -c "import secrets; print(secrets.token_hex(16))"`
    
    

    define this for all airflow services like worker, api,scheduler,webserver,triggerer

    AIRFLOW__API_AUTH__JWT_SECRET="{{ airflow_jwt_secret }}"

    and add it as env

    @dmitrimahayana

  16. dmitrimahayana commented on Dec 1, 2025

    @dmitrimahayana
  17. nicolamarangoni commented on Dec 15, 2025

    @nicolamarangoni
    Contributor

    Hello, this issue looks to be fixed.
    Regards,
    Nicola

  18. opeida commented on Dec 15, 2025

    @opeida

    @nicolamarangoni, I am still facing the issue, and it appears the root cause is deeper than the wrong callables: #42136 (comment)
    @ashb, can we proceed with the points you mentioned in #42136 (comment)?

  19. Zub4ir commented on Jan 16, 2026

    @Zub4ir

    Commenting here because the three callables helped me. This was Friday afternoon AirFlow server not sending data to our production system.

    This was the error on my sample DAG.

    Odd thing was rerunning the individual tasks was working.

    Image

  20. Zub4ir commented on Jan 16, 2026

    @Zub4ir

    Commenting here because the three callables helped me. This was Friday afternoon AirFlow server not sending data to our production system.

    This was the error on my sample DAG.

    Odd thing was rerunning the individual tasks was working.

    Image

    Oracle Linux 10, Python 3.12, and AirFlow 3.0.2

  21. sstamatiadis-dlt commented on Jan 26, 2026

    @sstamatiadis-dlt

    Hello, is there any working fix yet?

    I am using Helm chart version 1.18.0 with Airflow 3.0.2 on AWS EKS after an update from Helm chart version 1.15.0 with Airflow 2.9.3.

    I cannot run DAGs because I get this error. I have tried above suggestions without any success.

    Log message source details: sources=["Could not read served logs: Invalid URL 'http://:8793/log/dag_id=demo_DAG/run_id=scheduled__2026-01-26T00:00:00+00:00/task_id=meteo-data_fetching_in_airflow/attempt=1.log': No host supplied"]
    

    If I exec into the airflow-worker pod and cat the logs, the run file exists but it is empty.

    My 3.0.2 config is as below:

    [core]
    auth_manager = airflow.providers.fab.auth_manager.fab_auth_manager.FabAuthManager
    colored_console_log = False
    dags_folder = /opt/airflow/dags
    execution_api_server_url = http://airflow-xxxxxxxxxxx-api-server:8080/execution/
    executor = CeleryExecutor
    load_examples = False
    remote_logging = False
    
    [webserver]
    enable_proxy_fix = True
    rbac = True
    
    [logging]
    colored_console_log = False
    remote_logging = False
    
    [celery]
    flower_url_prefix = 
    worker_concurrency = 16
    
    [celery_kubernetes_executor]
    kubernetes_queue = kubernetes
    
    [elasticsearch]
    json_format = True
    log_id_template = {dag_id}_{task_id}_{execution_date}_{try_number}
    
    [elasticsearch_configs]
    max_retries = 3
    retry_timeout = True
    timeout = 30
    
    [fab]
    enable_proxy_fix = True
    
    [kerberos]
    ccache = /var/kerberos-ccache/cache
    keytab = /etc/airflow.keytab
    principal = [email protected]
    reinit_frequency = 3600
    
    [kubernetes]
    airflow_configmap = airflow-xxxxxxxxxxx-config
    airflow_local_settings_configmap = airflow-xxxxxxxxxxx-config
    multi_namespace_mode = False
    namespace = admins
    pod_template_file = /opt/airflow/pod_templates/pod_template_file.yaml
    worker_container_repository = apache/airflow
    worker_container_tag = 3.0.2
    
    [kubernetes_executor]
    multi_namespace_mode = False
    namespace = admins
    pod_template_file = /opt/airflow/pod_templates/pod_template_file.yaml
    worker_container_repository = apache/airflow
    worker_container_tag = 3.0.2
    
    [metrics]
    statsd_host = airflow-xxxxxxxxxxx-statsd
    statsd_on = False
    statsd_port = 9125
    statsd_prefix = airflow
    
    [scheduler]
    run_duration = 41460
    standalone_dag_processor = True
    statsd_host = airflow-xxxxxxxxxxx-statsd
    statsd_on = False
    statsd_port = 9125
    statsd_prefix = airflow
    

    The older version was 2.9.3:

    [celery]
    flower_url_prefix = 
    worker_concurrency = 16
    
    [celery_kubernetes_executor]
    kubernetes_queue = kubernetes
    
    [core]
    colored_console_log = False
    dags_folder = /opt/airflow/dags
    executor = CeleryExecutor
    load_examples = False
    remote_logging = False
    
    [elasticsearch]
    json_format = True
    log_id_template = {dag_id}_{task_id}_{execution_date}_{try_number}
    
    [elasticsearch_configs]
    max_retries = 3
    retry_timeout = True
    timeout = 30
    
    [kerberos]
    ccache = /var/kerberos-ccache/cache
    keytab = /etc/airflow.keytab
    principal = [email protected]
    reinit_frequency = 3600
    
    [kubernetes]
    airflow_configmap = airflow-xxxxxxxxxxx-config
    airflow_local_settings_configmap = airflow-xxxxxxxxxxx-config
    multi_namespace_mode = False
    namespace = admins
    pod_template_file = /opt/airflow/pod_templates/pod_template_file.yaml
    worker_container_repository = apache/airflow
    worker_container_tag = 2.9.3
    
    [kubernetes_executor]
    multi_namespace_mode = False
    namespace = admins
    pod_template_file = /opt/airflow/pod_templates/pod_template_file.yaml
    worker_container_repository = apache/airflow
    worker_container_tag = 2.9.3
    
    [logging]
    colored_console_log = False
    remote_logging = False
    
    [metrics]
    statsd_host = airflow-xxxxxxxxxxx-statsd
    statsd_on = False
    statsd_port = 9125
    statsd_prefix = airflow
    
    [scheduler]
    run_duration = 41460
    standalone_dag_processor = False
    statsd_host = airflow-xxxxxxxxxxx-statsd
    statsd_on = False
    statsd_port = 9125
    statsd_prefix = airflow
    
    [triggerer]
    default_capacity = 1000
    
    [webserver]
    enable_proxy_fix = True
    rbac = True
    
    • Should I be trying a newer version of the Airflow image? I read that the issue is more than just a misconfiguration logic.
    • The hostname_callable = airflow.utils.net.get_host_ip_address did not fix my issue
    • Other base_url or similar configuration seem to have not alleviate the problem
  22. DipBaldha commented on Jan 28, 2026

    @DipBaldha

    Try to use airflow official airflow.cfg file. That worked for me !

  23. sstamatiadis-dlt commented on Feb 2, 2026

    @sstamatiadis-dlt

    Hi @DipBaldha, could you elaborate a bit further? I cannot find the airflow.cfg file because it is being generated as I understand. There is only a airflow-default.cfg if I am not mistaken. Thank you for spending the time to comment.

    I quickly deployed latest airflow 3.1.6 version using the same Helm chart and I still get this error:

    Log message source details sources=["Could not read served logs: Invalid URL 'http://:8793/log/dag_id=demo_DAG/run_id=manual__2026-02-02T15:38:52+00:00/task_id=meteo-data_fetching_in_airflow/attempt=1.log': No host supplied"]

    Image

    My DAG code part that fails is something like the following:

    from airflow import DAG
    from airflow.operators.python import PythonOperator
    from airflow.operators.bash import BashOperator
    from airflow.providers.ssh.operators.ssh import SSHOperator
    from airflow.providers.ssh.hooks.ssh import SSHHook
    from datetime import datetime,timedelta
    
    sshHook_py = SSHHook(ssh_conn_id="jupyterlab", cmd_timeout=3600)
    sshHook_r = SSHHook(ssh_conn_id="rstudio", cmd_timeout=3600)
    
    default_args = {
        'owner': 'airflow',
        'depends_on_past': False,
        'email_on_failure': False,
        'email_on_retry': False,
        'retries': 0,
        'retry_delay': timedelta(minutes=1)
    }
    
    dag = DAG(
        dag_id='demo_DAG',
        default_args=default_args,
        # schedule_interval="@daily", # DEPRECATED in airflow 3.0.2
        schedule="@daily",
        start_date=datetime(2022, 1, 1),
        catchup=False
    )
    
    t6 = BashOperator(
        task_id='meteo-data_fetching_in_airflow',
        bash_command='python /opt/airflow/dags/demo/code/meteo_data_fetching.py',
        dag=dag
    )
    
    t6 >> [t1, t3]
    ...
    
  24. sstamatiadis-dlt commented on Feb 3, 2026

    @sstamatiadis-dlt

    My recent finding is that the task was failing with unexpected 302 responses because I am using oauth2-proxy in front off api-server (previously known as webserver).

    Once I disabled the oauth2-proxy the task logs seem to work. I understand now that it might have to do either with the inability to manage task state properly and/or request proxying issues. My previous airflow setup still works with the oauth2-proxy so I am not sure what is to blame in my setup with the new API implementation yet.

    Update: I am modifying the Helm chart to include extra ingress paths and a new service to route internal requests separately. I don't think this is helpful to anyone who does not use some kind of an auth layer/sidecar pattern. For now it seems to work for me.

  25. xcRRRRt commented on Feb 16, 2026

    @xcRRRRt

    I just configure AIRFLOW__API__BASE_URL and it works!

  26. phanikumv commented on Mar 3, 2026

    @phanikumv
    Contributor

    Are we good to close this issue? Based on the last couple of updates it seems to be working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    affected_version:3.0area:corearea:loggingkind:bugpriority:medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions