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

Manually escaping --target-path for network share on Windows. #249

Closed
realbogart opened this issue Feb 26, 2024 · 4 comments · Fixed by #250 or #251
Closed

Manually escaping --target-path for network share on Windows. #249

realbogart opened this issue Feb 26, 2024 · 4 comments · Fixed by #250 or #251
Assignees
Labels
bug Something isn't working

Comments

@realbogart
Copy link

Hello,

I just tried out this cool tool after a friend recommended it. On my first test run I think I ran in to a bug. Here is the command I ran:

longtail upsync --log-level=debug --source-path="C:\musik" --target-path="\\vault\backup\longtail\index\2024-02-26.lvi" --storage-uri="\\vault\backup\longtail\store"

The command succeded and it filled the store with files, but the index file 2024-02-26.lvi never ended up on that path. Even though the debug showed this:

level=debug msg=splitURI fname=splitURI uri="\\\\vault\\backup\\longtail\\index\\2024-02-26.lvi"
level=info msg="wrote 15110230 bytes" fname=WriteToURI uri="\\\\vault\\backup\\longtail\\index\\2024-02-26.lvi"

I managed to make it work by manually escaping every backslash in the --target-path.:
longtail upsync --log-level=debug --source-path="C:\musik" --target-path="\\\\vault\\backup\\longtail\\index\\2024-02-26.lvi" --storage-uri="\\vault\backup\longtail\store"

So only manually escaping the path for the --target-path, but not for the store. I think the scary part is that it silently succeded. This workaround works for me but I wanted to report it anyway.

Thank you!

@DanEngelbrecht
Copy link
Owner

Maybe it gets confused since you don’t provide a drive letter on the target path?
Could you try adding that? There should be no need to escape the backslashes.

@realbogart
Copy link
Author

Maybe it gets confused since you don’t provide a drive letter on the target path? Could you try adding that? There should be no need to escape the backslashes.

It's a network share and doesn't have a drive letter.

@DanEngelbrecht
Copy link
Owner

Ok, I will have a look, it probably gets confused trying to find the root folder.

@realbogart
Copy link
Author

realbogart commented Feb 26, 2024

Noticed similar issue on other commands where it also works if I put in 4 backslashes:

longtail print-store --store-index-path="\\\\vault\backup\longtail\store\store.lsi"

longtail print-version --version-index-path="\\\\vault\\backup\\longtail\\index\\2024-02-26_test1.lvi"

Using only 2 backslashes like longtail print-version --version-index-path="\\vault\\backup\\longtail\\index\\2024-02-26_test1.lvi" Gives the following error message:

level=fatal msg="printVersion: ReadFromURI: fsBlobObject.Read: open /vault/backup/longtail/index/2024-02-26_test1.lvi: The system cannot find the file specified.: file does not exist"

@DanEngelbrecht DanEngelbrecht self-assigned this Mar 3, 2024
@DanEngelbrecht DanEngelbrecht added the bug Something isn't working label Mar 3, 2024
DanEngelbrecht added a commit that referenced this issue Mar 3, 2024
…y escaped (#250)

- **FIXED** Networks share paths that starts with \\ no longer need to be manually escaped (fixes #249)
DanEngelbrecht added a commit that referenced this issue Mar 10, 2024
- **FIXED** Networks share paths that starts with \\ no longer need to be manually escaped (fixes #249)
- **UPDATED** Update longtaillib to v0.4.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants