Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create versioning directory recursively (creating parents as necessary) #6565

Closed
HaujetZhao opened this issue Apr 22, 2020 · 2 comments
Closed
Labels
enhancement New features or improvements of some kind, as opposed to a problem (bug) frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion good first issue Good starting points for new contributors
Milestone

Comments

@HaujetZhao
Copy link

This is the scene:

I set a sync folder which enabled File Versioning and set the versions path to /sdcard/Syncthing control/Desktop/Markdown , but I didn't create this path manually, and when syncing, there would be conflict, when I check the logs, it says:

Puller (folder "/sdcard/Documents/Markdown" (lziuh-l9bdv), item "test.pdf"): delete file: mkdir /sdcard/Syncthing control/Desktop/Markdown: no such file or directory

It seems the Syncthing tries to create the versioning folder. Because it's parent folder is not created manually, and it just used "mkdir" but not "mkdir -p", it can't create the parent folder of the versioning.

So I suggest the solution is to use mkdir -p to replace the mkdir in unix like system when creating versioning folder.

@AudriusButkevicius
Copy link
Member

We don't mkdir or mkdir -p, these are all bash commands, there is no bash involved in our case.

I think expecting the directory to exist us a fair expectation? It would catch cases where the user misstyped the path and stuff would appear in the wrong directory, hence I am inclined to close this as won't fix.

@calmh
Copy link
Member

calmh commented Apr 22, 2020

We try to create the versioning dir if it doesn't exist, we just don't try to create it recursively. I don't see a case where it would be a problem to just create it, and the opposite clearly applies, so ...

@calmh calmh added enhancement New features or improvements of some kind, as opposed to a problem (bug) good first issue Good starting points for new contributors labels Apr 22, 2020
@calmh calmh changed the title File Versioning mkdir conflict, I suggest use mkdir -p on unix-like system Create versioning directory recursively (creating parents as necessary) Apr 22, 2020
@calmh calmh closed this as completed in 72f954d Jun 23, 2020
@calmh calmh added this to the v1.8.0 milestone Jun 23, 2020
calmh added a commit to imsodin/syncthing that referenced this issue Jul 1, 2020
* main:
  build: Consistently use 8 hash digits in git describe
  lib/api, lib/model: Fixes around event request tracking (syncthing#6774)
  lib/protocol: Don't warn when dropping deleted invalid item (fixes syncthing#6795) (syncthing#6796)
  lib/model: Don't force rescan already changed items (syncthing#6798)
  lib/scanner: Test weak hash consistency (ref syncthing#5556) (syncthing#6794)
  gui, man, authors: Update docs, translations, and contributors
  lib/ur: Zero our the value before unmarshal (syncthing#6790)
  cmd/ursrv: Skip the duplicate complaints with new index name
  lib/ur: Normalise contract between syncthing and ursrv (syncthing#6770)
  lib/versioner: Create versioning directory recursively (fixes syncthing#6565) (syncthing#6678)
  build(deps): bump github.com/go-ldap/ldap/v3 from 3.1.10 to 3.2.0 (syncthing#6783)
  build(deps): bump golang.org/x/text from 0.3.2 to 0.3.3 (syncthing#6782)
  lib/model: Remove double error handling in performFinish (syncthing#6780)
  lib/db: Correct need accounting on reset (fixes syncthing#6784) (syncthing#6785)
  lib/model: More connection closing (syncthing#6778)
  lib/connections: Correctly fixup port in IPv6 listen URLs (syncthing#6786)
@st-review st-review added the frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion label Jun 23, 2021
@syncthing syncthing locked and limited conversation to collaborators Jun 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New features or improvements of some kind, as opposed to a problem (bug) frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion good first issue Good starting points for new contributors
Projects
None yet
Development

No branches or pull requests

4 participants