Open ShaeBrown opened 6 years ago
Hi! This error is telling you that the MP3 file you passed in couldn’t be found on the filesystem. Can you check whether the file actually exists? If so, is there a way you can help us reproduce the problem?
My repo is here: https://github.com/ShaeBrown/csc475/tree/deploy The error is occuring in line 27 in flask_app.py. This call to librosa.load:
path = os.path.join(app.config['UPLOAD_FOLDER'], filename)
print(path)
print(os.path.isfile(path))
song, sr = librosa.core.load(path)
os.path.isfile(path) prints as true so I'm sure the file is there. The error is occurring in the class FFmpegAudioFile class in the _get_info method. Specifically these lines here:
line = self.proc.stderr.readline()
...
...
if 'no such file' in line:
raise IOError('file not found')
It only happens with mp3 files and not wav files. This is happening when deployed to heroku but works fine on my local machine.
Huh! I'm not sure how to reproduce the problem if it only happens on Heroku. Maybe it can be attributed to a difference in ffmpeg versions? Please update this thread if there's anything I can do to look into it.
Thanks, I'll try and do some more investigation. Both my computer and Heroku are installing from the same url
http://ca.archive.ubuntu.com/ubuntu/pool/universe/f/ffmpeg/ffmpeg_2.8.11-0ubuntu0.16.04.1_amd64.deb
The same issue seemed to appear here on stackoverflow.
Strange! If there's some way to reproduce it in an environment you can control, one way to diagnose the problem might be to print out FFmpeg's output (i.e., the value of line
) to see if there's more information about why it can't find the file.
Maybe this is some weird effect of Heroku's filesystem sandboxing?
The output of line is:
ffmpeg: error while loading shared libraries: libavdevice-ffmpeg.so.56: cannot open shared object file: no such file or directory
Seems that it is an issue with ffmpeg and the filesystem.
Edit: Resolved using this buildpack. Was an issue with the way the heroku apt buildpack was setting LD_LIBRARY_PATH.
Great; thank you for investigating!
It looks like there's still something we can improve, however: we could help diagnose this by distinguishing between a case where the audio file isn't found and one of these dynamic linking errors. I'll keep the ticket open regarding that.
fwiw, I ran in to this problem as well. It was very confusing. I thought I had a permission error, or something wrong with my path.
Same issue here
When reading mp3 files I get the following output:
I have the following packages:
ffmpeg is installed