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

"Remote I/O error (121)" trying to delete a remote directory containg files. #4364

Closed
mc-butler opened this issue Apr 1, 2022 · 8 comments
Closed
Assignees
Labels
area: vfs Virtual File System support prio: medium Has the potential to affect progress ver: 4.8.27 Reproducible in version 4.8.27
Milestone

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/4364
Reporter gv (gabriel@….net)

Description of the problem:
Most of the times I cannot delete directories that have files or others directories on a remote machine (I connect using cd sh://user@host/home/user). I get something like this:

Cannot remove directory "/sh://user@h~home/user/1
                 Remote I/O error (121)
      [ Skip ]  [ Skip all ]  [ Retry ]  [ Abort ]

For most of directories in /home/user it does not work. Occasionally, for some directories, it works. And I cannot find a pattern here.

The only workaround for this issue is to first manually remove files from the directory and then remove the directory itself. This is easy if the directory tree is small. But for sure not feasible for a large directory tree.

Steps to reproduce:

  1. ssh user@host
  2. mkdir 1
  3. copy some random files into directory 1
  4. connect from mc to the remote host using sh://user@host/home/user
  5. try to remove directory 1 by pressing F8 on the directory.
$ mc -V
GNU Midnight Commander 4.8.28
Built with GLib 2.56.4
Built with S-Lang 2.3.2 with terminfo database
With builtin Editor and Aspell support
With optional subshell support
With support for background operations
With mouse support on xterm and Linux console
With internationalization support
With multiple codepages support
With ext2fs attributes support
Virtual File Systems:
 cpiofs, tarfs, sfs, extfs, ftpfs, fish
Data types:
 char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;
$ mc -V
Home directory: /home/user
Profile root directory: /home/user

[System data]
    Config directory: /etc/mc/
    Data directory:   /usr/share/mc/
    File extension handlers: /usr/libexec/mc/ext.d/
    VFS plugins and scripts: /usr/libexec/mc/
        extfs.d:        /usr/libexec/mc/extfs.d/
        fish:           /usr/libexec/mc/fish/

[User data]
    Config directory: /home/user/.config/mc/
    Data directory:   /home/user/.local/share/mc/
        skins:          /home/user/.local/share/mc/skins/
        extfs.d:        /home/user/.local/share/mc/extfs.d/
        fish:           /home/user/.local/share/mc/fish/
        mcedit macros:  /home/user/.local/share/mc/mc.macros
        mcedit external macros: /home/user/.local/share/mc/mcedit/macros.d/macro.*
    Cache directory:  /home/user/.cache/mc/

Thank you!

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Oct 2, 2022 at 8:16 UTC (comment 1)

  • Owner set to andrew_b
  • Branch state changed from no branch to on review
  • Description edited
  • Milestone changed from Future Releases to 4.8.29
  • Status changed from new to accepted
  • Version changed from master to 4.8.27

Branch: 4364_fish_remove_nonempty_dir
[d4d6cec]

@mc-butler
Copy link
Author

Changed by zaytsev (@zyv) on Oct 2, 2022 at 8:59 UTC (comment 2)

I would add a comment to the source code referencing this ticket to explain why these checks are needed (that is for VFS support). Otherwise, someone will surely optimise it again a decade later ;-)

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Oct 2, 2022 at 9:10 UTC (comment 3)

I'll add a comment to the commit before merge:
readdir() of FISH VFS doesn't return "." and ".." entries.

@mc-butler
Copy link
Author

Changed by zaytsev (@zyv) on Oct 2, 2022 at 12:14 UTC (comment 4)

Well, I meant the source code, not the commit message. Surely you won't be blaming every line before considering whether to change it or not...

@mc-butler
Copy link
Author

Changed by ossi (@ossilator) on Oct 2, 2022 at 14:22 UTC (comment 5)

when something seems obviously wrong, i actually tend to blame it to figure out whether i'm missing something. tough i suppose i may be somewhat exceptional in that regard.

code comments also have the unfortunate habit of going out of sync with reality, so their "cautionary" value tends to be limited in practice.

nonetheless, i agree that they should be added as a matter of best practice.

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Oct 9, 2022 at 11:03 UTC (comment 6)

  • Branch state changed from on review to approved
  • Votes set to andrew_b

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Oct 9, 2022 at 11:04 UTC (comment 7)

  • Branch state changed from approved to merged
  • Status changed from accepted to testing
  • Votes changed from andrew_b to committed-master
  • Resolution set to fixed

Merged to master: [7bbaa13].

git log --pretty=oneline 3a3811c52..7bbaa1364

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Oct 9, 2022 at 11:05 UTC (comment 8)

  • Status changed from testing to closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: vfs Virtual File System support prio: medium Has the potential to affect progress ver: 4.8.27 Reproducible in version 4.8.27
Development

No branches or pull requests

2 participants