OSError: [Errno 22] Invalid argument File "nxdrive\manager.py", line 654, in bind_engine self, engine_def, binder=binder File "nxdrive\engine\engine.py", line 127, in __init__ self.bind(binder) File "nxdrive\engine\engine.py", line 814, in bind self._check_root() File "nxdrive\engine\engine.py", line 834, in _check_root self._add_top_level_state() File "nxdrive\engine\engine.py", line 889, in _add_top_level_state remote_info = self.remote.get_filesystem_root_info() File "nxdrive\client\remote_client.py", line 266, in get_filesystem_root_info return RemoteFileInfo.from_dict(toplevel_folder) File "nxdrive\objects.py", line 69, in from_dict last_update = datetime.fromtimestamp(timestamp // 1000) if timestamp else None
The error happens when the timestamp is less than zero. A Python bug has been opened: https://bugs.python.org/issue36439
But, given our current code, this error cannot happen ... So I open the issue to track down future similar errors until we found an eventual fix on our side (if any).
To reproduce, I copied inputs from the Sentry event into this test file:
from nxdrive.objects import RemoteFileInfo fs_item = { "canCreateChild": False, "canDelete": False, "canRename": False, "canScrollDescendants": False, "creationDate": 771, "creator": "system", "folder": True, "id": "org.nuxeo.drive.service.impl.DefaultTopLevelFolderItemFactory#", "lastContributor": "system", "lastModificationDate": 771, "lockInfo": None, "name": "Nuxeo Drive", "parentId": None, "path": "/org.nuxeo.drive.service.impl.DefaultTopLevelFolderItemFactory#", "userName": "Administrator", } obj = RemoteFileInfo.from_dict(fs_item) print(obj)
But this code works like a charm on Windows 7 and 10.
- is related to
-
NXDRIVE-1236 Fix datetime.fromtimestamp() erronously throws an OSError on Windows
- Resolved