Skip to content

Samba 4.10.2: destination_filepath is NoneType when opening file on Samba Share #54199

@npgretz

Description

@npgretz

Apache Airflow Provider(s)

samba

Versions of Apache Airflow Providers

4.10.2

Reverting to 4.9.2 fixed the issue.

Apache Airflow version

2.10.5

Operating System

Almalinux 8

Deployment

Official Apache Airflow Helm Chart

Deployment details

Helm Chart 1.16.0

What happened

After updating the Samba Providers package to 4.10.2 using SambaHook.push_from_local() began erroring out with:
line 289: with open(local_filepath, "rb") as f, self.open_file(destination_filepath, mode="wb") as g:
TypeError: 'NoneType' object does not support the context manager protocol

The destination_filepath variable is apparently NoneType. This occurs after:

Running secure negotiate process
receiving SMB2 Create Response
sending SMB2 Close Request for file <<destination_path>>
receiving SMB2 Close Response

The destination file is created on the SMB share but is zerobytes in size and empty.

What you think should happen instead

The push_from_local() call should transfer the contents of the file too.

How to reproduce

Install apache-airflow-providers-samba==4.10.2 in Airflow 2.10.5.

Then use SambaHook.push_from_local(destination_file, src_file, connection)

Anything else

This issue was resolved by downgrading to 4.9.2

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions