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

Docker image doesn't run on (older) Synology NAS #114

Open
JOJ0 opened this issue Mar 10, 2024 · 10 comments
Open

Docker image doesn't run on (older) Synology NAS #114

JOJ0 opened this issue Mar 10, 2024 · 10 comments

Comments

@JOJ0
Copy link

JOJ0 commented Mar 10, 2024

Synology NAS systems aged a couple of years old (mine is 10+years old) still run a kernel 3.x.something (DSM6.x, DSM7.x), the Ampache docker image uses a compiled apache2 package that requires features (urandom related) that these kernels don't have.

I suggest providing a docker image that is compatible with such older machines/kernels. Updating kernels on such NAS boxes is not a good idea, if not impossible, I suppose.

I think the best stolution would be to create an Ampache container that is based on Debian buster, instead of bullsyeye. I'm trying to get one built with an altered Dockerfile at the moment but no success so far.

Drop me a note for any hints with similar problems.

HTH

@JOJ0
Copy link
Author

JOJ0 commented Mar 10, 2024

This is how the container fails when running docker-compose up with the provided docker-compose.yml:

ampache    | 2024-03-10 09:34:23,359 INFO spawned: 'mysql' with pid 11
ampache    | 2024-03-10 09:34:24,071 WARN exited: apache2 (exit status 1; not expected)
ampache    | 2024-03-10 09:34:24,604 INFO success: cron entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
ampache    | 2024-03-10 09:34:24,604 INFO success: inotifywait entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
ampache    | 2024-03-10 09:34:24,605 INFO success: mysql entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
ampache    | 2024-03-10 09:34:25,247 INFO spawned: 'apache2' with pid 111
ampache    | 2024-03-10 09:34:25,285 WARN exited: apache2 (exit status 1; not expected)
ampache    | 2024-03-10 09:34:27,297 INFO spawned: 'apache2' with pid 120
ampache    | 2024-03-10 09:34:27,968 WARN exited: apache2 (exit status 1; not expected)
ampache    | 2024-03-10 09:34:30,982 INFO spawned: 'apache2' with pid 133
ampache    | 2024-03-10 09:34:31,022 WARN exited: apache2 (exit status 1; not expected)
ampache    | 2024-03-10 09:34:31,024 INFO gave up: apache2 entered FATAL state, too many start retries too quickly

@JOJ0 JOJ0 changed the title Docker image doesn't run on (older) Synology NAS) Docker image doesn't run on (older) Synology NAS Mar 10, 2024
@JOJ0
Copy link
Author

JOJ0 commented Mar 10, 2024

This is the specific error when hooked up to a container shell and trying to run Apache2:

root@1c23aa7acb77:/# service apache2 start
Starting Apache httpd web server: apache2 failed!
The apache2 configtest failed. ... (warning).
Output of config test was:
[Sun Mar 10 12:16:55.917400 2024] [:crit] [pid 530] (38)Function not implemented: AH00141: Could not initialize random number generator
Action 'configtest' failed.
The Apache error log may have more information.
root@1c23aa7acb77:/#

@JOJ0
Copy link
Author

JOJ0 commented Mar 12, 2024

Update: I can run older Docker images: The newest that does not have this issue (probably still be Debian Buster), is

 image: ampache/ampache:4.4.3

For now I gave up building a container myself and use exactly this old version. I'm hitting a lot of bugs though that might be fixed in newer Ampache versions, so this is not a sufficient solution in the long run.

Still interested in anyone else's thoughts on how to possibly build a container myself that runs a 5.x or even 6.x Ampache version compatible with my old kernel.

@mitchray
Copy link
Member

I'm a docker (and linux) noob so forgive me, I thought everything is self-contained so why does the kernel matter?

@JOJ0
Copy link
Author

JOJ0 commented Mar 12, 2024

I'm a docker (and linux) noob so forgive me, I thought everything is self-contained so why does the kernel matter?

Nope, exactly not the case. To put it simple, the difference is that

  • "full virtualization" (as in a fully virtualized computer, what we call simply a "Virtual Machine/VM") has its own kernel,
  • whereas a (Docker-)container shares the kernel with the host machine.

Hope that clarifies and educates :-)

@JOJ0
Copy link
Author

JOJ0 commented Mar 12, 2024

But this brings me to a new idea: The problem seems to be Apache included in Debian bullsyeye that requires that kernel feature......

Ok, so is there maybe a Docker Ampache image out there that does not use Apache but Nginx as the webserver (or even any other webserver)?

@kuzi-moto
Copy link
Member

According to this SO post, the last working version of Apache that didn't require this kernel feature is 2.4.18.

You could modify the Ampache Dockerfile to manually install that version of Apache. This isn't a great solution as it requires you to run vulnerable software.

As you mentioned using a different webserver altogether is a much better idea. There is no "official" image that uses Nginx, but I did find this repository from 6 years ago that you could try: https://github.com/OnekO/ampache-alpine-nginx/tree/master You'll want to set a couple of the environment variables found in the Dockerfile likely.

If that doesn't work, it should be possible to modify the Ampache Dockerfile to replace Apache with Nginx. You would just need to make sure to include the relevant Nginx configuration. I might be able to take a stab at it this week if I can find some time but no promises.

@lachlan-00
Copy link
Member

According to this SO post, the last working version of Apache that didn't require this kernel feature is 2.4.18.

You could modify the Ampache Dockerfile to manually install that version of Apache. This isn't a great solution as it requires you to run vulnerable software.

As you mentioned using a different webserver altogether is a much better idea. There is no "official" image that uses Nginx, but I did find this repository from 6 years ago that you could try: https://github.com/OnekO/ampache-alpine-nginx/tree/master You'll want to set a couple of the environment variables found in the Dockerfile likely.

If that doesn't work, it should be possible to modify the Ampache Dockerfile to replace Apache with Nginx. You would just need to make sure to include the relevant Nginx configuration. I might be able to take a stab at it this week if I can find some time but no promises.

If i was going to do it, i'd do this. but outside of apache and iis i'm not familiar with the other webservers

@JOJ0
Copy link
Author

JOJ0 commented Mar 13, 2024

Thanks so much, that is all very great advice! Keep me posted if you find the time to test something. I hope I manage to come back to this project soon. Thanks again!

@JOJ0
Copy link
Author

JOJ0 commented Mar 13, 2024

According to this SO post, the last working version of Apache that didn't require this kernel feature is 2.4.18.

You could modify the Ampache Dockerfile to manually install that version of Apache. This isn't a great solution as it requires you to run vulnerable software.

I couldn't let it be and thought, since my Ampache won't be accessible on the internet anyway, this could be the quickest solution, but I quickly ran out of knowledge about current possibilities with Debian package management.

Wasn't it always the case that getting an older version of a Debian package involves enabling the repo in /etc/apt/sources.list.d/ for older stable version, in that case Debian Buster, to get access to that specific package version? And then most probably entering "Dependency Hell"...

Is there maybe new possibilities like "snapshot.debian.org" that make things like that easier? I'm not sure if I recall this service from my days back when I had more Debian admin knowledge.

Maybe before I dig to deep, the straight up question, is there a quick way to install 2.4.18 Apache? What to roughly change in the Dockerfile? (building the container takes ages on my machine, thus it's pretty frustrating if I trial and error what to change exactly!)

Thanks!!!!!!!!!

PS: Only thing I know is apt install apache2=2.4.18-something would be the syntax to select specific version, but I'm pretty sure it's not available in bullseye out-of-the-box....

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

No branches or pull requests

4 participants