-
Notifications
You must be signed in to change notification settings - Fork 1.2k
ssh: support scp-like relpaths in urls #4167
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
Comments
Hi @Kuluum ! dvc treats the paths in url as absolute ones, hence why it tries to create IIRC, utils like The current workaround is to use an abspath like As to a proper solution, we clearly need some in-url way to differentiate abs path from a relative one and treat them properly. We could make our parsing smarter so it understands |
@efiop Thanks! With the absolute path, all work well. Also, I see that usage of the absolute path is described in the documentation, but I didn't notice it. For some reason, I used to expect the path '/dvc/datasets' to be relative to the ssh connect folder. My user has no rights to write to the root folder and it's the real reason why it cant create this folders. |
Do you remember any examples like that? I'm having a trouble remembering anything like that, but maybe you used to use some sftp servers that run in a user home dir? Usually all sftp servers are started with a root in a real fs root /, but sometimes they are configured to use a different root dir, I've seen that happen (there are even some issues that we have where people were confused by it). So maybe you could consider configuring your sftp server to behave like that too? Though that would be more confusing than just using abs paths, in my opinion. So you are using abs path (e.g. /home/user/dvc) for now as a workaround, right? Just double checking that you are not blocked by this anymore 🙂 |
Using the abs path as a workaround works. I'm not blocked anymore. 👍 What about sftp and root dir... Server guys created a user for me on some common server where are some other сolleagues have users too, so I have powers only in my user's home folder |
For the record: seems like we have a very similar problem with hdfs, where we always pass |
I got confused by this also and took a cycle to realize what's happening. I think we should at least document this properly /cc @jorgeorpinel . |
Not 100% sure I got the issue, workaround, and what's missing from docs, but here's a small PR for you guys to check please: iterative/dvc.org#1649 |
Closing as stale |
Bug Report
Machine 1 (macos):
Machine 2 (ubuntu):
Same problem on both machines:
What have I found and how I fix it:
The problem is that in
ssh/connection.py/makedirs
parameterpath
comes like/dvc
starts with/
, this path then passed to paramiko and it can't make dir with/
prefix, permission denied error appears. Same behavior if you trySo when I do this:
remote/ssh/connection.py
The problem with makedir is solved!
Then the new one appears:
The problem is the same, remote path starts with
/
and paramiko cant load it. So the fix is same (but in 2 places)remote/ssh/connection.py
And now push works well.
P.S.
I think this fix is too stride forward to be high quality, so I can make a pull request or after OK from you either after comment on how to make it better.
The text was updated successfully, but these errors were encountered: