Another file race error

@AudriusButkevicius any idea what could be causing this error?

[AAW47] 2015/02/16 15:56:25.695318 sharedpullerstate.go:172: INFO: Puller (folder “default”, file "***** Documents\***** Broker Maps\Target Brokers\***** (Southampton)\General\***** New Group Broker Notification - ***** ***** Services () LIVE in ***** from 1st March 2015.msg"): dst create: open C:\Users\Admin\Documents*\Sync* Documents***** Broker Maps\Target Brokers***** (Southampton)\General~syncthing~. New Group Broker Notification - ***** ***** Services (*****) LIVE in ***** from 1st March 2015.msg.tmp: The system cannot find the path specified.

I think the filename is just too long. Welcome to Windows.

I had a feeling that might be the case. Is there not a way around this? I know @calmh was talking about this issue before I’m just not sure where.

The way around this is to prepend \\?\ (ala \\?\C:\path\to\my\dir) to your folder path by manually editing config.xml. We haven’t tested that, hence why it’s not a default.

Yeah just found the issue on Github as you posted your reply.

I’ll give that a shot.

That was indeed the issue. Making this change allowed Windows to create the file and I can even open it! Makes me wonder why they even put the restriction on in the first place.

The Windows API has many functions that also have Unicode versions to permit an extended-length path for a maximum total path length of 32,767 characters. This type of path is composed of components separated by backslashes, each up to the value returned in the lpMaximumComponentLength parameter of the GetVolumeInformation function (this value is commonly 255 characters). To specify an extended-length path, use the "\?" prefix. For example, “\?\D:\very long path”. Note The maximum path of 32,767 characters is approximate, because the "\?" prefix may be expanded to a longer string by the system at run time, and this expansion applies to the total length.

Could this prefix not be added automatically on Windows systems?

I explained exactly the reason above why it’s not a default.

Prepending \\? does not only enable long filenames, but disables a bunch of interpretation things of the path name. That may have effects we have not tested, specifically around unicode characters and special file names like .. and similar (which you may actually be able to create when shown as \\?\foo\bar\..), and there may be variance between Windows versions…

Hi @calmh,

Our 20 nodes have been successfully using this since my last post here, so over a month. I also noticed today that Google Drive uses this by default on Windows, would it not be possible to implement this on Windows paths by default as well?

Not a big issue for us but seeing as I noticed GDrive uses it, there can’t be many repercussions, if any?

Sounds legit. Could be done as part of the config loading, perhaps (i.e. ensure the prefix is on the folder path from the config, or add it there).

I suppose this isn’t something you actually want to show in the GUI, because it would be pretty confusing to most users.

1 Like

v0.11 (beta5 and onwards) now include this automatically. Testing appreciated. :slight_smile: