Uploaded image for project: 'Picard'
  1. Picard
  2. PICARD-2506

fpcalc errors out with paths > 259 characters

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 2.8.2
    • 2.8.1
    • None
    • None
    • Windows

      When fingerprinting files that have long paths/paths longer than 259 characters, `fpcalc` seems to fails to fingerprint with an error similar to the following:

      D: 01:08:15,355 acoustid\__init__._run_next_task:252: Starting fingerprint calculator 'C:\\Program Files\\MusicBrainz Picard\\fpcalc.exe' '\\\\BenjiQNAP\\Media\\Music\\Vaughan Williams, R․; Johnson, G․, Royal Scottish National Orchestra,\\Folk Songs of the Four Seasons Suite ⁄ Bucolic Suite ⁄ Dark Pastoral  [CD - CDLX 7289]\\06 Bucolic Suite∶ I․ Allegro.flac'
      E: 01:08:15,355 acoustid\__init__._on_fpcalc_finished:209: Fingerprint calculator failed exit code = 2, exit status = 0, error = Unknown error

      This happens even if Picard itself has no issues reading/writing the file, and regardless of whether Picard has the "truncate path to 259 characters" option enabled or not.

      It seems like the `fpcalc` invocation above double-escapes path separators, which means even if you do enable the Picard "truncate path to 259 characters" option, the path `fpcalc` is resolving is actually slightly over that limit due to the extra escaping, and it will fail.

          [PICARD-2506] fpcalc errors out with paths > 259 characters

          GitHub Bot added a comment -

          See code changes in pull request #2124 submitted by phw.

          GitHub Bot added a comment - See code changes in pull request #2124 submitted by phw .

          @phanboy_iv: My assumption is you have configured Win 10 for long path support, right?

          Just for the sake of verifying my theory, could disable long path support in Windows registry again, then restart Picard. When you now try scanning the same path again, does it work and does fpcalc get called with the path prefixed with "\\?\" ?

          Philipp Wolfer added a comment - @phanboy_iv: My assumption is you have configured Win 10 for long path support, right? Just for the sake of verifying my theory, could disable long path support in Windows registry again, then restart Picard. When you now try scanning the same path again, does it work and does fpcalc get called with the path prefixed with "\\?\" ?

          We should first try passing long paths with long path prefix.

          Very likely this would already work on Systems where Picard is running in the mode where it uses the prefix. So we need an exception for calls to fpcalc if Picard is otherwise running without prefix.

          Regarding double backslashes that's just Python's escape syntax for strings. Has no influence on actual string length.

          Philipp Wolfer added a comment - We should first try passing long paths with long path prefix. Very likely this would already work on Systems where Picard is running in the mode where it uses the prefix. So we need an exception for calls to fpcalc if Picard is otherwise running without prefix. Regarding double backslashes that's just Python's escape syntax for strings. Has no influence on actual string length.

          Zas added a comment -

          `fpcalc` is using `ffmpeg` to read audio files: https://github.com/acoustid/chromaprint/blob/41e23c212594ee22d30a9d64b3438efae7ab6148/src/audio/ffmpeg_audio_reader.h#L144

          And it seems `ffmpeg` had issues with Windows10 long paths until very recently: https://trac.ffmpeg.org/ticket/8885

          May be we need to check for fpcalc version and warn user if it doesn't support long paths.

           

           

          Zas added a comment - `fpcalc` is using `ffmpeg` to read audio files: https://github.com/acoustid/chromaprint/blob/41e23c212594ee22d30a9d64b3438efae7ab6148/src/audio/ffmpeg_audio_reader.h#L144 And it seems `ffmpeg` had issues with Windows10 long paths until very recently: https://trac.ffmpeg.org/ticket/8885 May be we need to check for fpcalc version and warn user if it doesn't support long paths.    

            outsidecontext Philipp Wolfer
            phanboy_iv phanboy_iv
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                Version Package
                2.8.2