Hello I upgraded today from Hub 7 to Hub 8 and now Iam getting this:
This instance is missing some recommended PHP modules. For improved performance and better compatibility it is highly recommended to install them: bz2.
Besides the error log message: 6975 errors in the logs since 7. Dezember 2023 but this is apparently a bug right now…
Info:
PHP 8.2.13 (cli) (built: Dec 12 2023 22:02:25) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.13, Copyright (c) Zend Technologies
with Zend OPcache v8.2.13, Copyright (c), by Zend Technologies
[PHP Modules]
apcu
bcmath
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gmp
hash
iconv
imagick
intl
json
ldap
libxml
mbstring
memcached
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_pgsql
pdo_sqlite
Phar
posix
random
readline
redis
Reflection
session
SimpleXML
sodium
SPL
sqlite3
standard
sysvsem
tokenizer
xml
xmlreader
xmlwriter
Zend OPcache
zip
zlib
[Zend Modules]
Zend OPcache
So I have tried the following:
apt-get install php8.2-bz2
Which gives me the following output:
Package php8.2-bz2 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package ‘php8.2-bz2’ has no installation candidate
I used docker exec container-name because I created nextcloud as a portainer stack and this command wouldnt work:
docker compose exec nextcloud-app-1 apt-get update && apt-get install -y libbz2-dev && docker-php-ext-install bz2
This is the Output:
Hit:1 Index of /debian bookworm InRelease
Get:2 Index of /debian bookworm-updates InRelease [52.1 kB]
Get:3 Index of /debian-security bookworm-security InRelease [48.0 kB]
Get:4 Index of /debian-security bookworm-security/main amd64 Packages [127 kB]
Fetched 227 kB in 0s (671 kB/s)
Reading package lists…
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following additional packages will be installed:
bzip2-doc
The following NEW packages will be installed:
bzip2-doc libbz2-dev
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 523 kB of archives.
After this operation, 706 kB of additional disk space will be used.
Get:1 Index of /debian-security buster/updates/main amd64 bzip2-doc all 1.0.6-9.2~deb10u2 [493 kB]
Get:2 Index of /debian-security buster/updates/main amd64 libbz2-dev amd64 1.0.6-9.2~deb10u2 [30.2 kB]
Fetched 523 kB in 0s (7671 kB/s)
Selecting previously unselected package bzip2-doc.
(Reading database … 42435 files and directories currently installed.)
Preparing to unpack …/bzip2-doc_1.0.6-9.2~deb10u2_all.deb …
Unpacking bzip2-doc (1.0.6-9.2~deb10u2) …
Selecting previously unselected package libbz2-dev:amd64.
Preparing to unpack …/libbz2-dev_1.0.6-9.2~deb10u2_amd64.deb …
Unpacking libbz2-dev:amd64 (1.0.6-9.2~deb10u2) …
Setting up bzip2-doc (1.0.6-9.2~deb10u2) …
Setting up libbz2-dev:amd64 (1.0.6-9.2~deb10u2) …
-bash: docker-php-ext-install: command not found
Had to split the output because of a link limit for new users.
I just ran:
docker exec nextcloud-app-1 docker-php-ext-install bz2
Output:
Configuring for:
PHP Api Version: 20220829
Zend Module Api No: 20220829
Zend Extension Api No: 420220829
checking for grep that handles long lines and -e… /usr/bin/grep
checking for egrep… /usr/bin/grep -E
checking for a sed that does not truncate output… /usr/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-gnu
checking host system type… x86_64-pc-linux-gnu
checking target system type… x86_64-pc-linux-gnu
checking for PHP prefix… /usr/local
checking for PHP includes… -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
checking for PHP extension directory… /usr/local/lib/php/extensions/no-debug-non-zts-20220829
checking for PHP installed headers prefix… /usr/local/include/php
checking if debug is enabled… no
checking if zts is enabled… no
checking for gawk… no
checking for nawk… nawk
checking if nawk is broken… no
checking for BZip2 support… yes, shared
checking for BZip2 in default path… not found
configure: error: Please reinstall the BZip2 distribution
As I don’t use compose to run my containers but Ansible, and as inside the container Im user ID 1001 I had to enter the container as root, to be granted to install packages:
Unfortunately it didn’t solved the warning message. I don’t get the point actually, if we install something inside the container, those changes won’t be kept as we restart the container, maybe we should bind some volume ? Or in the Dockerfile they schould ad some line like:
RUN apt-get update && apt-get install -y libbz2-dev && rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-install bz2
That beeing said, according to this comment it seems that this module is not actually used by anything, or at least not by any of the the standard Nextcloud apps. So unless you’re experiencing any issues or a specific app explicitly requires bz2, its probably save to ignore the warning, at least for the time beeing.
Please also note that the Nextcloud Docker Images are a community project maintained by volunteers, which means that you are not entitled to any kind of support or the implementation of your feature requests. So please be nice if any of you decides to join the discussion over there…
you might be right technically right regarding bz2 usage but setup warnings are core elements and don’t come from the docker project - this one is not to blame and only must adopt the new requirements - btw the “community” Docker project is hosted inside of Github organization “Nextcloud” and must be considered as “official”
I just summarised what I took away from the discussion in the linked GitHub issue, and maybe it will help some people sleep better, knowing that their Nextcloud won’t explode because of this warning…
If they had asked me, I would have said: Just install the darn package and ship it with the next release! But they didn’t ask…
Hit:1 http://deb.debian.org/debian bookworm InRelease
Hit:2 http://deb.debian.org/debian bookworm-updates InRelease
Hit:3 http://deb.debian.org/debian-security bookworm-security InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
bzip2-doc
The following NEW packages will be installed:
bzip2-doc libbz2-dev
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 545 kB of archives.
After this operation, 724 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian bookworm/main amd64 bzip2-doc all 1.0.8-5 [514 kB]
Get:2 http://deb.debian.org/debian bookworm/main amd64 libbz2-dev amd64 1.0.8-5+b1 [30.9 kB]
Fetched 545 kB in 0s (3487 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package bzip2-doc.
(Reading database ... 17427 files and directories currently installed.)
Preparing to unpack .../bzip2-doc_1.0.8-5_all.deb ...
Unpacking bzip2-doc (1.0.8-5) ...
Selecting previously unselected package libbz2-dev:amd64.
Preparing to unpack .../libbz2-dev_1.0.8-5+b1_amd64.deb ...
Unpacking libbz2-dev:amd64 (1.0.8-5+b1) ...
Setting up bzip2-doc (1.0.8-5) ...
Setting up libbz2-dev:amd64 (1.0.8-5+b1) ...
Configuring for:
PHP Api Version: 20220829
Zend Module Api No: 20220829
Zend Extension Api No: 420220829
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/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-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for PHP prefix... /usr/local
checking for PHP includes... -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20220829
checking for PHP installed headers prefix... /usr/local/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... no
checking for nawk... nawk
checking if nawk is broken... no
checking for BZip2 support... yes, shared
checking for BZip2 in default path... found in /usr
checking for BZ2_bzerror in -lbz2... yes
checking for a sed that does not truncate output... /usr/bin/sed
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/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
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... 1572864
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/bin/ld -m elf_x86_64) 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
/bin/bash /usr/src/php/ext/bz2/libtool --mode=compile cc -I. -I/usr/src/php/ext/bz2 -I/usr/src/php/ext/bz2/include -I/usr/src/php/ext/bz2/main -I/usr/src/php/ext/bz2 -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DZEND_COMPILE_DL_EXT=1 -c /usr/src/php/ext/bz2/bz2.c -o bz2.lo -MMD -MF bz2.dep -MT bz2.lo
mkdir .libs
cc -I. -I/usr/src/php/ext/bz2 -I/usr/src/php/ext/bz2/include -I/usr/src/php/ext/bz2/main -I/usr/src/php/ext/bz2 -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DZEND_COMPILE_DL_EXT=1 -c /usr/src/php/ext/bz2/bz2.c -MMD -MF bz2.dep -MT bz2.lo -fPIC -DPIC -o .libs/bz2.o
/bin/bash /usr/src/php/ext/bz2/libtool --mode=compile cc -I. -I/usr/src/php/ext/bz2 -I/usr/src/php/ext/bz2/include -I/usr/src/php/ext/bz2/main -I/usr/src/php/ext/bz2 -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DZEND_COMPILE_DL_EXT=1 -c /usr/src/php/ext/bz2/bz2_filter.c -o bz2_filter.lo -MMD -MF bz2_filter.dep -MT bz2_filter.lo
cc -I. -I/usr/src/php/ext/bz2 -I/usr/src/php/ext/bz2/include -I/usr/src/php/ext/bz2/main -I/usr/src/php/ext/bz2 -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DZEND_COMPILE_DL_EXT=1 -c /usr/src/php/ext/bz2/bz2_filter.c -MMD -MF bz2_filter.dep -MT bz2_filter.lo -fPIC -DPIC -o .libs/bz2_filter.o
/bin/bash /usr/src/php/ext/bz2/libtool --mode=link cc -shared -I/usr/src/php/ext/bz2/include -I/usr/src/php/ext/bz2/main -I/usr/src/php/ext/bz2 -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -Wl,-O1 -pie -o bz2.la -export-dynamic -avoid-version -prefer-pic -module -rpath /usr/src/php/ext/bz2/modules bz2.lo bz2_filter.lo -lbz2
cc -shared .libs/bz2.o .libs/bz2_filter.o -lbz2 -Wl,-O1 -Wl,-soname -Wl,bz2.so -o .libs/bz2.so
creating bz2.la
(cd .libs && rm -f bz2.la && ln -s ../bz2.la bz2.la)
/bin/bash /usr/src/php/ext/bz2/libtool --mode=install cp ./bz2.la /usr/src/php/ext/bz2/modules
cp ./.libs/bz2.so /usr/src/php/ext/bz2/modules/bz2.so
cp ./.libs/bz2.lai /usr/src/php/ext/bz2/modules/bz2.la
PATH="$PATH:/sbin" ldconfig -n /usr/src/php/ext/bz2/modules
----------------------------------------------------------------------
Libraries have been installed in:
/usr/src/php/ext/bz2/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
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
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'.
+ strip --strip-all modules/bz2.so
Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20220829/
find . -name \*.gcno -o -name \*.gcda | xargs rm -f
find . -name \*.lo -o -name \*.o -o -name \*.dep | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.so | xargs rm -f
find . -name .libs -a -type d|xargs rm -rf
rm -f libphp.la modules/* libs/*
rm -f ext/opcache/jit/zend_jit_x86.c
rm -f ext/opcache/jit/zend_jit_arm64.c
rm -f ext/opcache/minilua
I’m getting rid of NC on Truenas because of stuff like this. Workaround guides for problems are always for docker images or native installs, which are a bit different for Truenas installs and I dont have the expertise to figure out what the difference needs to be.
I will make an SMB share with my folders on it, and let NC use that as the datastore. That way NC just runs on Debian and that’s that. No docker, nothing hard to manage.
I tried to run the commands you specify but I got errors because bash executes just the first command in docker compose and the rest on the bash session itself.
*Being app the name of the docker service corresponding to Nextcloud instance.
Also, everytime you update the docker image you’ll need to install this module, so if you don’t want to make a Dockerfile to include it, you can make a script (that’s what I did) to manually run after an update.