icewind1991 / files_inotify

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

[error] Mount of type "Local" does not support active update notifications #33

Closed janusn closed 8 months ago

janusn commented 9 months ago

I have installed inotify inside a container with the image of linusserver/nextcloud.

It ran fine until recently. occ files_external:notify was loaded repeatly.

My set up: The images of Linuxserver.io allows customization of additional software into the container by mounting a specify directory into the container. I put a file, install-INotify, into the directory custom-cont-init.dto install INotify. The content is:

#!/bin/bash

/sbin/apk update
/sbin/apk add --no-cache g++ make php82-dev php82-pear
/usr/bin/pear82 config-set php_ini '/etc/php82/php.ini'
/usr/bin/pecl82 channel-update pecl.php.net
/usr/bin/pecl82 install INotify
/bin/echo 'extension="inotify.so"' > '/etc/php82/conf.d/00_inotify.ini'

INSTALLED=`/usr/bin/occ app:list | grep files_inotify`
/usr/bin/[ -z "$INSTALLED" ] && /usr/bin/occ app:install files_inotify

The logs of the container:

$ docker logs -f nextcloud
[custom-init] Service files found in /custom-services.d
[custom-init] start-files_inotify: service detected, copying...
[custom-init] start-files_inotify: copied
[mod-init] Attempting to run Docker Modification Logic
[mod-init] Adding linuxserver/mods:universal-cron to container
[mod-init] Downloading linuxserver/mods:universal-cron from lscr.io
[mod-init] Installing linuxserver/mods:universal-cron
[mod-init] linuxserver/mods:universal-cron applied to container
[migrations] started
[migrations] 01-nginx-site-confs-default: skipped
[migrations] 02-default-location: skipped
[migrations] done
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗ 
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝ 

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1016
User GID:    1016
───────────────────────────────────────

using keys found in /config/keys
Initializing nextcloud 28.0.1.1 (this can take a while) ...
Setting permissions
Initializing finished
**** The following active confs have different version dates than the samples that are shipped. ****
**** This may be due to user customization or an update to the samples. ****
**** You should compare the following files to the samples in the same folder and update them. ****
**** Use the link at the top of the file to view the changelog. ****
┌────────────┬────────────┬────────────────────────────────────────────────────────────────────────┐
│  old date  │  new date  │ path                                                                   │
├────────────┼────────────┼────────────────────────────────────────────────────────────────────────┤
│ 2022-08-16 │ 2023-04-13 │ /config/nginx/nginx.conf                                               │
│ 2022-08-20 │ 2023-08-13 │ /config/nginx/ssl.conf                                                 │
└────────────┴────────────┴────────────────────────────────────────────────────────────────────────┘
**** The following site-confs have extensions other than .conf ****
**** This may be due to user customization. ****
**** You should review the files and rename them to use the .conf extension or remove them. ****
**** nginx.conf will only include site-confs with the .conf extension. ****
/config/nginx/site-confs/default.conf.2023-05-13
/config/nginx/site-confs/default.conf.2024-01-10
/config/nginx/site-confs/default.conf.ori.2024-01-10
[custom-init] Files found, executing
[custom-init] install-INotify: executing...
fetch http://dl-cdn.alpinelinux.org/alpine/v3.18/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.18/community/x86_64/APKINDEX.tar.gz
v3.18.5-109-ge7c511cfd7a [http://dl-cdn.alpinelinux.org/alpine/v3.18/main]
v3.18.5-106-g9132bc6d2aa [http://dl-cdn.alpinelinux.org/alpine/v3.18/community]
OK: 20074 distinct packages available
fetch http://dl-cdn.alpinelinux.org/alpine/v3.18/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.18/community/x86_64/APKINDEX.tar.gz
(1/29) Installing libstdc++-dev (12.2.1_git20220924-r10)
(2/29) Installing binutils (2.40-r7)
(3/29) Installing libatomic (12.2.1_git20220924-r10)
(4/29) Installing isl26 (0.26-r1)
(5/29) Installing mpfr4 (4.2.0_p12-r0)
(6/29) Installing mpc1 (1.3.1-r1)
(7/29) Installing gcc (12.2.1_git20220924-r10)
(8/29) Installing musl-dev (1.2.4-r2)
(9/29) Installing libc-dev (0.7.2-r5)
(10/29) Installing g++ (12.2.1_git20220924-r10)
(11/29) Installing make (4.4.1-r1)
(12/29) Installing m4 (1.4.19-r3)
(13/29) Installing perl (5.36.2-r0)
(14/29) Installing perl-error (0.17029-r1)
(15/29) Installing perl-git (2.40.1-r0)
(16/29) Installing git-perl (2.40.1-r0)
(17/29) Installing autoconf (2.71-r2)
(18/29) Installing bsd-compat-headers (0.7.2-r5)
(19/29) Installing libmenuw (6.4_p20230506-r0)
(20/29) Installing libncurses++ (6.4_p20230506-r0)
(21/29) Installing ncurses-dev (6.4_p20230506-r0)
(22/29) Installing libedit-dev (20221030.3.1-r1)
(23/29) Installing zlib-dev (1.2.13-r1)
(24/29) Installing libpcre2-16 (10.42-r1)
(25/29) Installing libpcre2-32 (10.42-r1)
(26/29) Installing pcre2-dev (10.42-r1)
(27/29) Installing re2c (3.0-r1)
(28/29) Installing php82-dev (8.2.13-r0)
(29/29) Installing php82-pear (8.2.13-r0)
Executing busybox-1.36.1-r5.trigger
OK: 587 MiB in 287 packages
config-set succeeded
Updating channel "pecl.php.net"
Update of Channel "pecl.php.net" succeeded
downloading inotify-3.0.0.tgz ...
Starting to download inotify-3.0.0.tgz (8,455 bytes)
.....done: 8,455 bytes
3 source files, building
running: phpize82
Configuring for:
PHP Api Version:         20220829
Zend Module Api No:      20220829
Zend Extension Api No:   420220829
config.m4:9: warning: The macro `AC_TRY_RUN' is obsolete.
config.m4:9: You should run autoupdate.
./lib/autoconf/general.m4:2997: AC_TRY_RUN is expanded from...
config.m4:9: the top level
building in /tmp/pear/temp/pear-build-defaultuserOHEdPO/inotify-3.0.0
running: /tmp/pear/temp/inotify/configure --with-php-config=/usr/bin/php-config82
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether cc accepts -g... yes
checking for cc option to enable C11 features... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking for system library directory... lib
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-musl
checking host system type... x86_64-pc-linux-musl
checking target system type... x86_64-pc-linux-musl
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php82 -I/usr/include/php82/main -I/usr/include/php82/TSRM -I/usr/include/php82/Zend -I/usr/include/php82/ext -I/usr/include/php82/ext/date/lib
checking for PHP extension directory... /usr/lib/php82/modules
checking for PHP installed headers prefix... /usr/include/php82
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking whether to enable inotify support... yes, shared
checking for a sed that does not truncate output... /bin/sed
checking for ld used by cc... /usr/x86_64-alpine-linux-musl/bin/ld
checking if the linker (/usr/x86_64-alpine-linux-musl/bin/ld) is GNU ld... yes
checking for /usr/x86_64-alpine-linux-musl/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
/tmp/pear/temp/inotify/configure: line 5377: /usr/bin/file: not found
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 98304
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/x86_64-alpine-linux-musl/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
configure: patching config.h.in
configure: creating ./config.status
config.status: creating config.h
running: make
/bin/sh /tmp/pear/temp/pear-build-defaultuserOHEdPO/inotify-3.0.0/libtool --mode=compile cc -I. -I/tmp/pear/temp/inotify -I/tmp/pear/temp/pear-build-defaultuserOHEdPO/inotify-3.0.0/include -I/tmp/pear/temp/pear-build-defaultuserOHEdPO/inotify-3.0.0/main -I/tmp/pear/temp/inotify -I/usr/include/php82 -I/usr/include/php82/main -I/usr/include/php82/TSRM -I/usr/include/php82/Zend -I/usr/include/php82/ext -I/usr/include/php82/ext/date/lib  -DHAVE_CONFIG_H  -g -O2 -D_GNU_SOURCE    -DZEND_COMPILE_DL_EXT=1 -c /tmp/pear/temp/inotify/inotify.c -o inotify.lo  -MMD -MF inotify.dep -MT inotify.lo
mkdir .libs
 cc -I. -I/tmp/pear/temp/inotify -I/tmp/pear/temp/pear-build-defaultuserOHEdPO/inotify-3.0.0/include -I/tmp/pear/temp/pear-build-defaultuserOHEdPO/inotify-3.0.0/main -I/tmp/pear/temp/inotify -I/usr/include/php82 -I/usr/include/php82/main -I/usr/include/php82/TSRM -I/usr/include/php82/Zend -I/usr/include/php82/ext -I/usr/include/php82/ext/date/lib -DHAVE_CONFIG_H -g -O2 -D_GNU_SOURCE -DZEND_COMPILE_DL_EXT=1 -c /tmp/pear/temp/inotify/inotify.c -MMD -MF inotify.dep -MT inotify.lo  -fPIC -DPIC -o .libs/inotify.o
/bin/sh /tmp/pear/temp/pear-build-defaultuserOHEdPO/inotify-3.0.0/libtool --mode=link cc -shared -I/tmp/pear/temp/pear-build-defaultuserOHEdPO/inotify-3.0.0/include -I/tmp/pear/temp/pear-build-defaultuserOHEdPO/inotify-3.0.0/main -I/tmp/pear/temp/inotify -I/usr/include/php82 -I/usr/include/php82/main -I/usr/include/php82/TSRM -I/usr/include/php82/Zend -I/usr/include/php82/ext -I/usr/include/php82/ext/date/lib  -DHAVE_CONFIG_H  -g -O2 -D_GNU_SOURCE    -o inotify.la -export-dynamic -avoid-version -prefer-pic -module -rpath /tmp/pear/temp/pear-build-defaultuserOHEdPO/inotify-3.0.0/modules  inotify.lo
cc -shared  .libs/inotify.o   -Wl,-soname -Wl,inotify.so -o .libs/inotify.so
creating inotify.la
(cd .libs && rm -f inotify.la && ln -s ../inotify.la inotify.la)
/bin/sh /tmp/pear/temp/pear-build-defaultuserOHEdPO/inotify-3.0.0/libtool --mode=install cp ./inotify.la /tmp/pear/temp/pear-build-defaultuserOHEdPO/inotify-3.0.0/modules
cp ./.libs/inotify.so /tmp/pear/temp/pear-build-defaultuserOHEdPO/inotify-3.0.0/modules/inotify.so
cp ./.libs/inotify.lai /tmp/pear/temp/pear-build-defaultuserOHEdPO/inotify-3.0.0/modules/inotify.la
PATH="$PATH:/sbin" ldconfig -n /tmp/pear/temp/pear-build-defaultuserOHEdPO/inotify-3.0.0/modules
----------------------------------------------------------------------
Libraries have been installed in:
   /tmp/pear/temp/pear-build-defaultuserOHEdPO/inotify-3.0.0/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.

running: make INSTALL_ROOT="/tmp/pear/temp/pear-build-defaultuserOHEdPO/install-inotify-3.0.0" install
Installing shared extensions:     /tmp/pear/temp/pear-build-defaultuserOHEdPO/install-inotify-3.0.0/usr/lib/php82/modules/
running: find "/tmp/pear/temp/pear-build-defaultuserOHEdPO/install-inotify-3.0.0" | xargs ls -dils
23626301  0 drwxr-xr-x 1 root root     6 Jan 12 22:02 /tmp/pear/temp/pear-build-defaultuserOHEdPO/install-inotify-3.0.0
23626541  0 drwxr-xr-x 1 root root     6 Jan 12 22:02 /tmp/pear/temp/pear-build-defaultuserOHEdPO/install-inotify-3.0.0/usr
23626542  0 drwxr-xr-x 1 root root    10 Jan 12 22:02 /tmp/pear/temp/pear-build-defaultuserOHEdPO/install-inotify-3.0.0/usr/lib
23626543  0 drwxr-xr-x 1 root root    14 Jan 12 22:02 /tmp/pear/temp/pear-build-defaultuserOHEdPO/install-inotify-3.0.0/usr/lib/php82
23626544  0 drwxr-xr-x 1 root root    20 Jan 12 22:02 /tmp/pear/temp/pear-build-defaultuserOHEdPO/install-inotify-3.0.0/usr/lib/php82/modules
23626545 52 -rwxr-xr-x 1 root root 52440 Jan 12 22:02 /tmp/pear/temp/pear-build-defaultuserOHEdPO/install-inotify-3.0.0/usr/lib/php82/modules/inotify.so

Build process completed successfully
Installing '/usr/lib/php82/modules/inotify.so'
install ok: channel://pecl.php.net/inotify-3.0.0
Extension inotify enabled in php.ini
PHP Warning:  Module "inotify" is already loaded in Unknown on line 0
[custom-init] install-INotify: exited 1
[ls.io-init] done.
[12-Jan-2024 22:02:26] NOTICE: PHP message: PHP Warning:  Module "inotify" is already loaded in Unknown on line 0
PHP Warning:  Module "inotify" is already loaded in Unknown on line 0

And I put the a file, start-files_inotify, into the directory custom-services.d to launch files_inotify. The content of the file is as the following:

#!/bin/bash

D=`date +%Y.%m.%d`
{
T=`date +%Y.%m.%d-%H.%M.%S`
/bin/echo $T
/bin/echo "**** custom-services.d ****"
/bin/echo "Starting notify..."
occ files_external:notify -vvv 15 2>&1

# the following lin is not expected to be seen on log.
/bin/echo "completed notify."

} >> "/mnt/logs/notify/notify-${D}.log"

The content of the notify-yyyy.mm.dd-HH.MM.SS.log is:

2024.01.12-22.02.26
**** custom-services.d ****
Starting notify...
PHP Warning:  Module "inotify" is already loaded in Unknown on line 0
Mount of type "Local" does not support active update notifications
completed notify.
2024.01.12-22.02.27
**** custom-services.d ****
Starting notify...
PHP Warning:  Module "inotify" is already loaded in Unknown on line 0
Mount of type "Local" does not support active update notifications
completed notify.
2024.01.12-22.02.29
**** custom-services.d ****
Starting notify...
PHP Warning:  Module "inotify" is already loaded in Unknown on line 0
Mount of type "Local" does not support active update notifications
completed notify.
2024.01.12-22.02.30
**** custom-services.d ****
Starting notify...
PHP Warning:  Module "inotify" is already loaded in Unknown on line 0
Mount of type "Local" does not support active update notifications
completed notify.
2024.01.12-22.02.31
**** custom-services.d ****
Starting notify...
PHP Warning:  Module "inotify" is already loaded in Unknown on line 0
Mount of type "Local" does not support active update notifications
completed notify.
2024.01.12-22.02.33
**** custom-services.d ****
Starting notify...
PHP Warning:  Module "inotify" is already loaded in Unknown on line 0
Mount of type "Local" does not support active update notifications
completed notify.

on and on...

What should I do to fix it? Thanks in advance.

bedouin67 commented 9 months ago

Same situation under Arch Linux after Nextcloud 28.0.1 upgrade. PHP 8.1.27:

$ occ files_external:notify -v 6 Mount of type "Local" does not support active update notifications

Mount ID 6 is of storage type "Local":

$ occ files_external:list +----------+----------------+---------+---------------------+-------------------------------------------+ | Mount ID | Mount Point | Storage | Authentication Type | Configuration | +----------+----------------+---------+---------------------+-------------------------------------------+ | 6 | /Local | Local | None | datadir: "******************************" | +----------+----------------+---------+---------------------+-------------------------------------------+

ragchuck commented 9 months ago

Same for me:

bedouin67 commented 9 months ago

Has this project been abandoned? No more inotify for Nextcloud?

gali0 commented 8 months ago

Same problem for me:

bedouin67 commented 8 months ago

Thank you, this fixed the issue.