Music Icon (Note = audio.svg) is shown but the browser log is full of HTTP500 errors for every MP3 without cover
URL example: ..../nextcloud/apps/files_sharing/ajax/publicpreview.php?file=/Swiss+Tenors+–+Natascha.mp3&c=582f076e2e3de78054df0786d1cf78af&x=32&y=32&t=LslrLFGYuFSlkyk

Nextcloud version: (see Nextcloud admin page)
NC11 fresh install
Are you using external storage, if yes which one: local/smb/sftp/...
no
Are you using encryption: yes/no
no
Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
no
Nextcloud log
{"reqId":"Mx\/DdQrsnXa9AdmKvdvu","remoteAddr":"192.168.0.39","app":"index","message":"Exception: {\"Exception\":\"Error\",\"Message\":\"Call to a member function file_get_contents() on null\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/legacy\\\/image.php(597): OC\\\\Files\\\\Filesystem::file_get_contents('\\\/var\\\/www\\\/nextcl...')\\n#1 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Preview\\\/MP3.php(80): OC_Image->loadFromFile('\\\/var\\\/www\\\/nextcl...')\\n#2 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Preview\\\/MP3.php(64): OC\\\\Preview\\\\MP3->getNoCoverThumbnail()\\n#3 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Preview\\\/GeneratorHelper.php(54): OC\\\\Preview\\\\MP3->getThumbnail('\\\/files\\\/MP3\\\/Swis...', 2048, 2048, false, Object(OC\\\\Files\\\\View))\\n#4 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Preview\\\/Generator.php(155): OC\\\\Preview\\\\GeneratorHelper->getThumbnail(Object(OC\\\\Preview\\\\MP3), Object(OC\\\\Files\\\\Node\\\\File), 2048, 2048)\\n#5 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Preview\\\/Generator.php(108): OC\\\\Preview\\\\Generator->getMaxPreview(Object(OC\\\\Files\\\\SimpleFS\\\\SimpleFolder), Object(OC\\\\Files\\\\Node\\\\File), 'audio\\\/mpeg')\\n#6 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/PreviewManager.php(182): OC\\\\Preview\\\\Generator->getPreview(Object(OC\\\\Files\\\\Node\\\\File), 32, 32, true, 'fill', 'audio\\\/mpeg')\\n#7 \\\/var\\\/www\\\/nextcloud\\\/apps\\\/files_sharing\\\/lib\\\/Controller\\\/PublicPreviewController.php(96): OC\\\\PreviewManager->getPreview(Object(OC\\\\Files\\\\Node\\\\File), 32, 32, true)\\n#8 [internal function]: OCA\\\\Files_Sharing\\\\Controller\\\\PublicPreviewController->getPreview(Object(OC\\\\Files\\\\Node\\\\File), 32, 32, 'LslrLFGYuFSlkyk', false)\\n#9 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Dispatcher.php(160): call_user_func_array(Array, Array)\\n#10 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Dispatcher.php(90): OC\\\\AppFramework\\\\Http\\\\Dispatcher->executeController(Object(OCA\\\\Files_Sharing\\\\Controller\\\\PublicPreviewController), 'getPreview')\\n#11 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/AppFramework\\\/App.php(114): OC\\\\AppFramework\\\\Http\\\\Dispatcher->dispatch(Object(OCA\\\\Files_Sharing\\\\Controller\\\\PublicPreviewController), 'getPreview')\\n#12 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/AppFramework\\\/Routing\\\/RouteActionHandler.php(47): OC\\\\AppFramework\\\\App::main('OCA\\\\\\\\Files_Shari...', 'getPreview', Object(OC\\\\AppFramework\\\\DependencyInjection\\\\DIContainer), Array)\\n#13 [internal function]: OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler->__invoke(Array)\\n#14 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Route\\\/Router.php(299): call_user_func(Object(OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler), Array)\\n#15 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/base.php(1010): OC\\\\Route\\\\Router->match('\\\/apps\\\/files_sha...')\\n#16 \\\/var\\\/www\\\/nextcloud\\\/index.php(40): OC::handleRequest()\\n#17 {main}\",\"File\":\"\\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/Filesystem.php\",\"Line\":719}","level":3,"time":"2016-12-18T14:07:08+00:00","method":"GET","url":"\/nextcloud\/apps\/files_sharing\/ajax\/publicpreview.php?file=%2FSwiss+Tenors+%E2%80%93+Natascha.mp3&c=582f076e2e3de78054df0786d1cf78af&x=32&y=32&t=LslrLFGYuFSlkyk","user":"--","version":"11.0.0.10"}
$this->resource = imagecreatefromstring(
\OC\Files\Filesystem::file_get_contents(
\OC\Files\Filesystem::getLocalPath($imagePath)
)
);
this fails on https://github.com/nextcloud/server/blob/ba87db3fccb40aa58d84d12932424c83a4db411f/lib/private/Preview/MP3.php#L73-L80
Not sure why this is not triggered from the normal file list, but maybe @rullzer knows?
Adding a return false before stops the 500, but makes it return a 404 instead.
Aaah there is no filesystem setup. Which makes this fail (and it is when you are logged in). let me see if I can somehow debug this.
Aaah and it seems OC_Image can't handle svg.
I think it's weird that \OC\Files\Filesystem::file_get_contents( is actually invoked for a static file that is not in the data dir. I think it should not.
It should not but changing that won't solve the issue at hand.
https://github.com/nextcloud/server/issues/1112
This could be related. Has nothing to do with audio files though.
Looking at the access logs it must be an audio issue after all.
Happens to me as well.
Wat I am seeing in the logs is failure to open the audio.svg file due to a badly composed path..
My log files are showing that the path to the audio.svg is being looked for in the user folder instead of the install folder.. Thus instead of opening /opt/nextcloud/core/img/filetypes/audio.svg
it is instead trying to open /opt/nextcloud/data/MyAwesomeUser/files/opt/nextcloud/core/img/filetypes/audio.svg
Yup.. looking at the source code, that is the problem.
OC_Image is being used to load up the audio.svg in private/Preview/MP3.php#getNoCoverThumbnail.
However OC_Image's loadFromFile routing uses getLocalPath which fetches files ONLY from the user's directory.. So this will never work and the code needs to be rewritten to load the image from the correct location in getNoCoverThumbnail
Also encountered with the problem.
If I upload mp3 file with a cover, the are no errors. But, if I upload mp3 without a cover, I may see a lot of errors in the log.
Also, every time I open the folder with mp3 file inside through the web, errors become more and more.
php version: 7.0.15, if this is important.
I just create a few screenshots, to make it clearer.
mp3 with cover, no errors:

mp3 without cover, bunch of errors:

Hello all,
Is there a fix for this? I can't seem to find it.
Yes. You can find fix one post higher. https://github.com/nextcloud/server/pull/3794
I guess this is related to this bug, so I'll write it here:
This is what a shared mp3 file without cover looks like now (I'm on 12.0):
Error is 404 for https://domain.tld/index.php/apps/files_sharing/ajax/publicpreview.php?...