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

No Such File Error if using ssh remote on windows #1701

Closed
Qsi1984 opened this issue Mar 8, 2019 · 10 comments

Comments

Projects
None yet
4 participants
@Qsi1984
Copy link
Contributor

commented Mar 8, 2019

Hi

Since the Update to Version 0.30 I can't use my ssh remote anymore.
dvc pull and dvc status -c gives me a "No Such File"-Error. I was able to find the problem in the new ssh-remote-implementation of version 0.30:
https://github.com/iterative/dvc/blob/master/dvc/remote/ssh/connection.py#L131
This line of Code constructs a path to use on the ssh-server using os.path.join which is platform-dependent.
The created path looks like this: /opt/dir/hdd/myfolder/dvcremote\9b which is not a valid unix-path.

It would be great if this issue gets fixed. I patched my local connection.py-file to be able to work again.

Thanks!

@pared

This comment has been minimized.

Copy link
Collaborator

commented Mar 8, 2019

Hi @Qsi1984! That definitely seems like a bug, thanks for sharing!

@pared pared added the bug label Mar 8, 2019

@efiop

This comment has been minimized.

Copy link
Member

commented Mar 8, 2019

We don't currently test ssh remote on windows in our CI, so that is why we didn't catch it right away. We definitely should've used posixpath there, as we do in other parts of that driver.

@efiop

This comment has been minimized.

Copy link
Member

commented Mar 8, 2019

Also, @Qsi1984 if you are so deep into the code already and fixed it for yourself, would you mind contributing a PR too? 🙂

@Qsi1984

This comment has been minimized.

Copy link
Contributor Author

commented Mar 8, 2019

I sadly won't have time to setup a dev-environment for dvc the next couple days.
But in my opinion the change is just to replace the mentioned code-line with
path = posixpath.join(directory, entry.filename)

@shcheklein

This comment has been minimized.

Copy link
Member

commented Mar 8, 2019

@Qsi1984 btw, I think there is no need to setup a dev env for that, just open the file on github, click an edit button on the top and will create a fork and PR for you. No need even to do a clone in such a simple case.

@Qsi1984 Qsi1984 referenced this issue Mar 8, 2019

Merged

Fixes #1701 #1703

@Qsi1984

This comment has been minimized.

Copy link
Contributor Author

commented Mar 8, 2019

Ah didn’t know that this is enabled. Done.

@shcheklein

This comment has been minimized.

Copy link
Member

commented Mar 8, 2019

@Qsi1984 yep, Github gives a super simple interface sometimes :) Thanks a lot, we'll review and merge asap!

@efiop

This comment has been minimized.

Copy link
Member

commented Mar 8, 2019

Thank you @Qsi1984 ! I've created #1704 to track progress on enabling ssh test on windows, so that we catch such bugs in time.

@efiop efiop closed this in #1703 Mar 9, 2019

efiop added a commit that referenced this issue Mar 9, 2019

@Qsi1984

This comment has been minimized.

Copy link
Contributor Author

commented Mar 14, 2019

Can someone reopen this issue? It still doesn't work on windows (See: https://discuss.dvc.org/t/ssh-login-failed-after-upgrading-version-0-24-3-0-30-1/127/6?u=qsi)
The problem is in upload/download of connection.py (eg. here:

makedirs(posixpath.dirname(dest), exist_ok=True)
) the use of posixpath and os.path is mixed up. In the mentioned code-line dest is a windows-style path if os is windows, therefore dirname of posixpath returns none.

@efiop

This comment has been minimized.

Copy link
Member

commented Mar 14, 2019

Fixed by #1725

@efiop efiop closed this Mar 14, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.