docker icon indicating copy to clipboard operation
docker copied to clipboard

After upgrading 28.0.0 bz2 module missing

Open jacme31 opened this issue 1 year ago • 51 comments

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.

jacme31 avatar Dec 13 '23 09:12 jacme31

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

waldner avatar Dec 13 '23 12:12 waldner

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.

wolrechris avatar Dec 13 '23 12:12 wolrechris

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

molhamalnasr avatar Dec 13 '23 15:12 molhamalnasr

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

tzerber avatar Dec 13 '23 18:12 tzerber

Old pull request regarding this issue: https://github.com/nextcloud/docker/pull/1351

dugite-code avatar Dec 14 '23 03:12 dugite-code

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.

linucksrox avatar Dec 14 '23 13:12 linucksrox

+1

mortee avatar Dec 14 '23 15:12 mortee

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

sparklyballs avatar Dec 15 '23 03:12 sparklyballs

#1414

That one apparently took a quick 1,5 years to resolve, fingers crossed for this new one 😃

mortee avatar Dec 15 '23 11:12 mortee

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 avatar Dec 15 '23 23:12 J0WI

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

linucksrox avatar Dec 16 '23 02:12 linucksrox

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

jjasoncool avatar Dec 17 '23 05:12 jjasoncool

how to fix this when I use Podman, not Docker. Thanks in advance/

cobran89 avatar Dec 17 '23 20:12 cobran89

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

joshtrichards avatar Dec 17 '23 20:12 joshtrichards

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.

heikkiheer avatar Dec 18 '23 10:12 heikkiheer

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?

Staubgeborener avatar Dec 28 '23 18:12 Staubgeborener

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?

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:

  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.

  2. 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 use restart: always, because it can have some not-so-good side effects.

  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.

EDIT: image

tzerber avatar Dec 28 '23 18:12 tzerber

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?).

Staubgeborener avatar Dec 29 '23 08:12 Staubgeborener

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.

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 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?).

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

tzerber avatar Dec 29 '23 08:12 tzerber

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?

witzker avatar Dec 30 '23 15:12 witzker

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.

tzerber avatar Dec 30 '23 15:12 tzerber

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.

XHyperDEVX avatar Dec 30 '23 15:12 XHyperDEVX

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

witzker avatar Dec 30 '23 15:12 witzker

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.

mortee avatar Dec 30 '23 15:12 mortee

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-bz2 does 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.

tzerber avatar Dec 30 '23 15:12 tzerber

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?

XHyperDEVX avatar Dec 30 '23 15:12 XHyperDEVX

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

witzker avatar Dec 30 '23 15:12 witzker

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.

tzerber avatar Dec 30 '23 15:12 tzerber

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

XHyperDEVX avatar Dec 30 '23 15:12 XHyperDEVX

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.

tzerber avatar Dec 30 '23 15:12 tzerber