Tom Han
08/29/2025, 11:10 PMFile "...\.venv\lib\site-packages\smbprotocol\transport.py", line 68, in connect
raise ValueError(f"Failed to connect to '{self.server}:{self.port}': {err}") from err
ValueError: Failed to connect to 'my.smb.serber.edusmb::445': [Errno 11001] getaddrinfo failed.
When I PDB'd into the stack trace it is the same _as_unc_path
double appending server as observed in the issue:
In `prefect.filesystem.SMB`:
# SMB.writepath calls RemoteFileSystem.writepath
# Around line 520
path = self._resolve_path(path)
dirpath = path[: path.rindex("/")]
# dirpath is <smb://my.smb.server.edu/path/to/my/folder>
self.filesystem.makedirs(dirpath, exist_ok=True)
But in `fsspec`:
#fsspec/implementation/smb.py
class SMBFileSystem()......
def makedirs(self, path, exist_ok=False):
# dirpath prefect passes in already contains `<smb://my.smb.server.edu>`
if _share_has_path(path):
wpath = _as_unc_path(self.host, path) # <=== This line double appends it
# now this line would fail because
# wpath = \\my.smb.server.edusmb:\\<http://my.smb.server.edu|my.smb.server.edu>\path\to\my\folder
smbclient.makedirs(wpath, exist_ok=exist_ok, port=self._port)
Has there been any workarounds?Marvin
08/29/2025, 11:11 PMMarvin
08/29/2025, 11:12 PMNate
08/29/2025, 11:15 PMTom Han
08/29/2025, 11:15 PMNate
08/29/2025, 11:16 PMTom Han
08/29/2025, 11:16 PMNate
08/29/2025, 11:17 PMTom Han
08/29/2025, 11:18 PMNate
08/29/2025, 11:24 PMMarvin
08/29/2025, 11:24 PMMarvin
08/29/2025, 11:24 PMprefect-aws
version, boto3/botocore
versions)
- Where it happened (ECS/EC2, container image, worker/flow-run container)
- Minimal repro steps
Once I have that, I’ll check existing issues/discussions and confirm if it’s Prefect or upstream.Nate
08/29/2025, 11:25 PMNate
08/29/2025, 11:25 PMNate
08/29/2025, 11:27 PMYeah I am drafting a PR
just not sure how to add a test with an SMB server connectionsounds like something you might need to mock. we usually use monkeypatch for stuff like that