[SOLVED] SQL error on (occ) music scan

Nextcloud version (eg, 12.0.2): 15.0.5
Operating system and version (eg, Ubuntu 17.04): Ubuntu 18.04 x86_64
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.29
PHP version (eg, 7.1): 7.2.15

The issue you are facing:
SQL errors while scanning music

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Have music files with non-ascii characters
  2. Do a music scan via OCC
  3. Error is thrown

The output of your Nextcloud log in Admin > Logging:

PHP	Undefined index: mpeg at /var/www/nextcloud/apps/music/3rdparty/getID3/getid3/module.audio.mp3.php#1677
PHP	Undefined index: mpeg at /var/www/nextcloud/apps/music/3rdparty/getID3/getid3/module.audio.mp3.php#1676
PHP	Undefined index: mpeg at /var/www/nextcloud/apps/music/3rdparty/getID3/getid3/module.audio.mp3.php#1675
PHP	fread() expects parameter 1 to be resource, null given at /var/www/nextcloud/apps/music/3rdparty/getID3/getid3/getid3.php#1986
PHP	ftell() expects parameter 1 to be resource, null given at /var/www/nextcloud/apps/music/3rdparty/getID3/getid3/getid3.php#1953
PHP	fseek() expects parameter 1 to be resource, null given at /var/www/nextcloud/apps/music/3rdparty/getID3/getid3/getid3.php#2029

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => '*<redacted>*',
  'passwordsalt' => '*<redacted>*',
  'secret' => '*<redacted>*',
  'trusted_domains' => 
  array (
    0 => '*<redacted>*',
  ),
  'datadirectory' => '/nextcloud-storage',
  'dbtype' => 'mysql',
  'version' => '15.0.5.3',
  'overwrite.cli.url' => '*<redacted>*',
  'dbname' => 'nextcloud',
  'dbhost' => '*<redacted>*',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => '*<redacted>*',
  'installed' => true,
);

The output of your Apache/nginx/system log in /var/log/____:
https://pastebin.com/Tpa0Rw8g

Additional Info:
I’ve setup my Nextcloud server, transfered my music library to it via FTP, scanned it with OCC and started up the Music app.

It says new music found so I let it scan but it seems to get stuck at 13330 out of 19930.

After some searching online I found out that OCC is also able to do this scanning but with more details on what’s happening so I ran OCC and got this:
https://pastebin.com/ezXFDwkn

Okay so the title of “this” track is too long. But which track out of the 6640 “new” ones is it?
I already tried decoding the Unicode but it returns a bunch of blocks.

Is there anyway to find out which track this is?

I’ve already tried finding it by running find /path/to/files -name '*[! -~]*' changed all the names of the files that came up (even the metadata when possible), rescanned it with ./occ files:scan and rescanned the music again with ./occ music:scan.
That seemed to have worked for a while but then the same type of error occurred a bit later.

bump, no one? Really? I really need help with this. I’ve already asked on 4 different platforms and nobody figured it out yet.

Okay so apparently if debug mode is enabled it will show less instead of more.
When I scan without debug mode it occ told me which files it’s processing.

Hope someone else can use this info as well.