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

Lighttpd fails to start on Synology: (network.c.464) can't bind to port: 80 Address already in use #464

Closed
4 of 7 tasks
goncalossilva opened this issue May 31, 2019 · 4 comments

Comments

@goncalossilva
Copy link

goncalossilva commented May 31, 2019

This is a...

  • Request for a new or modified feature
  • Issue trying to run the docker image
  • Issue trying to build / test / develop the docker image

Description

I've updated the image from 4.2.X and setup a fresh container, same volumes and environment variables as before. It fails to start, and the log contains these lines over and over:

Starting lighttpd
(network.c.464) can't bind to port:  80 Address already in use
Stopping lighttpd
lighttpd: no process found

Expected Behavior

Container starts successfully.

Actual Behavior

Container fails to start.

Possible Fix

It seems that my ServerIP / WEB_PORT configuration is being ignored, as /etc/lighttpd/lighttpd.conf is trying to use port 80. Switching it to the same port as specified in WEB_PORT makes everything work again.

Steps to Reproduce and debugging done

e.g. your docker run command, pages to visit, CLI commands you ran

  1. Download the latest image in Synology's Docker
  2. Create a container, set the usual environment variables including ServerIP, WEB_PORT and VIRTUAL_HOST
  3. Start the container

Debug steps I have tried

  • I have tried destroying my container instance, pulling the newest image version, and re-creating a new container
  • I have tried running the nearly stock docker run example in the readme (removing any customizations I added)
  • I have tried running without my volume data mounts to eliminate volumes as the cause
  • I have searched this repository for existing issues and pull requests that look similar

Context and extra information

#432, but I have ServerIP specified

Your Environment

  • Docker Host Operating System and OS Version: DSM 6.2.2-24922
  • Docker Version: Docker version 17.05.0-ce, build 371caef-synology
  • Hardware architecture: x86_64
@goncalossilva
Copy link
Author

I have tried running without my volume data mounts to eliminate volumes as the cause

I have now done this, and it's all sorted. Sorry for the spam!

@pralor-bot
Copy link

This issue has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/pi-hole-mit-hue-sonos-iobroker-und-alexa/31042/14

@DennisYildirim
Copy link

Still they did not solve is not it. I'm using the latest version of pihole, on synology docker. Unbelievable

@PromoFaux
Copy link
Member

If you believe you are having the same issue as OP, please provide some more detail. I can't do much with "unbelievable".

Here is the code that sets the custom web port:

setup_web_port() {
local warning=" [!] WARNING: Custom WEB_PORT not used"
# Quietly exit early for empty or default
if [[ -z "${WEB_PORT}" || "${WEB_PORT}" == '80' ]] ; then return ; fi
if ! echo "$WEB_PORT" | grep -q '^[0-9][0-9]*$' ; then
echo "$warning - $WEB_PORT is not an integer"
return
fi
local -i web_port="$WEB_PORT"
if (( web_port < 1 || web_port > 65535 )); then
echo "$warning - $web_port is not within valid port range of 1-65535"
return
fi
echo " [i] Custom WEB_PORT set to $web_port"
echo " [i] Without proper router DNAT forwarding to $FTLCONF_LOCAL_IPV4:$web_port, you may not get any blocked websites on ads"
# Update lighttpd's port
sed -i '/server.port\s*=\s*80\s*$/ s/80/'"${WEB_PORT}"'/g' /etc/lighttpd/lighttpd.conf
}

Please run the container with the environment variable PH_VERBOSE set to 1, and post your startup log - perhaps we will see what is happening.

Also, please provide the command or compose file you are using to configure/start your container.7

I am running on Synology with no issues...

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