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

Error while scanning music (mysql issue) #217

Closed
Ark74 opened this issue Jun 27, 2017 · 10 comments
Closed

Error while scanning music (mysql issue) #217

Ark74 opened this issue Jun 27, 2017 · 10 comments
Milestone

Comments

@Ark74
Copy link

Ark74 commented Jun 27, 2017

Expected behavior

Complete scan
sudo -u www-data php occ audioplayer:scan --all

Under Nextcloud 12

Actual behavior

Won't complete scan.
It thows the following error:

/User/files//My song.mp3/

[Doctrine\DBAL\Exception\UniqueConstraintViolationException]                 
  An exception occurred while executing 'INSERT INTO `oc_audioplayer_tracks`   
  (`user_id`,`title`,`number`,`artist_id`,`album_id`,`length`,`file_id`,`bitr  
  ate`,`mimetype`,`genre_id`,`year`,`folder_id`,`disc`,`composer`,`subtitle`)  
   VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)' with params ["User", "My song", 
   0, 2, 2, "5:07", 1218, 128000, "audio\/mpeg", 1, 2016, 145,  1, "", ""]:                                                                  
  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1218  
  -User' for key 'aa_tracks_file_user_id_idx'                              
                                                                               

                                                                               
  [Doctrine\DBAL\Driver\PDOException]                                          
  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1218  
  -User' for key 'aa_tracks_file_user_id_idx'                              
                                                                               

                                                                               
  [PDOException]                                                               
  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1218  
  -User' for key 'aa_tracks_file_user_id_idx'

Steps to reproduce the behavior

  1. Enable app
  2. Run scan from cli:
    sudo -u www-data php occ audioplayer:scan --all
  3. Waint until fail

Possible solution (optional)

Additional information (optional)

Tried deleting/droping all the audioplayer tables from db - won't change behavior
Debug shows that i scans until failing at certain file.

Server configuration

Operating system:
Ubuntu 16.04

Web server:
Apache2

Database:
MySQL

PHP version:
7.0.18

Nextcloud/ownCloud version: (see /status.php)
12.0.0.29

Updated from an older Nextcloud/ownCloud or fresh install:
11.0.3

Audio Player version: (see /settings/apps)
2.0.2

Where did you install Audio Player from:
Nextcloud appstore

Are you using external storage, if yes which one: local/smb/sftp/...
Yes.
Dropbox

Are you using encryption: yes/no
No

@Rello
Copy link
Owner

Rello commented Jun 30, 2017

Hello,
thank you for the report. we are analyzing how this can happen at all

@Ark74
Copy link
Author

Ark74 commented Jun 30, 2017

Is there any software that you could recommend to check tag integrity, maybe there could be a malformed tag.
That's the only reason I could think of.

Or maybe something on the js(?) parser?

@Ark74
Copy link
Author

Ark74 commented Jul 1, 2017

Could this be related with iTunNORM / iTunSMPB values?

@Ark74
Copy link
Author

Ark74 commented Jul 1, 2017

I disabled the folder (.noaudio) that seemed to be the problem.
Now the scan completes, and tracks show on the player.

If i re-enable it, and rescan i find this issue on a different song (than the frst reported),


