Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Automatic music collection changes detection does not work in shared folders #706

Closed
slehoun opened this issue Jun 19, 2019 · 10 comments
Closed
Labels

Comments

@slehoun
Copy link

slehoun commented Jun 19, 2019

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
@paulijar
Copy link
Collaborator

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 paulijar added the Bug label Jun 19, 2019
@megamaced
Copy link

Got this issue too, using NC 16.0.1 and Music 0.9.5

@paulijar
Copy link
Collaborator

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.

@megamaced
Copy link

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

@paulijar
Copy link
Collaborator

@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?

@megamaced
Copy link

@paulijar discovered it was my error, ignore me

@sebastienserre
Copy link

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

@paulijar
Copy link
Collaborator

paulijar commented Aug 1, 2020

@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>.

@jjasoncool
Copy link

jjasoncool commented Nov 27, 2023

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

paulijar added a commit that referenced this issue Nov 23, 2024
- If the user's library contains any files potentially needing rescanning,
  this is now prompted to the user upon app loading, similarly as any new
  files to scan

- The rescanning of modified files, both with the new prompt and using
  `occ music:scan --rescan-modified`, can now also remove files from the
  library if the modified file turns out to be within an excluded folder

- When moving folder within the music library, and that folder contains more
  than 15 audio files, those files are now marked as "dirty" to trigger the
  mechanism described above. Previously, up to 30 files were rescanned
  immediately and over 30 files were removed from the library, which was
  sub-optimal.

- This completes the fix for #1173
  which was started with the commit 9c43c9c. This also provides a partial
  fix for the old issue #706.
@paulijar
Copy link
Collaborator

paulijar commented Jan 2, 2025

This old issue is now mostly fixed in new Music v2.1.0. There, if another user "A" modifies a file shared with user "B", then "B" will be prompted to rescan the file the next time the Music app is loaded.

There is a small residual issue, though: If the user "A" doesn't modify the file but moves it to another sub-folder within the shared folder, then the rescan is not prompted. If the moved file doesn't have the metadata tags set, then the folder names will be used as album and/or artist names but the change in these is now not reflected in "B"'s library. However, I have decided to ignore this for time being.

@paulijar paulijar closed this as completed Jan 2, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants