Skip to content

Unpack the RPC response data error #10

Description

@aszx826477

Dear CharmingYang, I meet a problem while using your NfsClient library. Could you help me to see this problem. I use your sample code like this. When it getport from 10.232.94.126, it can get the correct port 635 from the NFS server (I print it)

mnt_port = portmap.getport(Mount.program, Mount.program_version)

However when running the mount

mnt_res = mount.mnt(mount_path, None) 

the RPC cannot unpack data correctly, it seems the data format is wrong but I don't know why.

Looking forward for your reply!

The Code written like this:

# variable preparation
host = "10.232.94.126"
mount_path = "/vol_log/VASC_SILA/VMS/VMSKPI"

auth = {
    "flavor": 1,
    "machine_name": "maccrt03",
    "uid": 0,
    "gid": 0,
    "aux_gid": list(),
}

# portmap initialization
portmap = Portmap(host, timeout=3600)
portmap.connect()

# mount initialization
mnt_port = portmap.getport(Mount.program, Mount.program_version)
print("mnt_port")
print(mnt_port)
mount = Mount(host=host, port=mnt_port, timeout=3600, auth=auth)
mount.connect()

# do mount
mnt_res = mount.mnt(mount_path, None) # Have problem
print(mnt_res)

[2024-09-05 04:43:42 mnt_port]
[2024-09-05 04:43:42 635]
[2024-09-05 04:43:42 rpc.request:125 - unpack requires a buffer of 24 bytesTraceback (most recent call last): File "pyNfsClient/rpc.py", line 117, in request ) = struct.unpack('!LLLLLL', rpc)struct.error: unpack requires a buffer of 24 bytes]
[2024-09-05 04:43:42
'value=1725511422 not in enum mountstat3':
Traceback (most recent call last):; File: "index.py", line 31, in handler;
mnt_res = mount.mnt(mount_path, None); File: "pyNfsClient/mount.py", line 38, in mnt; res = unpacker.unpack_mountres3();
File: "pyNfsClient/pack.py", line 1728, in unpack_mountres3; data.status = self.unpack_mountstat3();
File: "pyNfsClient/pack.py", line 1717, in unpack_mountstat3; raise XDRError('value=%s not in enum mountstat3' % data);
xdrlib.Error: value=1725511422 not in enum mountstat3;]

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions