question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: No such file or directory while moving

See original GitHub issue

Problem

Hi everyone, Doing a complete re-import of my whole music collection. Been retagging, renaming modifying it for years now 6+ I feel like now config is good, and all those good things are happening almost automaticagically…

My problem is that, when I do a “test folder” run I get these No such file or directory while moving errors. This has been a recurring issue on my system. I then go on the NAS and look for the faulty files or folder… and most of the time they are there. I then proceed to just move them elsewhere in a “to check” folder… or simply delete the damn files… then redo my beet -vv import /Volumes/music/CleanBeet

so it runs for a while until it hits another…

can someone take a look at this please?

Running this command in verbose (-vv) mode:

...
Sending event: database_change
/Volumes/music/CleanBeet/E/electronic trance hip jaz/Late of the Pier/The Bears Are Coming - [ALBUM] (MP3)(2008) - (3_23)
Sending event: import_task_created
Replacing item 12044: /Volumes/music/CleanBeet/E/electronic trance hip jaz/Late of the Pier/The Bears Are Coming - [ALBUM] (MP3)(2008) - (3_23)/04 The Bears Are Coming [217kbps].mp3
Sending event: database_change
Sending event: database_change
Sending event: album_removed
Sending event: item_removed
1 of 1 items replaced
Sending event: database_change
Sending event: import_task_created
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Reimported album: added 1662737721.927134, flexible attributes [] from album 4082 for /Volumes/music/CleanBeet/E/electronic trance hip jaz/Late of the Pier/The Bears Are Coming - [ALBUM] (MP3)(2008) - (3_23)
Reimported item added 1662737721.950891 from item 12044 for /Volumes/music/CleanBeet/E/electronic trance hip jaz/Late of the Pier/The Bears Are Coming - [ALBUM] (MP3)(2008) - (3_23)/04 The Bears Are Coming [217kbps].mp3
Reimported item flexible attributes [] from item 12044 for /Volumes/music/CleanBeet/E/electronic trance hip jaz/Late of the Pier/The Bears Are Coming - [ALBUM] (MP3)(2008) - (3_23)/04 The Bears Are Coming [217kbps].mp3
Sending event: database_change
Traceback (most recent call last):
  File "/Users/lefab/beets/beets/util/__init__.py", line 494, in move
    os.replace(syspath(path), syspath(dest))
OSError: [Errno 18] Cross-device link: b'/Volumes/music/CleanBeet/E/electronic trance hip jaz/Compilations/Richard Dorfmeister Presents_ A Different Drummer Selection/01 Imagination.1.mp3' -> b'/Volumes/Music_Collection/Sorted_Music/Richard Dorfmeister/Richard Dorfmeister Presents_ A Different Drummer Selection [4211]/01 Imagination.mp3'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/lefab/beets/beets/util/__init__.py", line 515, in move
    os.remove(syspath(path))
FileNotFoundError: [Errno 2] No such file or directory: b'/Volumes/music/CleanBeet/E/electronic trance hip jaz/Compilations/Richard Dorfmeister Presents_ A Different Drummer Selection/01 Imagination.1.mp3'

Error: No such file or directory while moving /Volumes/music/CleanBeet/E/electronic trance hip jaz/Compilations/Richard Dorfmeister Presents_ A Different Drummer Selection/01 Imagination.1.mp3 to /Volumes/Music_Collection/Sorted_Music/Richard Dorfmeister/Richard Dorfmeister Presents_ A Different Drummer Selection [4211]/01 Imagination.mp3

Setup

  • OS: MacOS 10.15.7

  • beets version: 1.6.1

  • Python version: 3.10.6

  • no plugins loaded

  • Turning off plugins made problem go away (yes/no): no (no plugins loaded

My configuration (output of beet config) is:

directory: /Volumes/Music_Collection/Sorted_Music
library: ~/.config/beets/musiclibrary.db

import:
    move: yes
    copy: no
    write: no
    resume: yes
    incremental: yes
    quiet_fallback: skip
    timid: no
    default_action: apply
    autotag: no
    duplicate_action: merge

I don’t understand, I am using the most simplest way to do this and I still get this error.

I need help, thanks

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
JOJ0commented, Dec 14, 2022

@fabiendostie just wild guessing here but by any chance have you tried sharing and mounting /Volumes/music using another network file systen. U using cifs or nfs for your NAS share?

I had issues with beet mv with cifs share mounted by a systemd mount unit that ran as root obviously. Even though I was sure I passed the right options to grant my personal user all the perms I had problems with an operation where beets wants to change files stat with the importadded plugin.

I worked around the issue by getting rid of the systemd mount unit, putting my nas share into clients fstab and now mount it directly as my local personal user.

Long story short: Might be a filesystem issue either on the sharing or on the mounting machine.

You might not have that much options on your mounting device (macOS right?) but still worth trying out changing things.

1reaction
wisp3rwindcommented, Sep 10, 2022

Sounds spot-on — I’m also stumped what could be going on here, other than a race with some other application or another beets thread.

First of all, I think we should probably catch and suppress FileNotFoundError on this step. If the file is already gone when we try to delete it, it’s probably benign—even if it’s mysterious.

👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Trying to use the move (mv) command, but I get "no such file ...
I have created two directories called Cat and Dog . Under Cat I created a file called puppies . When I try to...
Read more >
shell script mv is throwing unhelpful error "No such file or ...
Inside the directory I want to move files out of are 2 directories, php and php.tmp. The error I get is cd: /path/to/working/directory/php:...
Read more >
No such file or directory when moving a file
The file (directory) name you have is mongodb-linux-x86_64-2.6.2-rc0 ... So you need to either define variable as such, and do the mv -ing:...
Read more >
Moving files with terminal, "no such file or directory" - Reddit
When you type "cd /", you are accessing the root directory which is not where you stored those folders. They should be in...
Read more >
mv: cannot move...: No such file or directory · Issue #276 · rupa/z
It looks like the shell can't find the source file ~/.z.3141 , which is true; it doesn't exist. In contrast the original error...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found