Show You Better.wav

                                                                                                                                                                                               
  [Doctrine\DBAL\Exception\DriverException]                                                                                                                                                    
  An exception occurred while executing 'INSERT INTO `oc_audioplayer_tracks` (`user_id`,`title`,`number`,`artist_id`,`album_id`,`length`,`file_id`,`bitrate`,`mimetype`,`genre_id`,`year`,`fo  
  lder_id`,`disc`,`composer`,`subtitle`) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)' with params ["Afriking", "\xc2\xb9\x00\x00\x00\xc2\xb6\x00\x27\xc3\x85\xc2\xb0\xc2\x93\x3c\xc3\xaa\xc2\x9f\x4  
  5\x38\xc3\xaa\xc2\x9f\x45\x00\x00\x00\x00\x00\x00\xc2\x90\x45\x02\x00\xc2\xb9\x45\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x4e\xc3\xbf\x1a\x00\x00\x0e\x0c\xc2\x98\x03\x00\xc2\xa2\x68\xc2\x  
  9a\x45\x00\x35\xc3\x8a\x02\x14\x00\x00\x00\x00\x00\x00\x00\x40\x20\x4b\x54\xc2\xa0\x68\xc2\x9a\x45\xc3\xbe\x01\x00\x00\x00\x00\x00\x00\xc2\x88\xc2\xbf\xc3\xbf\xc2\xbf\x65\xc3\x84\xc2\xb0\  
  xc2\x93\xc3\xbe\x01\x00\x00\x00\x00\x00\x00\x3a\xc3\x83\x0e\xc2\x98\xc3\xa7\xc3\x8f\xc3\xb2\xc2\x93\xc2\x80\x1d\x00\x03\xc2\x80\x1d\x00\x02\xc2\x94\xc3\x93\xc2\x9c\x45\x0b\xc3\x96\xc2\xb1  
  \x02\xc3\x84\xc2\xbf\xc3\xbf\xc2\xbf\xc3\x98\xc3\x80\xc3\xbf\xc2\xbf\xc2\xa8\xc2\xbf\xc3\xbf\xc2\xbf\xc2\xa0\x68\xc2\x9a\x45\xc2\x88\xc2\xa0\x53\xc2\xa0\x45\x0a\x06\xc2\x94\x00\x00\xc2\x9  
  0\x45\x00\x69\xc2\x9a\x45\x00\x00\xc3\x8a\x02\x00\x00\xc2\x90\x45\x74\x00\x00\x00\x02\xc3\x95\x0e\xc2\x98\x00\x00\x00\x00\x00\x00\xc3\x8a\x02\x08\xc3\x80\xc3\xbf\xc2\xbf\xc3\xa8\xc3\x2e\x  
  2e\x2e", 0, 1, 1, "3:56", 2570, 1411200, "audio\/wav", 1, 0, 687, 1, "", ""]:                                                                                                                
  SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\xC3...' for column 'title' at row 1                                                                                           
                                                                                                                                                                                               

Exception trace:
 () at /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:116
 Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException() at /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:128
 Doctrine\DBAL\DBALException::driverExceptionDuringQuery() at /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Statement.php:177
 Doctrine\DBAL\Statement->execute() at /var/www/nextcloud/apps/audioplayer/lib/Controller/ScannerController.php:834
 OCA\audioplayer\Controller\ScannerController->writeTrackToDB() at /var/www/nextcloud/apps/audioplayer/lib/Controller/ScannerController.php:664
 OCA\audioplayer\Controller\ScannerController->scanForAudios() at /var/www/nextcloud/apps/audioplayer/lib/Command/Scan.php:77
 OCA\audioplayer\Command\Scan->execute() at /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php:256
 Symfony\Component\Console\Command\Command->run() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:818
 Symfony\Component\Console\Application->doRunCommand() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:186
 Symfony\Component\Console\Application->doRun() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:117
 Symfony\Component\Console\Application->run() at /var/www/nextcloud/lib/private/Console/Application.php:170
 OC\Console\Application->run() at /var/www/nextcloud/console.php:92
 require_once() at /var/www/nextcloud/occ:11

                                                                                                      
  [Doctrine\DBAL\Driver\PDOException (HY000)]                                                         
  SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\xC3...' for column 'title' at row 1  
                                                                                                      

Exception trace:
 () at /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:93
 Doctrine\DBAL\Driver\PDOStatement->execute() at /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Statement.php:168
 Doctrine\DBAL\Statement->execute() at /var/www/nextcloud/apps/audioplayer/lib/Controller/ScannerController.php:834
 OCA\audioplayer\Controller\ScannerController->writeTrackToDB() at /var/www/nextcloud/apps/audioplayer/lib/Controller/ScannerController.php:664
 OCA\audioplayer\Controller\ScannerController->scanForAudios() at /var/www/nextcloud/apps/audioplayer/lib/Command/Scan.php:77
 OCA\audioplayer\Command\Scan->execute() at /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php:256
 Symfony\Component\Console\Command\Command->run() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:818
 Symfony\Component\Console\Application->doRunCommand() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:186
 Symfony\Component\Console\Application->doRun() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:117
 Symfony\Component\Console\Application->run() at /var/www/nextcloud/lib/private/Console/Application.php:170
 OC\Console\Application->run() at /var/www/nextcloud/console.php:92
 require_once() at /var/www/nextcloud/occ:11

                                                                                                      
  [PDOException (HY000)]                                                                              
  SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\xC3...' for column 'title' at row 1  
                                                                                                      

Exception trace:
 () at /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:91
 PDOStatement->execute() at /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:91
 Doctrine\DBAL\Driver\PDOStatement->execute() at /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Statement.php:168
 Doctrine\DBAL\Statement->execute() at /var/www/nextcloud/apps/audioplayer/lib/Controller/ScannerController.php:834
 OCA\audioplayer\Controller\ScannerController->writeTrackToDB() at /var/www/nextcloud/apps/audioplayer/lib/Controller/ScannerController.php:664
 OCA\audioplayer\Controller\ScannerController->scanForAudios() at /var/www/nextcloud/apps/audioplayer/lib/Command/Scan.php:77
 OCA\audioplayer\Command\Scan->execute() at /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php:256
 Symfony\Component\Console\Command\Command->run() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:818
 Symfony\Component\Console\Application->doRunCommand() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:186
 Symfony\Component\Console\Application->doRun() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:117
 Symfony\Component\Console\Application->run() at /var/www/nextcloud/lib/private/Console/Application.php:170
 OC\Console\Application->run() at /var/www/nextcloud/console.php:92
 require_once() at /var/www/nextcloud/occ:11

There are some files with iTunNORM and iTunSMPB tags in that folder, funny thing that specific file doesn't show those tags.

@Rello
Copy link
Owner

Rello commented Jul 1, 2017

Hello,
thank you for the detail. we have 2 issues here:

  • Duplicate entry: this relates to a file existing twice in your library but not as a double file - it´s the same file_id (from filecache table) in 2 different places. could you check if the folder you blocked with .noaudio is being used twice - e.g. shared double with that account? because it tries to add the combination of file_id+user_id twice and for some reason, your filecache_table is delivering the file twice.
    nevertheless, we will try to catch this case better

  • Incorrect string value: I expect this to be related with Scanner truncates long multiple title properly #203 because your file is multibyte and we had an issue with an incorrect split there.
    feel free to send me the file to audioplayer -at- scherello -dot- de to verify, that your case is handled with the fix

@Rello Rello added bug needs info feedback from requester required scanner labels Jul 1, 2017
@Rello Rello added this to the 2.1.0 milestone Jul 1, 2017
@Ark74
Copy link
Author

Ark74 commented Jul 2, 2017

Duplicate entry

I have gone under the users and it doesn't seem to have shared that folder.
The dropbox mount thoug is available for all the users, nevertheless the trouble folders is a subfolder from dropbox.
Maybe the issue comes at the Dropbox tree and not the NC one, but that might take time to check.

Incorrect string value

I've send an email about it, thanks.
I did move that sole wav/music file to a new instance and it wont recognize any music file after the file scan.
So maybe the issue is the file itself.

Rello added a commit that referenced this issue Jul 2, 2017
the check for folder_id was removed because in sharing contexts, the same file could be available in different folders
#217
@Rello Rello added testing and removed needs info feedback from requester required labels Jul 2, 2017
@Rello
Copy link
Owner

Rello commented Jul 2, 2017

  • Incorrect string: this could not be reproduced with the new version so it should be correct
  • duplicate file: the check was corrected to not validate against folder_id

@Ark74
Copy link
Author

Ark74 commented Jul 2, 2017

Would master be a good branch to test here?

@Rello
Copy link
Owner

Rello commented Jul 2, 2017 via email

@Ark74
Copy link
Author

Ark74 commented Jul 2, 2017

Made a test with 2.1.0-beta.2 and there is no longer any issue when scanning.
We'll wait the oficial release to retest and close this up if you don't mind.

Cheers! 🍻

ghost pushed a commit that referenced this issue Jul 4, 2017
@ghost ghost removed the pending release label Aug 29, 2017
@ghost ghost closed this as completed Aug 29, 2017
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants