icewind1991 / files_inotify

Adds support detecting changes in local external storages with occ files_external:notify
29 stars 3 forks source link

occ files_external:notify fails on local mounts #3

Closed ghost closed 5 years ago

ghost commented 7 years ago

Original issue: https://github.com/nextcloud/server/issues/6704.

Steps to reproduce

  1. Install inotify extension: pcre install inotify && phpenmod inotify
  2. Run occ files_external:notify -v [MOUNT_ID]
  3. Receive error: Mount of type "Local" does not support active update notifications
  4. Activating the Inotify watcher also fails: "This app cannot be enabled because it makes the server unstable"

Expected behaviour

Changes to local mount should be tracked and updated.

Actual behaviour

The notification monitor fails.

Server configuration

Operating system: Debian 9

Web server: Apache 2 behind Nginx proxy

Database: Postgresql 9.6.4

PHP version: 7.0.19

Nextcloud version: 12.0.3

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

Where did you install Nextcloud from: https://nextcloud.com/install

Signing status:

Signing status No errors have been found.

List of activated apps:

App list Enabled: - activity: 2.5.2 - admin_audit: 1.2.0 - announcementcenter: 3.1.0 - audioplayer: 2.1.0 - bookmarks: 0.10.1 - bruteforcesettings: 1.0.2 - calendar: 1.5.5 - checksum: 0.3.5 - comments: 1.2.0 - contacts: 1.5.3 - dashboard: 4.0.5 - dav: 1.3.0 - drawio: 0.8.8 - drop_account: 0.0.6 - external: 2.0.3 - federatedfilesharing: 1.2.0 - federation: 1.2.0 - files: 1.7.2 - files_accesscontrol: 1.2.5 - files_automatedtagging: 1.2.2 - files_downloadactivity: 1.1.1 - files_external: 1.3.0 - files_markdown: 2.0.1 - files_pdfviewer: 1.1.1 - files_reader: 1.0.4 - files_retention: 1.1.2 - files_sharing: 1.4.0 - files_texteditor: 2.4.1 - files_trashbin: 1.2.0 - files_versions: 1.5.0 - files_videoplayer: 1.1.0 - firstrunwizard: 2.1 - gallery: 17.0.0 - keeweb: 0.4.0 - logreader: 2.0.0 - lookup_server_connector: 1.0.0 - mail: 0.7.3 - metadata: 0.5.0 - news: 11.0.5 - nextcloud_announcements: 1.1 - notes: 2.3.1 - notifications: 2.0.0 - oauth2: 1.0.5 - passman: 2.1.4 - password_policy: 1.2.2 - previewgenerator: 1.0.7 - provisioning_api: 1.2.0 - serverinfo: 1.2.0 - sharebymail: 1.2.0 - socialsharing_email: 1.0.1 - socialsharing_googleplus: 1.0.1 - socialsharing_twitter: 1.0.1 - survey_client: 1.0.0 - systemtags: 1.2.0 - tasks: 0.9.5 - theming: 1.3.0 - twofactor_backupcodes: 1.1.1 - twofactor_totp: 1.3.1 - twofactor_u2f: 1.3.3 - updatenotification: 1.2.0 - weather: 1.5.0 - workflowengine: 1.2.0 Disabled: - encryption - files_inotify - user_external - user_ldap

Nextcloud configuration:

Config report '**REMOVED**', 'passwordsalt' => '**REMOVED**', 'secret' => '**REMOVED**', 'trusted_domains' => array ( 0 => 'ironcloud.monsterpit.net', 1 => 'localhost' ), 'trusted_proxies' => array ( 0 => '192.168.1.50', ), 'overwritehost' => 'ironcloud.monsterpit.net', 'overwriteprotocol' => 'https', 'overwritewebroot' => '/', 'overwritecondaddr' => '^192\\.168\\.1\\.50$', 'overwrite.cli.url' => 'https://ironcloud.monsterpit.net', 'htaccess.RewriteBase' => '/nextcloud/', 'dbtype' => 'pgsql', 'version' => '12.0.3.3', 'dbname' => 'nextcloud', 'dbhost' => 'localhost', 'dbtableprefix' => 'oc_', 'dbuser' => 'nextcloud', 'dbpassword' => '**REMOVED**', 'logtimezone' => 'America/Chicago', 'installed' => true, 'memcache.local' => '\\OC\\Memcache\\APCu', 'memcache.locking' => '\\OC\\Memcache\\Redis', 'redis' => array ( 'host' => '127.0.0.1', 'port' => 6379, 'dbindex' => 0, 'password' => '***REMOVED**', 'timeout' => 1.5, ), 'mail_domain' => 'ironclaw.monsterpit.net', 'mail_smtpmode' => 'smtp', 'mail_from_address' => 'notification', 'maintenance' => false, 'trashbin_retention_obligation' => 'auto, 60', 'enable_previews' => true, 'enabledPreviewProviders' => array ( 0 => 'OC\\Preview\\PNG', 1 => 'OC\\Preview\\JPEG', 2 => 'OC\\Preview\\GIF', 3 => 'OC\\Preview\\BMP', 4 => 'OC\\Preview\\XBitmap', 5 => 'OC\\Preview\\MP3', 6 => 'OC\\Preview\\TXT', 7 => 'OC\\Preview\\MarkDown', 8 => 'OC\\Preview\\SVG', 9 => 'OC\\Preview\\TIFF', 10 => 'OC\\Preview\\Movie', 11 => 'OC\\Preview\\PDF', 12 => 'OC\\Preview\\Postscript', ), 'mysql.utf8mb4' => true, 'filesystem_check_changes' => 0, 'mail_smtpsecure' => 'tls', 'mail_smtpauthtype' => 'LOGIN', 'mail_smtpauth' => 1, 'mail_smtphost' => '**REMOVED**', 'mail_smtpport' => '**REMOVED**', 'mail_smtpname' => '**REMOVED**', 'mail_smtppassword' => '**REMOVED**', 'theme' => '', 'loglevel' => 2, 'updater.release.channel' => 'stable', 'log_rotate_size' => 512000, );

Are you using external storage, if yes which one: Local, Google Drive

Are you using encryption: No

Are you using an external user-backend, if yes which one: No

Client configuration

Browser: Firefox 56.0

Operating system: Windows 10

Logs

Web server error log

Web server error log [Sat Sep 30 05:14:03.277801 2017] [:error] [pid 689] [client 192.168.1.50:60814] PHP Fatal error: Cannot declare interface OCP\\Files\\Notify\\INotifyHandler, because the name is already in use in /var/www/nextcloud/apps/files_inotify/appinfo/compat.php on line 23
ghost commented 6 years ago

I have the same issue on NC 13.0.5. Is this intended behavior ?

icewind1991 commented 6 years ago

Is there anything in the server logs when you try to enable the app?

ghost commented 6 years ago

No error. Just a info notice

Console command executed: files_external:notify -v 2
# occ files_external:notify -v 2
Mount of type "Local" does not support active update notifications
icewind1991 commented 6 years ago

That usually means that the inotify app isn't enabled, can you try re-enabling it, retrying the notify command, and if you get the same result, check the nextcloud log for anything related to the app. There are cases when an app gets automatically disabled due to errors during app loading.

ghost commented 6 years ago

You're correct. The inotify app complains about missing notify library. I'm running Gentoo Linux and have libnotify installed. Is this a PHP extension that I need maybe?

App "INotify file watcher" cannot be installed because the following dependencies are not fulfilled: The library inotify is not available.

bjo81 commented 6 years ago

@Gatak libnotify is for desktop notifications.

ghost commented 6 years ago

I made a typo. I have sys-fs/inotify-tools installed. There is no libinotify.

ghost commented 6 years ago

OK seems as Gentoo does not have the PECL-Inotify package. I manually installed it and it now works. :)