Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After upgrading 28.0.0 bz2 module missing #2118

Closed
jacme31 opened this issue Dec 13, 2023 · 53 comments
Closed

After upgrading 28.0.0 bz2 module missing #2118

jacme31 opened this issue Dec 13, 2023 · 53 comments

Comments

@jacme31
Copy link

jacme31 commented Dec 13, 2023

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.

@waldner
Copy link

waldner commented Dec 13, 2023

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

@wolrechris
Copy link

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.

@molhamalnasr
Copy link

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

@tzerber
Copy link
Contributor

tzerber commented Dec 13, 2023

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

@dugite-code
Copy link

Old pull request regarding this issue: #1351

@linucksrox
Copy link

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.

@mortee

This comment was marked as spam.

@sparklyballs
Copy link

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

#1414

@mortee
Copy link

mortee commented Dec 15, 2023

#1414

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

@J0WI
Copy link
Contributor

J0WI commented Dec 15, 2023

The change was introduced in nextcloud/server#40889 (comment) but as stated there and in #1351 (comment) bz2 is nowhere used.

@linucksrox
Copy link

linucksrox commented Dec 16, 2023

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

@jjasoncool
Copy link

jjasoncool commented Dec 17, 2023

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

@cobran89
Copy link

cobran89 commented Dec 17, 2023

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

@joshtrichards
Copy link
Member

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

@heikkiheer
Copy link

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.

@Staubgeborener
Copy link

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?

@tzerber
Copy link
Contributor

tzerber commented Dec 28, 2023

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

@Staubgeborener
Copy link

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

@tzerber
Copy link
Contributor

tzerber commented Dec 29, 2023

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

@witzker

This comment was marked as duplicate.

@tzerber
Copy link
Contributor

tzerber commented Dec 30, 2023

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.

@Banditen01

This comment was marked as outdated.

@Ramalama2

This comment was marked as duplicate.

@joshtrichards
Copy link
Member

@Ramalama2 That's not what is going on here. There is an upstream issue in Server this one tied into. This one is blocked on clarification there. The bz2 is not a new requirement - but a new check was added for it in Server. No one has complained about the bz2 module not being present in the image until the check was added. :) This entire matter has zero impact on functionality.

@robertoschwald
Copy link

robertoschwald commented Jan 10, 2024

Thats not the point. The point is that a docker image is published which causes warning messages. All manual things done to fix the warning message are workarounds. For us this is a no-go as Nextcloud runs in K8S. We neither want to use our own image, nor want to manually change running pods.
All we ask is to simply install bz2 in the official Dockerfile until it is clarified in the Server issue nextcloud/server#42342 what to do in the future.

@tzerber
Copy link
Contributor

tzerber commented Jan 10, 2024

Thats not the point. The point is that a docker image is published which causes warning messages. All manual things done to fix the warning message are workarounds. For us this is a no-go as Nextcloud runs in K8S. We neither want to use our own image, nor want to manually change running pods. All we ask is to simply install bz2 in the official Dockerfile until it is clarified in the Server issue nextcloud/server#42342 what to do in the future.

I don't agree here. The whole idea of using docker is to use only the software that's needed for an application to function properly, nothing more nothing less. The presence of bz2 php extension in the container is not needed, no app or functionality is requiring it. You will get surprised how much software on this planet works fine despite throwing a lot more core warnings (and more obvios ones) than this single one we're discussing here.

The official docker image of Nextcloud also does not have that php extension.

@thomasmerz

This comment was marked as off-topic.

@tzerber
Copy link
Contributor

tzerber commented Jan 10, 2024

What about https://github.com/nextcloud/docker? This seems also to be "official", therefore I'm using it since some years and I find also this warning in https://mynextcloud.mydomain.tld/settings/admin/overview:

This is more of a contribution-powered project, and it's not related to Nextcloud GmbH, just a bunch of folks (nextcloud-employed or not) trying to offer micro-service variant of the official Nextcloud / Nextcloud-Docker-AIO variant. And the folks here are trying their best to keep it as 1:1 with the upstream as possible, and if something is wrong or causing issues coming from upstream to report/fix them there, not just turn this repository in a Nextcloud-workarounds one.

This instance is missing some recommended PHP modules. For improved performance and better compatibility it is highly recommended to install them: bz2

🤷🏼‍♂️

While the problem with the warning is settled with upstream Nextcloud (should or we shouldn't install bz2 module regardless of docker environment or not ) you can workaround this problem if you want to get rid of the warning by using a modified Docker file as shown here :
#2118 (comment)
Keep in mind that this warning is just a warning, nothing in Nextcloud depends on bz2. Since this is a open source project, you can even use that Dockerfile modification, edit it if/as needed, make a container and push it to repository like docker hub and then you can use it in your compose / k8s / other use-cases without the need of building it every time and so on.

EDIT
image

@Ramalama2

This comment was marked as off-topic.

@nfp0

This comment was marked as off-topic.

@linucksrox

This comment was marked as off-topic.

@rusty-snake

This comment was marked as off-topic.

@linucksrox

This comment was marked as off-topic.

@jiriks74
Copy link

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.

I'm currently maintaining an image that solves these issues that appear when using a brand new docker image. I've installed libmagickcore-dev to fix Module php-imagick in this instance has no SVG support (I also added some things to make NCDownloader work). I'll be now building a new image that will fix this issue.

I'm building it for amd64 and arm64 so if you don't like waiting for your image to build (on RPi4 for example) you can use my image.

@linucksrox
Copy link

linucksrox commented Jan 18, 2024

@jiriks74 Thanks for that. However, besides this docker image being "unofficial" whatever that means at this point, @J0WI marked #1351 as "wontfix" so we can't even fix the issue with a PR in this repo.

My point is that the Nextcloud team isn't allowing the community to fix the "most upstream" Docker image for lack of a better term, and using something even less "official" isn't the best long term solution.

It looks like they are pushing people toward the AIO instance, which does include bz2 by the way, but migrating to that is more complicated than using this image with a supported database, etc.

I just don't understand why this repo exists... if the Nextcloud team is going to be obnoxious about it and say it's not supported, but also not let the community update it as we see fit, then let's just delete it, right?

@J0WI
Copy link
Contributor

J0WI commented Jan 18, 2024

Please keep this issue on topic. This is still open to track the upstream issue at nextcloud/server#42342. #1351 is on hold until this is sorted out. The warning means nothing, bz2 is not used by any app. It's like a false-positive and completely fine to ignore.

Unfortunately there wasn't much attention yet on nextcloud/server#42342. Meanwhile I've proposed patches to revert this change introduced in nextcloud/server#40889:

Please stay patient while we're all waiting for a proper fix or clarification in Nextcloud itself. Whatever is decided there will be implemented here.

@felixauringer
Copy link

felixauringer commented Jan 22, 2024

The upstream issue nextcloud/server#42342 was just closed via nextcloud/server#42821 by removing bz2 from the recommended modules (thanks @J0WI). After a new release by nextcloud/server and a following release by nextcloud/docker, the warning should disappear 🎉

@joshtrichards
Copy link
Member

Quick update: The backport to v28 was merged in nextcloud/server#43013 a few moments ago. So it's officially in, but it'll be in v28.0.3. It was not able to be merged into the just released v28.0.2 because it was already in a code freeze at the time.

@abjoseph
Copy link

abjoseph commented Mar 2, 2024

@joshtrichards Do you know when the latest point releases (28.0.3, 27.1.7) will have their respective docker images published? Rough estimate or timeline?

@J0WI
Copy link
Contributor

J0WI commented Mar 2, 2024

@J0WI J0WI unpinned this issue Mar 4, 2024
@J0WI
Copy link
Contributor

J0WI commented Mar 4, 2024

Scheduled release: docker-library/official-images#16353

@J0WI J0WI closed this as completed Mar 4, 2024
@jacme31
Copy link
Author

jacme31 commented Mar 5, 2024

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

After upgrading to nextcloud 28.0.3 (nextcloud:latest on dockerhub), the error actually disappears.
Thanks to all contributors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.