<@ULVA73B9P> Hi! Has anyone else used the SMB bloc...
# ask-marvin
t
@Marvin Hi! Has anyone else used the SMB block with Prefect 3.x with success? I'm trying to implement it but facing issues similar to this GitHub Issue: https://github.com/PrefectHQ/prefect/issues/10694 Where I get a fsspec/smbprotocol error like this:
Copy code
File "...\.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`:
Copy code
# 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`:
Copy code
#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?
m
Error: GitHub API error 422: {"message":"Validation Failed","errors":[{"message":"The listed users and repositories cannot be searched either because the resources do not exist or you do not have permission to view them.","resource":"Search","field":"q","code":"invalid"}],"documentation_url":"https://docs.github.com/v3/search/","status":"422"}
Sorry, I encountered an error while processing your request. Please try again.
n
uh oh
t
nooooo🥲
n
i will look into that, seems like someone might have rotated a token
t
On a friday afternoon as well? 😞 I am so sorry
n
i’m not sure that marvin would have any insight beyond stock gpt 5 with a browser fwiw. i think you found the most relevant issue. any details on how to repro your setup/bug on the issue would be most helpful to expedite investigation/fix
t
Yeah I am drafting a PR cuz I think I found a fix, just not sure how to add a test with an SMB server connection
👍 1
n
hey @Marvin about that issue you encountered with your tool, was that a prefect issue? or were you reading upstream
m
thought for 8.7 seconds
I might be missing some context—can you point me to which issue/tool you’re referring to? If you can share a link, a snippet of the error/trace, or even a few keywords, I can check whether it’s a Prefect bug or an upstream dependency. Helpful details: - Prefect version (assuming 3.x unless you say otherwise) - Any integrations involved (e.g.,
prefect-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.
n
interesting
might be my fault actually
🥺 1
oh awesome! thanks!
Yeah I am drafting a PR
just not sure how to add a test with an SMB server connection
sounds like something you might need to mock. we usually use monkeypatch for stuff like that
❤️ 1