user1496491
user1496491

Reputation: 583

Git clone error: copy-fd: read returned: Invalid argument

So, I'm cloning a git repository from network drive on Windows 10 but keep receiving the error

error: copy-fd: read returned: Invalid argument
fatal: failed to copy file to 'Project/.git/objects/08/21413bbc766a046ac8f6ad8db7240f85fc4d6f': Invalid argument

Network drive mounted with NetDrive 3 via webDAV protocol.

From the Mac machine it clones perfectly. I tried different versions of git but it didn't help. How do I fix that?

Upvotes: 0

Views: 918

Answers (1)

bk2204
bk2204

Reputation: 76409

This is likely a bug in NetDrive 3's file system implementation. EINVAL is not a reasonable error code in this case given the context, but this is Windows, so there may be some error code that it's returning that gets mapped to EINVAL in this case. There are multiple known file system implementations on Windows that return broken error codes, and therefore things can get mapped to an error when in fact they may be harmless.

It's also possible that NetDrive 3 doesn't support the set of file flags or features that Git requires in this case. Git requires a fully functional POSIX-compatible read function, and if NetDrive 3 can't provide something that's required, it may be throwing an error.

Whatever you're using on Mac, whether it's the built-in DAV support or an addon, is probably working correctly.

Just as a note, WebDAV is not likely to provide the POSIX semantics that Git requires for integrity, so you may want to avoid it altogether if you value your data. If you still want to do this, Windows provides a built-in DAV implementation which you try.

You're welcome to file a bug at the Git for Windows issue tracker if you're absolutely certain that this is not NetDrive 3's fault, but I suspect it is.

Upvotes: 1

Related Questions