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

(38)Function not implemented: AH00141: Could not initialize random number generator #1574

Closed
WarSonic69 opened this issue Aug 31, 2021 · 33 comments

Comments

@WarSonic69
Copy link

WarSonic69 commented Aug 31, 2021

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Steps to reproduce

Hi everyone,

I searched and found this issue with the exact same issue but no real answer : nextcloud/server#28666 As the webserver is handled in the docker container as far as I know, the issue is with the container.

  1. 22.1.0.1 docker version of Nextcloud server perfectly working
  2. Automatic update to 22.1.1.2 this morning via Watchtower
  3. Server not started and this issue looping in the container logs :
    [Tue Aug 31 20:16:38.273961 2021] [:crit] [pid 1] (38)Function not implemented: AH00141: Could not initialize random number generator

Server configuration

Operating system: Synology DS415+ with DSM 6.2.4

Web server: Handled in the docker image (Apache I guess given the error)

Database: MariaDB

Where did you install Nextcloud from: This repository

Are you using external storage, if yes which one: No

Are you using encryption: No

Are you using an external user-backend, if yes which one: No

Nothing interesting in the Nextcloud logs apart from :
{"reqId":"Z2wxZZKE4MZXbp9uotkC","level":1,"time":"2021-08-31T02:03:35+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\OC\Updater::startCheckCodeIntegrity: Starting code integrity check...","userAgent":"--","version":"22.1.0.1"}
{"reqId":"Z2wxZZKE4MZXbp9uotkC","level":1,"time":"2021-08-31T02:04:04+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\OC\Updater::finishedCheckCodeIntegrity: Finished code integrity check","userAgent":"--","version":"22.1.0.1"}
{"reqId":"Z2wxZZKE4MZXbp9uotkC","level":1,"time":"2021-08-31T02:04:04+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\OC\Updater::updateEnd: Update successful","userAgent":"--","version":"22.1.1.2"}
{"reqId":"Z2wxZZKE4MZXbp9uotkC","level":1,"time":"2021-08-31T02:04:04+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\OC\Updater::maintenanceDisabled: Turned off maintenance mode","userAgent":"--","version":"22.1.1.2"}
{"reqId":"Z2wxZZKE4MZXbp9uotkC","level":1,"time":"2021-08-31T02:04:04+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\OC\Updater::resetLogLevel: Reset log level to Warning(2)","userAgent":"--","version":"22.1.1.2"}

Thanks in advance for your help !

@szaimen szaimen transferred this issue from nextcloud/server Aug 31, 2021
@kesselb
Copy link
Contributor

kesselb commented Sep 1, 2021

Additional context:
docker-library/wordpress#630
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=978045

Your NAS is using a linux kernel < 3.16 and is missing some dependencies required by apache2 now.

@kesselb kesselb changed the title 22.1.1.2 (38)Function not implemented: AH00141: Could not initialize random number generator (38)Function not implemented: AH00141: Could not initialize random number generator Sep 1, 2021
@kesselb kesselb pinned this issue Sep 1, 2021
@WarSonic69
Copy link
Author

Hi @kesselb

Thanks for your quick answer. I looked a little bit around and did not find any easy way to update the Synology kernel. Is it possible to install only the dependencies missing ? If yes, is there a list ? If not, is it possible to downgrade the version of my Nextcloud installation ?

Thanks in advance !

@violence88
Copy link

same problem :( - any dummy advice to install the missing dependencies?

Thanks in advance !

@bes1967
Copy link

bes1967 commented Sep 2, 2021

I had a similar problem. The only difference was that my docker image ran in a virtual machine (VirtualBox) with Debian Jessie as a guest system. I had to update to Debian Stretch (all my attempts to update the Linux kernel for Jessey ended in vain), after which the error disappeared. It seems to me that the problem arose after the docker image was based on php: 7.4-apache-bullseye (and then php: 8.0-apache-bullseye) instead of php: 7.4-apache-buster. For NAS, things will be much worse, since updating the Linux version will not be easy at all.

@WarSonic69
Copy link
Author

Yes, I tried looking for different ways to update the kernel on my NAS but it seems far too risky. My only hope would be the last version of the OS (DSM7.0) but I am not sure of the kernel version on it (found several answers all contradictory) and I don't want to rush the update for that...

@violence88
Copy link

My NAS is on DSM7.0 --> same Error!

@WarSonic69
Copy link
Author

Thanks for the information ! (Even if it's not what I wanted to hear) Sooo, no possibility for us apparently ?

@lincolnep
Copy link

lincolnep commented Sep 3, 2021

Same issue on DSM7.0

@comdr-chocchip
Copy link

same issue but on DSM 6.2.4

@mosesdd
Copy link

mosesdd commented Sep 6, 2021

I can reproduce this issue on a Synology RS3617xs with DSM 6.2.4-25556. On a DS1618+ with DSM 7.0-41890 it is working fine.

My workaround was to edit the Dockerfile to use php:8.0-apache-buster as base image instead of php:8.0-apache-bullseye and build it on my own. Otherwise a switch to the fpm image could a be a workaround for this issue.

BTW, same issue for the bitnami apache image:
https://github.com/bitnami/bitnami-docker-apache/issues/106

@WarSonic69
Copy link
Author

Hi @mosesdd

Thanks you for the hint about the fact to build your own image. I just tried and can confirm it went back up immediately.

For reference for those that do not know exactly how to build your own image, I did the following (all in SSH) :
Git clone in a specific directory on the NAS
Change the docker/22/apache/Dockerfile to use the buster image
Go to the docker/22/apache folder
Docker build with this command : "sudo docker build -t nextcloudtest . -f Dockerfile" (the -t part is to have a understandable name, the . -f part is to avoid an issue with the COPY part)
Then change the base image of my container from nextcloud:latest to nextcloudtest:latest

So far, everything seems to work fine again but I am no longer using the official Nextcloud image for now, I will be forced to build it manually everytime.

Best regards

@violence88
Copy link

anyone know if there are any pre built images to download with php:8.0-apache-buster as base image by default?
That would be nice to have also for future updates.

@indiana11011100
Copy link

Hi, anyone an idea how an already updated DB/data can be rolled back from 21.1.1.2 to 21.1.0.1 ?
I still have a working DS412+ with DSM 6.2.4. Any higher DSM like 7 will never be released for this. Only security updates will be done. I gues these will not contain a new kernel.

@partymild
Copy link

Same issue with Docker running on a Synology DS1515+ with DSM 6.2.4.
Since Nextcloud downgrades are not supported and building my own image seems quite the effort please release an image with php:8.0-apache-buster as base image.

@philippepiatkiewitz
Copy link

philippepiatkiewitz commented Sep 20, 2021

@WarSonic69
Can you elaborate on how to build a custom docker image?

Git clone in a specific directory on the NAS

Which git repository are you cloning?

Change the docker/22/apache/Dockerfile to use the buster image

What exactly do you change.
etc.

Greatly appreciated.

@WarSonic69
Copy link
Author

Hi @philippepiatkiewitz

I Gitcloned the Nextcloud/docker repo : https://github.com/nextcloud/docker.git

I changed this line in the Dockerfile :
FROM php:8.0-apache-bullseye
and I put :
FROM php:8.0-apache-buster

Hope this is enough information, don't hesitate if you need more.

@philippepiatkiewitz
Copy link

@WarSonic69 Thanks! I could make a new docker image and got nextcloud up and running.

@WarSonic69
Copy link
Author

You're welcome ! This is not ideal but well... It works.

@J0WI J0WI added the question label Sep 20, 2021
@maschbauerkl
Copy link

Hey @WarSonic69 another two questions from my side:
You mention a "specific" folder where you cloned the repository. Which one is it? I'm trying to find this information, but I'm not sure where to clone this.
Another thing: I tried to build the build the docker container inside the directory like "volume1/docker/docker/22/apache", but wasn't successful, is that also a sign that I need to have a specific folder? Err. Msg. looks like that:


/volume1/docker/docker/22/apache$ sudo docker build -t nextcloudtest
"docker build" requires exactly 1 argument.
See 'docker build --help'.

Usage:  docker build [OPTIONS] PATH | URL | -

Build an image from a Dockerfile

@WarSonic69
Copy link
Author

Hi @maschbauerkl

The specific folder I am mentioning is the folder in which you want to store the Git data. Personally, it is something like "volume1/docker/NextcloudGitClone" just to remember it. It does not have a huge importance as you can delete it once the image is built.

Regarding your error, I remember having it when I tried building the image at the beginning. I can only advice you to use the exact same build command as I did (even the dot is important). I don't remember the exact cause but it is linked to the command.

@partymild
Copy link

Since the root issue is stille there, any chance of a permanent fix? like a prebuilt dockerfile with the correct base image?

@milux
Copy link

milux commented Nov 9, 2021

Just wanted to mention that changing the Dockerfile directly is a valid, yet not an ideal solution.
Instead, I would advise to do that change in Dockerfile-debian.template and run ./update.
If you are upgrading across multiple major versions, that has the benefit of "fixing" all the Dockerfiles at once.

@leiterschleife
Copy link

+1 currently I am on nextcloud v20.0.4 using the docker apache image. I am trying to upgrade the container to 20.0.14 in order to upgrade to the current major version after that. However, due to this error the container won't start an I have no upgrade path available. Is this error fixed in v21? Can the upgrade to 20.0.14 be omitted?

I am running on synology DSM 7.0.1, so there is no kernel update available.

@m4rkv5
Copy link

m4rkv5 commented Feb 10, 2022

@leiterschleife Synology needs to fix this. In the meantime, as mentioned further above, you can fix it yourself. Using outdated packages would not be the preferred solution for everyone.

@leiterschleife
Copy link

@m4rkv5 Has anyone given Synology a hint about this? What are the versions known to be working again? Would I need to do the manual fix from now on for any future version of nextcloud? If so, this cannot be expected from every user hosting a nextcloud docker image on a diskstation as I expect there are plenty of them.

@m4rkv5
Copy link

m4rkv5 commented Feb 11, 2022

@leiterschleife Yes you need to patch every version in your upgrade path. You only need to use the commands from above. Have a backup. My database was already V23 but I needed a specific V22 first.

@gingerbeardman
Copy link

Synology don't issue kernel updates. It's sort of fixed hardware.
Time marches on never-ending and software dependencies are upgraded, and here we are with broken things.

I'd love to know the reason for -bullseye over -buster, even if it is in vain.

It's good to see RSS-Bridge and other repos actively going back to -buster

@123lujiaqiang
Copy link

123lujiaqiang commented Oct 27, 2022

I had the same problem with centos7,The container automatically exits after starting. Check logs. Error:Function not implemented: AH00141: Could not initialize random number generator

my solution was to upgrade the kernel

  1. Check my server kernel: Linux 3.10.0-123.el7.x86_64

  2. After kernel upgrade: Linux 6.0.5-1.el7.elrepo.x86_64

  3. Problem solved

Forgive my non-standard English expression;

@hassansf
Copy link

hassansf commented Apr 1, 2023

I can reproduce this issue on a Synology RS3617xs with DSM 6.2.4-25556. On a DS1618+ with DSM 7.0-41890 it is working fine.

My workaround was to edit the Dockerfile to use php:8.0-apache-buster as base image instead of php:8.0-apache-bullseye and build it on my own. Otherwise a switch to the fpm image could a be a workaround for this issue.

BTW, same issue for the bitnami apache image: https://github.com/bitnami/bitnami-docker-apache/issues/106

Can you please elaborate the procedure of changing the docker file on a synology nas?

@milux
Copy link

milux commented Apr 20, 2023

Can you please elaborate the procedure of changing the docker file on a synology nas?

Step 1: Change line 1 of Dockerfile-debian.template, here is the git patch:

diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template
index d3fb81e..9b5ea71 100644
--- a/Dockerfile-debian.template
+++ b/Dockerfile-debian.template
@@ -1,4 +1,4 @@
-FROM php:%%PHP_VERSION%%-%%VARIANT%%-bullseye
+FROM php:%%PHP_VERSION%%-%%VARIANT%%-buster
 
 # entrypoint.sh and cron.sh dependencies
 RUN set -ex; \

Step 2: Run update.sh.

Step 3: Build desired Docker images.

Step 4: Profit? :D

@PaulCornelissen
Copy link

PaulCornelissen commented Aug 1, 2023

I just succesfully worked around this with version 27.0.1 downgrading the PHP base image from php:8.2-apache-bookworm to php:8.2-apache-buster. So far so good it still works with v27 and bookworm. FYI.

@mlopezcoria
Copy link

mlopezcoria commented Aug 25, 2023

I just succesfully worked around this with version 27.0.1 downgrading the PHP base image from php:8.2-apache-bookworm to php:8.2-apache-buster. So far so good it still works with v27 and bookworm. FYI.

Me too. Big thanks for all of you guys for helping with that!
I did this:

1.- Clone Nextcloud repository into the docker-compose.yml directory

cd /docker-apps/nextcloud
git clone https://github.com/nextcloud/docker.git

2.- Changed the version name of debian (bullseye, bookwork or whatever it is) to buster in the Dockerfile. Look for it in the corresponding version directory under the cloned Nextcloud repository (in this case /docker-apps/nextcloud/docker/27/apache/Dockerfile)

3.- After changing to the Dockerfile path

cd /docker-apps/nextcloud/docker/27/apache/

I run the build command:

docker build -t nextcloudtest . -f Dockerfile

4.- A few years later I modified the docker-compose.yml file to match the new nextcloud image name (nextcloudtest):

vim docker-compose.yml

nextcloud-app:
    image: nextcloudtest

5.- And finally started all up.

docker compose up -d && docker compose logs -f

It is just all of the above in a single post. I just compiled it ;-)

Regards,
Mauricio

@milux
Copy link

milux commented Aug 30, 2023

2.- Changed the version name of debian (bullseye, bookwork or whatever it is) to buster in the Dockerfile. Look for it in the corresponding version directory under the cloned Nextcloud repository (in this case /docker-apps/nextcloud/docker/27/apache/Dockerfile)

This is not ideal in case you want to update properly!
There's a better way:

  1. Modify the update.sh as follows (git diff syntax):
@@ -7,8 +7,7 @@ declare -A alpine_version=(
 )
 
 declare -A debian_version=(
-       [25]='bullseye'
-       [default]='bookworm'
+       [default]='buster'
 )

(i.e. set [default] to buster and remove the exception for [25])

  1. Save this changes to git stash with git stash store "$(git stash create)".
    This is helpful if you want to update this repo from upstream to get fixes for Dockerfiles later.

  2. Run ./update.sh.

  3. Build whatever version(s) you want. Example:
    for (( NCV=25; NCV<=27; NCV++ )); do docker buildx build -t nextcloud:$NCV $NCV/apache; done
    This will build all recent NextCloud apache images for versions [25; 27] for amd64.
    If you have an account on DockerHub, you can do this:
    for (( NCV=25; NCV<=27; NCV++ )); do docker buildx build --push -t <your-account>/nextcloud:$NCV $NCV/apache; done

Now, whenever you want to update to the latest NC version, just do steps (3) and (4).

In case you also want to get repo updates from GitHub:

git reset HEAD --hard
git pull
git stash apply  # apply changes in `update.sh` from stash
./update.sh
# insert your build command from step 4 here

And yes, if you feel too lazy for that and just need a fairly recent amd64 image for your Syno box or whatever and consider me a trustworthy source for docker images, feel free to just use my milux/nextcloud:[25/26/27].
Built on my Ubuntu machine, no modifications except base image as described above.

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

No branches or pull requests