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

mutagen.MutagenError: [Errno 13] Permission denied #2716

Closed
tobiaswuerth opened this issue Oct 20, 2017 · 6 comments
Closed

mutagen.MutagenError: [Errno 13] Permission denied #2716

tobiaswuerth opened this issue Oct 20, 2017 · 6 comments
Labels
needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature."

Comments

@tobiaswuerth
Copy link

Problem

Running this command:

beet.exe import -s -q -p Z:\music\

Led to this problem:

Z:\music\25qa8h2h\02 Whitney Houston - Fine.mp3
Tagging track: Whitney Houston - Fine
URL:
    https://musicbrainz.org/recording/29f0df71-bc59-40bd-89aa-8afd877071a7
(Similarity: 100.0%)
error writing Z:\music\_\_\Darude\Moments\02-Be With You Tonight.mp3: [Errno 13] Permission denied: '\\\\?\\Z:\\music\\_\\_\\Darude\\Moments\\02-Be With You Tonight.mp3'
Traceback (most recent call last):
  File "d:\users\administrator\appdata\local\programs\python\python36\lib\site-packages\mutagen\_util.py", line 218, in _openfile
    fileobj = open(filename, "rb+" if writable else "rb")
PermissionError: [Errno 13] Permission denied: '\\\\?\\Z:\\music\\_\\_\\Darude\\Moments\\02-Be With You Tonight.mp3'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Users\Administrator\AppData\Local\Programs\Python\Python36\Scripts\beet-script.py", line 11, in <module>
    load_entry_point('beets==1.4.5', 'console_scripts', 'beet')()
  File "d:\users\administrator\appdata\local\programs\python\python36\lib\site-packages\beets\ui\__init__.py", line 1256, in main
    _raw_main(args)
  File "d:\users\administrator\appdata\local\programs\python\python36\lib\site-packages\beets\ui\__init__.py", line 1243, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "d:\users\administrator\appdata\local\programs\python\python36\lib\site-packages\beets\ui\commands.py", line 934, in import_func
    import_files(lib, paths, query)
  File "d:\users\administrator\appdata\local\programs\python\python36\lib\site-packages\beets\ui\commands.py", line 911, in import_files
    session.run()
  File "d:\users\administrator\appdata\local\programs\python\python36\lib\site-packages\beets\importer.py", line 325, in run
    pl.run_parallel(QUEUE_SIZE)
  File "d:\users\administrator\appdata\local\programs\python\python36\lib\site-packages\beets\util\pipeline.py", line 445, in run_parallel
    six.reraise(exc_info[0], exc_info[1], exc_info[2])
  File "d:\users\administrator\appdata\local\programs\python\python36\lib\site-packages\six.py", line 693, in reraise
    raise value
  File "d:\users\administrator\appdata\local\programs\python\python36\lib\site-packages\beets\util\pipeline.py", line 358, in run
    self.coro.send(msg)
  File "d:\users\administrator\appdata\local\programs\python\python36\lib\site-packages\beets\util\pipeline.py", line 171, in coro
    task = func(*(args + (task,)))
  File "d:\users\administrator\appdata\local\programs\python\python36\lib\site-packages\beets\importer.py", line 1459, in manipulate_files
    session=session,
  File "d:\users\administrator\appdata\local\programs\python\python36\lib\site-packages\beets\importer.py", line 708, in manipulate_files
    plugins.send('import_task_files', session=session, task=self)
  File "d:\users\administrator\appdata\local\programs\python\python36\lib\site-packages\beets\plugins.py", line 452, in send
    result = handler(**arguments)
  File "d:\users\administrator\appdata\local\programs\python\python36\lib\site-packages\beets\plugins.py", line 124, in wrapper
    return func(*args, **kwargs)
  File "d:\users\administrator\appdata\local\programs\python\python36\lib\site-packages\beetsplug\scrub.py", line 150, in import_task_files
    self._scrub_item(item)
  File "d:\users\administrator\appdata\local\programs\python\python36\lib\site-packages\beetsplug\scrub.py", line 129, in _scrub_item
    self._scrub(item.path)
  File "d:\users\administrator\appdata\local\programs\python\python36\lib\site-packages\beetsplug\scrub.py", line 101, in _scrub
    f.delete()
  File "d:\users\administrator\appdata\local\programs\python\python36\lib\site-packages\mutagen\_util.py", line 128, in wrapper
    writable, create) as h:
  File "d:\users\administrator\appdata\local\programs\python\python36\lib\contextlib.py", line 81, in __enter__
    return next(self.gen)
  File "d:\users\administrator\appdata\local\programs\python\python36\lib\site-packages\mutagen\_util.py", line 227, in _openfile
    raise MutagenError(e)
mutagen.MutagenError: [Errno 13] Permission denied: '\\\\?\\Z:\\music\\_\\_\\Darude\\Moments\\02-Be With You Tonight.mp3'

Setup

  • OS: Microsoft Windows Server 2016 Standard
  • Python version: v3.6.3:2c5fed8
  • beets version: 1.4.5
  • Turning off plugins made problem go away (yes/no): not sure, cannot reproduce

My configuration (output of beet config) is:

lyrics:
    bing_lang_from: []
    auto: yes
    bing_client_secret: REDACTED
    bing_lang_to:
    google_API_key: REDACTED
    google_engine_ID: REDACTED
    genius_api_key: REDACTED
    fallback:
    force: no
    sources: [google, lyricwiki, musixmatch]
directory: Z:\music\_\
library: D:\programs\beets\data.db

import:
    move: yes
    write: yes
    link: no
    hardlink: no
    resume: no
    copy: no

replace:
    '[\\/]': _
    ^\.: _
    '[\x00-\x1f]': _
    '[<>:"\?\*\|]': _
    \.$: _
    \s+$: ''
    ^\s+: ''
    ^-: _

ui:
    color: no

plugins: scrub web chroma acousticbrainz embedart fetchart lyrics lastgenre
terminal_encoding: utf_8

match:
    strong_rec_thresh: 0.1
    medium_rec_thresh: 0.1
    rec_gap_thresh: 0.1
chroma:
    auto: yes

paths:
    default: $genre/$albumartist/$album%aunique{}/$track-$title
    singleton: $genre/$albumartist/$album%aunique{}/$track-$title
web:
    host: 127.0.0.1
    port: 8337
    cors: ''
    reverse_proxy: no
    include_paths: no
embedart:
    maxwidth: 0
    auto: yes
    compare_threshold: 0
    ifempty: no
    remove_art_file: no
scrub:
    auto: yes
acousticbrainz:
    auto: yes
    force: no
lastgenre:
    whitelist: yes
    min_weight: 10
    count: 1
    fallback:
    canonical: no
    source: album
    force: yes
    auto: yes
    separator: ', '
    prefer_specific: no
fetchart:
    auto: yes
    minwidth: 0
    maxwidth: 0
    enforce_ratio: no
    cautious: no
    cover_names:
    - cover
    - front
    - art
    - album
    - folder
    sources:
    - filesystem
    - coverart
    - itunes
    - amazon
    - albumart
    google_key: REDACTED
    google_engine: 001442825323518660753:hrh5ch1gjzm
    fanarttv_key: REDACTED
    store_source: no
@sampsyo sampsyo added the needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature." label Oct 20, 2017
@sampsyo
Copy link
Member

sampsyo commented Oct 20, 2017

Thank you for the report! Do you know how we might reproduce this issue? Does it happen consistently on certain files but not on others, for example?

@tobiaswuerth
Copy link
Author

It doesn't show anykind of pattern, that is why i cannot reproduce it.

I think there could be two possible issues here. The first is that Z:\ is a NAS, so maybe it has something to do with connectivity issues. My second guess is that the file wants to move itself to the same location since the file beeing processed is already located in the output directory specified.

@sampsyo
Copy link
Member

sampsyo commented Oct 20, 2017

OK, thanks! I've pushed a potential fix. I realize that it might be difficult to tell, but can you check whether this seems to eliminate the problem?

@tobiaswuerth
Copy link
Author

Ok, thank you! I'll let it run and come back to you if the issue should still be around

@tobiaswuerth
Copy link
Author

It's been running for 48h now without any exception. Before it occurred at least once an hour. Just to let you know, I highly assume it's fixed. Thanks!

@sampsyo
Copy link
Member

sampsyo commented Oct 23, 2017

Yay! Thanks for reporting back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature."
Projects
None yet
Development

No branches or pull requests

2 participants