docker
docker copied to clipboard
After upgrading 28.0.0 bz2 module missing
After upgrading nextcloud 28.0.0 (nextcloud:latest on dockerhub) I am getting the following error :
There are some warnings regarding your setup.
This instance is missing some recommended PHP modules. For improved performance and better compatibility it is highly recommended to install them: bz2
Otherwise, apart from a few apps that don't work , I haven't identified any major problems.
Furthermore, if you click on the documentation link (For more details see the [documentation ↗]) it takes you to a non-existing page: https://docs.nextcloud.com/server/28/go.php?to=admin-php-modules
Furthermore, if you click on the documentation link (
For more details see the [documentation ↗]) it takes you to a non-existing page: https://docs.nextcloud.com/server/28/go.php?to=admin-php-modules
True, but this is most likely an issue with Nextcloud in general / the fact that they have not yet updated the documentation and not the nextcloud docker container in particular.
yes i confirm it. after i updated my nextcloud app to version 28.0.0 i got the same warning about the bz2. and also the link is not working. this is the correct link to the recommended modules from Nextcloud documentation: https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html
I can confirm i have the same issue on a full fresh install of latest fpm docker image.
As a workaround i have created a local Dockerfile that uses NC as base image and just installs the bz2 php module, to keep it across downs/ups of compose, since it was fresh install and it needed a bit of fiddling with.
FROM nextcloud:fpm
RUN apt-get update && apt-get install -y libbz2-dev && rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-install bz2
Old pull request regarding this issue: https://github.com/nextcloud/docker/pull/1351
Just to hammer the point that was made in that other issue, I agree that Nextcloud can't include everything in the image. But now they "highly recommend" bz2 and there's a big warning about it on the Security & Setup Warnings page:
This instance is missing some recommended PHP modules. For improved performance and better compatibility it is highly recommended to install them: bz2. For more details see the documentation ↗.
That means on a brand new installation using Docker, users are expected to figure out how to make their own customized version of a Dockerfile just to add this dependency. It doesn't just work out of the box. Sorry, but that is dumb.
+1
Just to hammer the point that was made in that other issue, I agree that Nextcloud can't include everything in the image. But now they "highly recommend" bz2 and there's a big warning about it on the Security & Setup Warnings page:
This instance is missing some recommended PHP modules. For improved performance and better compatibility it is highly recommended to install them: bz2. For more details see the documentation ↗.
That means on a brand new installation using Docker, users are expected to figure out how to make their own customized version of a Dockerfile just to add this dependency. It doesn't just work out of the box. Sorry, but that is dumb.
certain sense of deja-vu here too....
https://github.com/nextcloud/docker/issues/1414
#1414
That one apparently took a quick 1,5 years to resolve, fingers crossed for this new one 😃
The change was introduced in https://github.com/nextcloud/server/pull/40889#issuecomment-1818000424 but as stated there and in https://github.com/nextcloud/docker/pull/1351#issuecomment-767116955 bz2 is nowhere used.
@J0WI in that case it's strange that we are seeing this new warning that wasn't there before. It sounds like the bug isn't the missing module, but the actual message that needs to be removed.
That would also mean this issue needs to go in the server repo, not Docker. Anyone else agree?
@J0WI I just fix it. If there is anything need help, please let me know. I'm glad to help this.
My PR will be an option. If the bz2 module is not a good choice, please close it directly.
how to fix this when I use Podman, not Docker. Thanks in advance/
My suggestion is that no one build a custom image merely to fix this warning that isn't impacting anything operationally. The check for bz2 was added in a bundle of other php module checks. There's a 50/50 chance bz2 gets removed from the docs and the check goes away.
Tracking upstream in nextcloud/server#42342
My suggestion is that no one build a custom image merely to fix this warning that isn't impacting anything operationally. The check for bz2 was added in a bundle of other php module checks. There's a 50/50 chance bz2 gets removed from the docs and the check goes away.
Tracking upstream in nextcloud/server#42342
I agree strongly.
I can confirm i have the same issue on a full fresh install of latest fpm docker image.
As a workaround i have created a local Dockerfile that uses NC as base image and just installs the bz2 php module, to keep it across downs/ups of compose, since it was fresh install and it needed a bit of fiddling with.
FROM nextcloud:fpm RUN apt-get update && apt-get install -y libbz2-dev && rm -rf /var/lib/apt/lists/* RUN docker-php-ext-install bz2
Could you create a gist and explain how you did that? I create a Dockerfile with this contest (just used FROM nextcloud:latest) and add
build:
context: .
dockerfile: Dockerfile
to my docker-compose.yml. But this doesn't install bz2. The web interface tells me, that bz2 is still missing.
So a minimal example of a docker-compose.yml and Dockerfile is appreciated. Do you run docker-compose up -d or docker-compose build?
I can confirm i have the same issue on a full fresh install of latest fpm docker image. As a workaround i have created a local Dockerfile that uses NC as base image and just installs the bz2 php module, to keep it across downs/ups of compose, since it was fresh install and it needed a bit of fiddling with.
FROM nextcloud:fpm RUN apt-get update && apt-get install -y libbz2-dev && rm -rf /var/lib/apt/lists/* RUN docker-php-ext-install bz2Could you create a gist and explain how you did that? I create a Dockerfile with this contest (just used
FROM nextcloud:latest) and addbuild: context: . dockerfile: Dockerfileto my
docker-compose.yml. But this doesn't installbz2. The web interface tells me, thatbz2is still missing.So a minimal example of a
docker-compose.ymlandDockerfileis appreciated. Do you rundocker-compose up -dordocker-compose build?
Hello,
Create an empty folder named app in the location of the compose file. Inside create the following dockerfile, and edit as needed, in my case i need ffmpeg for video files preview as well, but feel free to remove it.
FROM nextcloud:28.0.1-fpm
RUN apt-get update && apt-get install -y libbz2-dev ffmpeg && rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-install bz2
Then my compose file looks like this (keep in mind, it's not the default, but you can adjust it as needed)
app:
build: ./app
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "50m"
volumes:
- nextcloud:/var/www/html
- ./opcache-recommed.ini:/usr/local/etc/php/conf.d/opcache-recommended.ini
environment:
- POSTGRES_HOST=db
- REDIS_HOST=redis
- PHP_MEMORY_LIMIT=1024M
env_file:
- db.env
depends_on:
- db
- redis
cron:
build: ./app
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "50m"
volumes:
- nextcloud:/var/www/html
entrypoint: /cron.sh
depends_on:
- db
- redis
Then start the containers with the build and pull params (note, you can also do a separate compose build --pull, but i find this way more "safe")
docker compose up --build --pull always -d
Few notes:
-
If your instance is production one (or it's somewhat important to you) you should avoid using latest tags. Keep the version, and when new version is released - test it on separate instance then upgrade your main one.
-
In my example i use
restart: unless-stopped. People will argue about that, but when you have a container that is causing problems you should not userestart: always, because it can have some not-so-good side effects. -
Using the same approach i have a custom Nginx container built because the inconsistencies between Apache, Nginx , Chrome, Firefox and their recent versions when it comes to mjs files.
EDIT:
Thanks, this is working @tzerber.
Then start the containers with the build and pull params (note, you can also do a separate compose build --pull, but i find this way more "safe")
docker compose up --build --pull always -d
I get a unknown flag: --pull error, but docker-compose pull && docker-compose up --build -d is working for me.
1. If your instance is production one (or it's somewhat important to you) you should avoid using latest tags. Keep the version, and when new version is released - test it on separate instance then upgrade your main one.
I wrote myself some sort of update script so i can pass the version like ./update-nextcloud.sh 28 or ./update-nextcloud.sh latest. The parameter is passed as a variable to both docker-compose.yml and the Dockerfile.
3. Using the same approach i have a custom Nginx container built because the inconsistencies between Apache, Nginx , Chrome, Firefox and their recent versions when it comes to mjs files.
I also want to switch from apache to nginx, but it is difficult to realize this with the appropriate containers. I could use nextcloud:*-fpm release, but It's quite hard to link this to nginx because of lack of time (do you have any more information?).
Thanks, this is working @tzerber.
Then start the containers with the build and pull params (note, you can also do a separate compose build --pull, but i find this way more "safe")
docker compose up --build --pull always -dI get a
unknown flag: --pullerror, butdocker-compose pull && docker-compose up --build -dis working for me.
This is because you are using docker-compose instead of docker compose. Notice the difference in the command executed. You can visit docker documentation about why and what is like this. Same goes for my compose, your file is probably called docker-compose.yml where mine is just compose.yml and it has not version: X line in it.
1. If your instance is production one (or it's somewhat important to you) you should avoid using latest tags. Keep the version, and when new version is released - test it on separate instance then upgrade your main one.I wrote myself some sort of update script so i can pass the version like
./update-nextcloud.sh 28or./update-nextcloud.sh latest. The parameter is passed as a variable to bothdocker-compose.ymland theDockerfile.3. Using the same approach i have a custom Nginx container built because the inconsistencies between Apache, Nginx , Chrome, Firefox and their recent versions when it comes to mjs files.I also want to switch from apache to nginx, but it is difficult to realize this with the appropriate containers. I could use
nextcloud:*-fpmrelease, but It's quite hard to link this to nginx because of lack of time (do you have any more information?).
I recently updated some of the examples in the docker examples section you can use that as example. If you can't manage it, i can probably write you a proper example, but we're derailing this issue thread sooo much that i expect someone from maintainers will come yell at us :D
Same warning with NC 18.0.1 on Debian.
Operating System: Linux 5.10.0-25-amd64 x86_64
Extensions: Core, date, libxml, openssl, pcre, zlib, filter, hash, json, Reflection, SPL, session, standard, sodium, apache2handler, mysqlnd, PDO, xml, bcmath, calendar, ctype, curl, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, gmp, iconv, igbinary, imagick, imap, intl, ldap, exif, mysqli, pdo_mysql, Phar, posix, readline, redis, shmop, SimpleXML, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, xmlreader, xmlwriter, xsl, zip, Zend OPcache
How to solve this?
Same warning with NC 18.0.1 on Debian. Operating System: Linux 5.10.0-25-amd64 x86_64 How to solve this?
This is the docker section. In general, you need to install the php bz2 extension depending on your PHP version, probably php8.2-bz2 to get rid of the warning.
This is the docker section. In general, you need to install the php bz2 extension depending on your PHP version, probably php8.2-bz2 to get rid of the warning.
How do I do that? apt install php8.2-bz2 does not work, has no installation candidate. I am using the latest stable image.
Many THX for quick answer. Sorry, I'm new to all this server stuff. Could you Pls. be so kind and tell me the command for that? To get rid of it quickly! Many THX
For me, this Dockerfile does the trick:
FROM nextcloud:28
RUN apt-get -y update && \
apt-get -yqq --no-install-recommends install libbz2-dev && \
rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-install bz2
EDIT: the same solution has already been posted above here.
Many THX for quick answer. Sorry, I'm new to all this server stuff. Could you Pls. be so kind and tell me the command for that? To get rid of it quickly! Many THX
This is the docker section. In general, you need to install the php bz2 extension depending on your PHP version, probably php8.2-bz2 to get rid of the warning.
How do I do that?
apt install php8.2-bz2does not work, has no installation candidate. I am using the latest stable image.
Both of you : again, this is the docker section, not the debian one. I can probably help both, but not here, because this issue is not a discussion group and it's not the proper way of getting things done. Open a proper ticket in this section, https://github.com/nextcloud/server/issues and provide a proper information on your setup including the version of php that you're using.
I and I think everyone else here would prefer this package to simply be added to the image anyway, why not just do that? where is the problem?
Both of you : again, this is the docker section, not the debian one Sorry, I'm new & THX for your advice, Pls. delete my wrong posts to keep this clean
I and I think everyone else here would prefer this package to simply be added to the image anyway, why not just do that? where is the problem?
Because it's not required/not used anywhere. It's the check that needs updating. Unless there's an app that need bz2 you generally don't need it. The downside is that you get a warning that it's missing, but no actual functionality depends on it.
Okay, that makes sense! and what is the problem with removing the warning when it is not needed? i mean the problem has existed for a long time
Okay, that makes sense! and what is the problem with removing the warning when it is not needed? i mean the problem has existed for a long time
You can ask that in the issues section of Nextcloud server itself. This is the docker section, and people here can't really change it. For future reference : https://github.com/nextcloud/server/issues/42342 .
EDIT: @XHyperDEVX @witzker short googling reveals this. https://www.itsolutionstuff.com/post/ubuntu-php-bz2-extension-install-commands-exampleexample.html . Please mind the php version you're installing or you !WILL! break things.