dat icon indicating copy to clipboard operation
dat copied to clipboard

CLI inconsistent error on sync after clone in two different ways

Open cottrell opened this issue 6 years ago • 2 comments

I suspect there is some minor inconsistency in the CLI that leads to failing syncs after a clone specified with a hash and no dir argument. The first line works and the seconds one doesn't.

$ dat --version
13.11.4

$ dat clone f427ad98689e020f8d8d16ec238d3d2b56f5cdd3dabe40e7bacb2133c2e33583
$ dat sync f427ad98689e020f8d8d16ec238d3d2b56f5cdd3dabe40e7bacb2133c2e33583/
No existing archive in this directory.

$ dat clone f427ad98689e020f8d8d16ec238d3d2b56f5cdd3dabe40e7bacb2133c2e33583 righthere
$ dat sync righthere/
dat v13.11.4
Downloading dat: 2 files (138 B)

1 connection | Download 0 B/s Upload 0 B/s

dat synced, waiting for updates.
[==========================================] 100.00%

cottrell avatar Dec 09 '18 18:12 cottrell

I think it might be having a hard time if you make the directory name the hash.

Specifying a non-hash directory name seems to be ok.

$ dat clone 9852c6d737a05235986fc3975adef9d177aabb13c92d6f1f48007b7dd008abb7 9852c6d737a05235986fc3975adef9d177aabb13c92d6f1f48007b7dd008abb7
$ dat sync ./9852c6d737a05235986fc3975adef9d177aabb13c92d6f1f48007b7dd008abb7
No existing archive in this directory.


$ dat clone 9852c6d737a05235986fc3975adef9d177aabb13c92d6f1f48007b7dd008abb7 here
dat v13.11.4
Created new dat in /tmp/here/.dat
Cloning: 6 files (59 KB)

4 connections | Download 60 KB/s Upload 0 B/s

dat sync complete.
Version 8


Exiting the Dat program...
$ dat sync here
dat v13.11.4
Downloading dat: 6 files (59 KB)

2 connections | Download 0 B/s Upload 0 B/s

dat synced, waiting for updates.
[==========================================] 100.00%

cottrell avatar Dec 09 '18 18:12 cottrell

A final hunch is that it is something to do with the length of the directory name. Prepending sha_... does not fix the issue but truncating the hash does.

cottrell avatar Dec 09 '18 18:12 cottrell