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

Copy .git dir to network device failed #1703

Closed
TobisLee opened this issue Sep 29, 2024 · 12 comments
Closed

Copy .git dir to network device failed #1703

TobisLee opened this issue Sep 29, 2024 · 12 comments
Labels
bug Something isn't working

Comments

@TobisLee
Copy link
Contributor

What system are you running Yazi on?

Linux Wayland

What terminal are you running Yazi in?

kitty 0.36.4

yazi --debug output

Yazi
    Version: 0.3.3 (a7b9275 2024-09-29)
    Debug  : false
    OS     : linux-x86_64 (unix)

Ya
    Version: 0.3.3 (3e4973db 2024-09-27)

Emulator
    Emulator.via_env: ("xterm-kitty", "")
    Emulator.via_csi: Ok(Kitty)
    Emulator.detect : Kitty

Adapter
    Adapter.matches: Kitty

Desktop
    XDG_SESSION_TYPE           : Some("wayland")
    WAYLAND_DISPLAY            : Some("wayland-0")
    DISPLAY                    : Some(":0")
    SWAYSOCK                   : None
    HYPRLAND_INSTANCE_SIGNATURE: None
    WAYFIRE_SOCKET             : None

SSH
    shared.in_ssh_connection: false

WSL
    WSL: false

Variables
    SHELL              : Some("/usr/bin/fish")
    EDITOR             : Some("nvim")
    VISUAL             : Some("nvim")
    YAZI_FILE_ONE      : None
    YAZI_CONFIG_HOME   : None

Text Opener
    default: Some(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })
    block  : Some(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })

Multiplexers
    TMUX               : false
    tmux version       : 3.5
    ZELLIJ_SESSION_NAME: None
    Zellij version     : No such file or directory (os error 2)

Dependencies
    file             : 5.45
    ueberzugpp       : ExitStatus(unix_wait_status(32512)), "ueberzugpp: error while loading shared libraries: libfmt.so.10: cannot open shared object file: No such file or directory\n"
    ffmpegthumbnailer: 2.2.3
    magick           : 7.1.1-38
    fzf              : 0.55.0
    fd               : 10.2.0
    rg               : 14.1.1
    chafa            : 1.14.2
    zoxide           : 0.9.6
    7z               : 17.05
    7zz              : No such file or directory (os error 2)
    jq               : 1.7.1


--------------------------------------------------
When reporting a bug, please also upload the `yazi.log` log file - only upload the most recent content by time.
You can find it in the "/home/tlss/.local/state/yazi" directory.

Did you try the latest nightly build to see if the problem got fixed?

Yes, and I updated the debug information above (yazi --debug) to the nightly that I tried

Describe the bug

I copied a git repository dir to a samba device, and yazi got stucked, it says permission denied. I canceled the task, then tried to delete the dir, yazi got stuck again, also says permission denied.

屏幕截图_20240929_220550

屏幕截图_20240929_220432

Minimal reproducer

Download the zip file and unzip, copy the file to a samba device.

pack.zip

Anything else?

I tried 3 times use yazi, all failed. Finally, I use dolphin to make things done.

@TobisLee TobisLee added the bug Something isn't working label Sep 29, 2024
@sxyazi
Copy link
Owner

sxyazi commented Sep 29, 2024

Does it work if you call std::fs::copy() function directly on these files in a Rust app? It's the API that Yazi uses to copy files.

@sxyazi sxyazi added the waiting on op Waiting for more information from the original poster label Sep 29, 2024
@TobisLee
Copy link
Contributor Author

Not work. Same permission denied Error

@github-actions github-actions bot removed the waiting on op Waiting for more information from the original poster label Sep 29, 2024
@sxyazi
Copy link
Owner

sxyazi commented Sep 29, 2024

Does it need a different API for copying network files - I'm not familiar with that

Also, what if you're running with root permissions?

@TobisLee
Copy link
Contributor Author

TobisLee commented Sep 29, 2024

Does it need a different API for copying network files - I'm not familiar with that

I don't think there is a different API for network device, since other files is successfully copied.

Also, what if you're running with root permissions?

I run sudo yazi, the file is copied successfully.

Update: I use xcp to copy file, and it worked.

@sxyazi
Copy link
Owner

sxyazi commented Sep 29, 2024

That's weird, I'm not sure how to fix it since what Yazi does is just call std::fs::copy() to copy files, and the error is returned by the operating system, while std::fs::copy() itself isn't working at all.

This might be a Rust bug, have you tried the copy function from the standard libraries of other languages to see if they work?

@TobisLee
Copy link
Contributor Author

I tested fs::copy_file in C++ and shutil.copyfile in Python, they all work fine. It seems like a Rust bug.

@TobisLee
Copy link
Contributor Author

TobisLee commented Oct 1, 2024

Since this issue is not related to yazi, I'll close this issue.

@sxyazi
Copy link
Owner

sxyazi commented Oct 18, 2024

FYI there's a related issue #1775

@TobisLee
Copy link
Contributor Author

Glad to see this fix, but I think fix it in yazi is a little bit weird. Can you make a PR to Rust and we can still use fs::copy in yazi?

@sxyazi
Copy link
Owner

sxyazi commented Oct 20, 2024

It's hard for me to say Rust would accept this because failing to copy files when permissions can't be set seems like a deliberate choice.

From Rust's perspective, copying a file must succeed in both permissions and content to be considered successful, even if the target filesystem doesn't support setting permissions.

However, this clearly contradicts our practical experience, where we hope at least the file content can be copied successfully, even if setting permissions fails.

@TobisLee
Copy link
Contributor Author

Make sense to me, thanks!

Copy link

I'm going to lock this issue because it has been closed for 30 days. ⏳
This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please file a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants