Skip to content

Fail read remote logs from Azure Blog Storage #28366

Closed

Description

@aresabalo

Apache Airflow version

2.5.0

What happened

[2022-12-14 21:18:55,708] {wasb_task_handler.py:162} ERROR - Could not read logs from wasb-airflow-logs/dag_id=airflow-log-cleanup/run_id=scheduled__2022-12-13T00:00:00+00:00/task_id=log_cleanup_worker_num_1_dir_0/attempt=1.log
Traceback (most recent call last):
File "/home/airflow/.local/lib/python3.9/site-packages/airflow/providers/microsoft/azure/log/wasb_task_handler.py", line 159, in wasb_read
return self.hook.read_file(self.wasb_container, remote_log_location)
File "/home/airflow/.local/lib/python3.9/site-packages/airflow/providers/microsoft/azure/hooks/wasb.py", line 356, in read_file
return self.download(container_name, blob_name, **kwargs).content_as_text()
TypeError: download() missing 2 required positional arguments: 'offset' and 'length'

What you think should happen instead

Missing arguments in function call (download)

I resolved it patching file /home/airflow/.local/lib/python3.9/site-packages/airflow/providers/microsoft/azure/hooks/wasb.py

line 388 orig
self, container_name, blob_name, offset: int, length: int, **kwargs

line 388 patched
self, container_name, blob_name, offset: int | None = None, length: int | None = None, **kwargs

How to reproduce

Upgrading version from 2.4.3 to 2.5.0 and remote logs on Azure Blog Storage service

Operating System

AKS (Kubernetes)

Versions of Apache Airflow Providers

No response

Deployment

Other Docker-based deployment

Deployment details

No response

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. eladkal commented on Dec 14, 2022

    @eladkal
    Contributor

    Fixed in #28234
    Please check RC version:
    #28349
    It will be released in a few days in the meantime you can verify it resolves the issue

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions