music icon indicating copy to clipboard operation
music copied to clipboard

Automatic music collection changes detection does not work in shared folders

Open slehoun opened this issue 6 years ago • 9 comments

When I change or modify music files, these changes propagate to my music library automatically. However this does not work for other users that I shared music with (i.e. the changes are only automatically applied to owners' library only). When I change music files, other users have to manually rebuild their music library.

Steps to reproduce

-User A uploads folder with music to his cloud. -User A then shares this folder with user B. -User A changes content of this folder. (User A's music library is updated automatically.)

Expected behavior

User B's music library is updated automatically.

Actual behavior

User B's music library needs manual rescan.

Server configuration

Operating system: CentOS Linux release 7.6.1810 (Core) Web server: Apache 2.4.34 Database: MariaDB 5.5.60 PHP version: 7.2.10 Nextcloud version: 16.0.1 Updated from an older Nextcloud or fresh install: fresh install List of activated apps: Collabora Online 3.3.8 Accessibility 1.2.0 Activity 2.9.1 Brute-force settings 1.3.0 Calendar 1.7.0 Carnet 0.16.2 Collaborative tags 1.6.0 Comments 1.6.0 Deleted files 1.6.0 Federation 1.6.0 File sharing 1.8.0 First run wizard 2.5.0 Full text search 1.3.4 Full text search - Elasticsearch Platform 1.3.2 Full text search - Files 1.3.2 Gallery 18.3.0 Log Reader 2.1.0 Monitoring 1.6.0 Music 0.9.5 Nextcloud announcements 1.5.0 Notifications 2.4.1 Password policy 1.6.0 PDF viewer 1.5.0 Privacy 1.0.0 Recommendations 0.4.0 Right click 0.13.0 Share by mail 1.6.0 Support 1.0.0 Talk 6.0.2 Text editor 2.8.0 Theming 1.7.0 Update notification 1.6.0 Usage survey 1.4.0 Versions 1.9.0 Video player 1.5.0 Viewer 1.0.0 The content of config/config.php:

<?php
$CONFIG = array (
  'instanceid' => 'oc6m8zhqcahb',
  'passwordsalt' => 'xxxxxxxxxxxxxxxxxxxxxxxxxx',
  'secret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
  'trusted_domains' => 
  array (
    0 => '192.168.0.3',
    1 => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxx',
  ),
  'datadirectory' => '/home/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '16.0.1.1',
  'overwrite.cli.url' => 'http://192.168.0.3/nc',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'xxxxxxxxxxxxxxxxxx',
  'dbpassword' => 'xxxxxxxxxxxxxxxxxxxxxxxxx',
  'installed' => true,
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'nextcloud',
  'mail_domain' => 'xxxxxxxxxxxxxxxxxxx',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'xxxxxxxxxxxxxxxx',
  'mail_smtpport' => '465',
  'mail_smtpname' => 'xxxxxxxxxxxxxxxxxxxxxxxxxx',
  'mail_smtppassword' => 'xxxxxxxxxxxxxxxxxxxxxx',
  'maintenance' => false,
  'has_rebuilt_cache' => true,
);

Are you using external storage, if yes which one: local/smb/sftp/... no Are you using encryption: yes/no yes Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/... no

Client configuration

Browser: Firefox 60.7.0esr, Chromium 73.0.3683.75 Operating system: Debian 9.9

Logs

Web server error log

[Wed Jun 19 06:03:49.035405 2019] [php7:error] [pid 9249] [client 103.13.222.27:28108] script '/var/www/html/dong.php' not found or unable to stat
[Wed Jun 19 06:03:49.339475 2019] [php7:error] [pid 9249] [client 103.13.222.27:28108] script '/var/www/html/xun.php' not found or unable to stat
[Wed Jun 19 06:03:51.820721 2019] [php7:error] [pid 10420] [client 103.13.222.27:39906] script '/var/www/html/datas.php' not found or unable to stat
[Wed Jun 19 06:03:52.128109 2019] [php7:error] [pid 10420] [client 103.13.222.27:39906] script '/var/www/html/aojiao.php' not found or unable to stat
[Wed Jun 19 06:03:52.442133 2019] [php7:error] [pid 10420] [client 103.13.222.27:39906] script '/var/www/html/guipu.php' not found or unable to stat
[Wed Jun 19 06:03:52.749383 2019] [php7:error] [pid 10420] [client 103.13.222.27:39906] script '/var/www/html/zhui.php' not found or unable to stat
[Wed Jun 19 06:03:53.994791 2019] [php7:error] [pid 10420] [client 103.13.222.27:39906] script '/var/www/html/ji.php' not found or unable to stat
[Wed Jun 19 06:03:54.302045 2019] [php7:error] [pid 10420] [client 103.13.222.27:39906] script '/var/www/html/xing.php' not found or unable to stat
[Wed Jun 19 06:03:55.223036 2019] [php7:error] [pid 10420] [client 103.13.222.27:39906] script '/var/www/html/c.php' not found or unable to stat
[Wed Jun 19 06:03:55.533399 2019] [php7:error] [pid 10420] [client 103.13.222.27:39906] script '/var/www/html/c.php' not found or unable to stat
[Wed Jun 19 06:03:55.843356 2019] [php7:error] [pid 10420] [client 103.13.222.27:39906] script '/var/www/html/test.php' not found or unable to stat
[Wed Jun 19 06:03:56.153471 2019] [php7:error] [pid 10420] [client 103.13.222.27:39906] script '/var/www/html/laobiao.php' not found or unable to stat
[Wed Jun 19 06:03:57.397071 2019] [php7:error] [pid 10420] [client 103.13.222.27:39906] script '/var/www/html/shell.php' not found or unable to stat
[Wed Jun 19 06:03:58.067402 2019] [php7:error] [pid 10420] [client 103.13.222.27:39906] script '/var/www/html/12.php' not found or unable to stat
[Wed Jun 19 06:03:58.374536 2019] [php7:error] [pid 10420] [client 103.13.222.27:39906] script '/var/www/html/ecmsmod.php' not found or unable to stat
[Wed Jun 19 06:03:58.681831 2019] [php7:error] [pid 10420] [client 103.13.222.27:39906] script '/var/www/html/index.php' not found or unable to stat
[Wed Jun 19 06:04:00.287091 2019] [php7:error] [pid 10420] [client 103.13.222.27:39906] script '/var/www/html/user.php' not found or unable to stat, referer: 554fcae493e564ee0dc75bdf2ebf94caads|a:3:{s:2:"id";s:3:"'/*";s:3:"num";s:141:"*/ union select 1,0x272F2A,3,4,5,6,7,8,0x7b247b24524345275d3b6469652f2a2a2f286d6435284449524543544f52595f534550415241544f5229293b2f2f7d7d,0--";s:4:"name";s:3:"ads";}554fcae493e564ee0dc75bdf2ebf94ca
[Wed Jun 19 06:04:00.593710 2019] [php7:error] [pid 10420] [client 103.13.222.27:39906] script '/var/www/html/search.php' not found or unable to stat
[Wed Jun 19 06:04:00.912896 2019] [php7:error] [pid 10420] [client 103.13.222.27:39906] script '/var/www/html/index.php' not found or unable to stat
libpng warning: Interlace handling should be turned on when using png_read_image
libpng warning: Interlace handling should be turned on when using png_read_image
[Wed Jun 19 15:22:17.819800 2019] [mpm_prefork:notice] [pid 5112] AH00170: caught SIGWINCH, shutting down gracefully
[Wed Jun 19 15:24:36.998724 2019] [core:notice] [pid 5080] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Wed Jun 19 15:24:37.153327 2019] [suexec:notice] [pid 5080] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Wed Jun 19 15:24:37.425507 2019] [ssl:warn] [pid 5080] AH01909: RSA certificate configured for 192.168.0.3:443 does NOT include an ID which matches the server name
[Wed Jun 19 15:24:37.426324 2019] [ssl:warn] [pid 5080] AH02292: Init: Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366)
[Wed Jun 19 15:24:37.464108 2019] [auth_digest:notice] [pid 5080] AH01757: generating secret for digest authentication ...
[Wed Jun 19 15:24:37.465645 2019] [lbmethod_heartbeat:notice] [pid 5080] AH02282: No slotmem from mod_heartmonitor
[Wed Jun 19 15:24:37.467936 2019] [ssl:warn] [pid 5080] AH01909: RSA certificate configured for 192.168.0.3:443 does NOT include an ID which matches the server name
[Wed Jun 19 15:24:37.468530 2019] [ssl:warn] [pid 5080] AH02292: Init: Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366)
[Wed Jun 19 15:24:43.510915 2019] [mpm_prefork:notice] [pid 5080] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.2.10 configured -- resuming normal operations
[Wed Jun 19 15:24:43.510995 2019] [core:notice] [pid 5080] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
libpng warning: Interlace handling should be turned on when using png_read_image

Nextcloud log

Error	jsresourceloader	Could not find resource core/js/placeholder.js to load		2019-06-19T16:08:44+0200
Error	jsresourceloader	Could not find resource core/js/placeholder.js to load		2019-06-19T16:01:01+0200
Error	PHP	Undefined index: mpeg at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/module.audio.mp3.php#1677		2019-06-19T15:58:10+0200
Error	PHP	Undefined index: mpeg at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/module.audio.mp3.php#1676		2019-06-19T15:58:10+0200
Error	PHP	Undefined index: mpeg at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/module.audio.mp3.php#1675		2019-06-19T15:58:10+0200
Error	PHP	fread() expects parameter 1 to be resource, null given at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/getid3.php#1986		2019-06-19T15:58:10+0200
Error	PHP	ftell() expects parameter 1 to be resource, null given at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/getid3.php#1953		2019-06-19T15:58:10+0200
Error	PHP	fseek() expects parameter 1 to be resource, null given at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/getid3.php#2029		2019-06-19T15:58:10+0200
Error	PHP	Undefined index: mpeg at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/module.audio.mp3.php#1677		2019-06-19T15:57:42+0200
Error	PHP	Undefined index: mpeg at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/module.audio.mp3.php#1676		2019-06-19T15:57:42+0200
Error	PHP	Undefined index: mpeg at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/module.audio.mp3.php#1675		2019-06-19T15:57:42+0200
Error	PHP	fread() expects parameter 1 to be resource, null given at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/getid3.php#1986		2019-06-19T15:57:42+0200
Error	PHP	ftell() expects parameter 1 to be resource, null given at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/getid3.php#1953		2019-06-19T15:57:42+0200
Error	PHP	fseek() expects parameter 1 to be resource, null given at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/getid3.php#2029		2019-06-19T15:57:42+0200
Error	PHP	Undefined index: mpeg at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/module.audio.mp3.php#1677		2019-06-19T15:57:40+0200
Error	PHP	Undefined index: mpeg at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/module.audio.mp3.php#1676		2019-06-19T15:57:40+0200
Error	PHP	Undefined index: mpeg at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/module.audio.mp3.php#1675		2019-06-19T15:57:40+0200
Error	PHP	fread() expects parameter 1 to be resource, null given at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/getid3.php#1986		2019-06-19T15:57:40+0200
Error	PHP	ftell() expects parameter 1 to be resource, null given at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/getid3.php#1953		2019-06-19T15:57:40+0200
Error	PHP	fseek() expects parameter 1 to be resource, null given at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/getid3.php#2029		2019-06-19T15:57:40+0200
Error	PHP	Undefined index: mpeg at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/module.audio.mp3.php#1677		2019-06-19T15:57:21+0200
Error	PHP	Undefined index: mpeg at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/module.audio.mp3.php#1676		2019-06-19T15:57:21+0200
Error	PHP	Undefined index: mpeg at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/module.audio.mp3.php#1675		2019-06-19T15:57:21+0200
Error	PHP	fread() expects parameter 1 to be resource, null given at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/getid3.php#1986		2019-06-19T15:57:21+0200
Error	PHP	ftell() expects parameter 1 to be resource, null given at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/getid3.php#1953		2019-06-19T15:57:21+0200
Error	PHP	fseek() expects parameter 1 to be resource, null given at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/getid3.php#2029		2019-06-19T15:57:21+0200
Error	jsresourceloader	Could not find resource core/js/placeholder.js to load		2019-06-19T15:30:12+0200
Error	PHP	imagecreatefromstring(): gd-jpeg, libjpeg: recoverable error: Premature end of JPEG file at /var/www/html/nc/apps/music/utility/coverhelper.php#236		2019-06-19T15:28:11+0200
Error	jsresourceloader	Could not find resource core/js/placeholder.js to load		2019-06-19T15:25:51+0200
Error	PHP	Undefined index: mpeg at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/module.audio.mp3.php#1677		2019-06-19T10:15:37+0200
Error	PHP	Undefined index: mpeg at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/module.audio.mp3.php#1676		2019-06-19T10:15:37+0200
Error	PHP	Undefined index: mpeg at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/module.audio.mp3.php#1675		2019-06-19T10:15:37+0200
Error	PHP	fread() expects parameter 1 to be resource, null given at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/getid3.php#1986		2019-06-19T10:15:37+0200
Error	PHP	ftell() expects parameter 1 to be resource, null given at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/getid3.php#1953		2019-06-19T10:15:37+0200
Error	PHP	fseek() expects parameter 1 to be resource, null given at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/getid3.php#2029		2019-06-19T10:15:37+0200
Error	PHP	Undefined index: mpeg at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/module.audio.mp3.php#1677		2019-06-19T10:14:31+0200
Error	PHP	Undefined index: mpeg at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/module.audio.mp3.php#1676		2019-06-19T10:14:31+0200
Error	PHP	Undefined index: mpeg at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/module.audio.mp3.php#1675		2019-06-19T10:14:31+0200
Error	PHP	fread() expects parameter 1 to be resource, null given at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/getid3.php#1986		2019-06-19T10:14:31+0200
Error	PHP	ftell() expects parameter 1 to be resource, null given at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/getid3.php#1953		2019-06-19T10:14:31+0200
Error	PHP	fseek() expects parameter 1 to be resource, null given at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/getid3.php#2029		2019-06-19T10:14:31+0200
Error	PHP	Undefined index: mpeg at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/module.audio.mp3.php#1677		2019-06-19T10:14:05+0200
Error	PHP	Undefined index: mpeg at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/module.audio.mp3.php#1676		2019-06-19T10:14:05+0200
Error	PHP	Undefined index: mpeg at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/module.audio.mp3.php#1675		2019-06-19T10:14:05+0200
Error	PHP	fread() expects parameter 1 to be resource, null given at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/getid3.php#1986		2019-06-19T10:14:05+0200
Error	PHP	ftell() expects parameter 1 to be resource, null given at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/getid3.php#1953		2019-06-19T10:14:05+0200
Error	PHP	fseek() expects parameter 1 to be resource, null given at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/getid3.php#2029		2019-06-19T10:14:05+0200
Error	PHP	Undefined index: mpeg at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/module.audio.mp3.php#1677		2019-06-19T10:13:47+0200
Error	PHP	Undefined index: mpeg at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/module.audio.mp3.php#1676		2019-06-19T10:13:47+0200
Error	PHP	Undefined index: mpeg at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/module.audio.mp3.php#1675		2019-06-19T10:13:47+0200
Error	PHP	fread() expects parameter 1 to be resource, null given at /var/www/html/nc/apps/music/3rdparty/getID3/getid3/getid3.php#1986		2019-06-19T10:13:47+0200

slehoun avatar Jun 19 '19 14:06 slehoun

Thanks for the report. This is something which is supposed to work, but maybe it has broken on some update. Or alternatively, something in your environment differs from my test environment. Anyway, I have to test this when I have time.

paulijar avatar Jun 19 '19 17:06 paulijar

Got this issue too, using NC 16.0.1 and Music 0.9.5

megamaced avatar Jul 17 '19 09:07 megamaced

My memory didn't serve me quite right on my initial answer. This has probably never worked quite right.

What does work, is when user A shares a file/folder with user B, and then the user A deletes one of the shared files. In that case, the file is removed automatically also from the library of B. If user A uploads new files to a shared folder, then the user B is prompted to scan them the next time she opens the Music app and I think this is adequate. But if user A modifies one of the shared files, then the change is never propagated to B's library, and this kind of sucks.

Technically, it's somewhat problematic to update the B's library immediately on the file modification. Also, it could potentially create a performance issue since one file could be shared with a large number of users, and each user's library would need to be updated separately. The best solution could be to somehow mark the changed file as "dirty" in the B's library, and then rescan the dirty files when B next time opens the app.

paulijar avatar Jul 17 '19 13:07 paulijar

In my case:

User A shares a folder full of music User B adds a new subfolder and puts an OGG file into it

User B Music app does not see the new music that he uploaded to the share from User A

megamaced avatar Jul 17 '19 15:07 megamaced

@megamaced I tested your scenario on Nextcloud 16.0.3 and Music 0.10.0 but could not reproduce the issue. User B saw the newly uploaded OGG file immediately upon opening the Music app. User A, on the other hand, was prompted about new files and saw the uploaded file after clicking to scan the files.

Is this something which happens systematically on your system. Does nextcloud.log show any errors after running these steps?

paulijar avatar Jul 27 '19 12:07 paulijar

@paulijar discovered it was my error, ignore me

megamaced avatar Jul 28 '19 08:07 megamaced

Hello, Im experiencing the same problem on NC 18.4. Is there a way to force the scan on the account B ?

sebastienserre avatar Aug 01 '20 15:08 sebastienserre

@sebastienserre This is possible using the occ command line tool. Assuming your web server uses user name www-data, the correct command to give in the Nextcloud root folder would be

sudo -u www-data ./occ music:scan --rescan B

If you wish, you can also limit the rescan to some specific folder by giving the option --folder=<target_path>.

paulijar avatar Aug 01 '20 16:08 paulijar

@slehoun This issue seems work? Now you can click the re-scan function 圖片

jjasoncool avatar Nov 27 '23 03:11 jjasoncool