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

Privoxy fails to start due to duplicate listen address in config file #2692

Closed
8 tasks done
Mossop opened this issue Aug 30, 2023 · 18 comments
Closed
8 tasks done

Privoxy fails to start due to duplicate listen address in config file #2692

Mossop opened this issue Aug 30, 2023 · 18 comments

Comments

@Mossop
Copy link

Mossop commented Aug 30, 2023

Is there a pinned issue for this?

  • I have read the pinned issues and could not find my issue

Is there an existing or similar issue/discussion for this?

  • I have searched the existing issues
  • I have searched the existing discussions

Is there any comment in the documentation for this?

  • I have read the documentation, especially the FAQ and Troubleshooting parts

Is this related to a provider?

  • I have checked the provider repo for issues
  • My issue is NOT related to a provider

Are you using the latest release?

  • I am using the latest release

Have you tried using the dev branch latest?

  • I have tried using dev branch

Docker run config used

docker-compose.yml:

  transmission:
    container_name: transmission
    image: haugene/transmission-openvpn:edge
    restart: always

    dns:
      - 1.1.1.1
      - 1.0.0.1

    networks:
      - services

    cap_add:
      - NET_ADMIN

    devices:
      - /dev/net/tun

    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /var/lib/transmission/:/config/transmission-home
      - /pool/media/:/pool/media

    environment:
      OPENVPN_PROVIDER: "PIA"
      OPENVPN_CONFIG: "uk_london"
      PIA_OPENVPN_CONFIG_BUNDLE: "openvpn-tcp"
      OPENVPN_USERNAME: "****"
      OPENVPN_PASSWORD: "****"
      ENABLE_UFW: "true"
      LOCAL_NETWORK: "10.10.0.0/16,172.16.0.0/12"
      PUID: "137"
      PGID: "151"
      TRANSMISSION_DOWNLOAD_DIR: "/pool/media/torrents/completed"
      TRANSMISSION_INCOMPLETE_DIR: "/pool/media/torrents/incomplete"
      TRANSMISSION_WATCH_DIR: "/pool/media/torrents/watch"
      TRANSMISSION_WEB_UI: flood-for-transmission
      WEBPROXY_ENABLED: "true"
      WEBPROXY_PORT: "8888"

Current Behavior

Privoxy fails to start, logs the following error:

2023-08-30 11:15:52.884 7f5f921d0b80 Fatal error: can't bind to 10.10.12.131:8888: There may be another Privoxy or some other proxy running on port 8888

Expected Behavior

Privoxy should start as normal.

How have you tried to solve the problem?

Tried the edge tag. Looked at the privoxy config file and spotted the issue, see discussion below.

Log output

2023-08-30 11:15:52.884 7f5f921d0b80 Fatal error: can't bind to 10.10.12.131:8888: There may be another Privoxy or some other proxy running on port 8888

HW/SW Environment

- OS: Linux
- Docker: version 24.0.5, build ced0996

Anything else?

Appears to have been introduced by this change to the privoxy startup script in #2610.

The config file looks like this before the script runs:

listen-address  127.0.0.1:8118
listen-address  [::1]:8118

Before the change above the first sed script would replace the IPv4 listen address with the correct one and the second sed script would remove the IPv6 listen address. Now the first sed script replaces both the listen addresses and the second sed script does nothing. This tells privoxy to attempt to listen on the same address twice causing it to fail.

@resuarez
Copy link

Same problem here

@ilike2burnthing
Copy link
Contributor

@heavygee ^

@RafalHo
Copy link

RafalHo commented Aug 31, 2023

Same problem here

@sbe-arg
Copy link

sbe-arg commented Aug 31, 2023

hahaha same

reverting to 5.0.2 works as usual

@pdobrien
Copy link

pdobrien commented Aug 31, 2023

there is a duplicate listen instruction in the privoxy config file. Once you've started the container, open a shell, remove or comment out one of them, and restart.

@nleach7
Copy link

nleach7 commented Sep 1, 2023

there is a duplicate listen instruction in the privoxy config file. Remove or comment out one of them and restart.

My proxy settings are defined as environment variables. Is a config file something I should migrate to?

@pdobrien
Copy link

pdobrien commented Sep 1, 2023

I'm talking about the privoxy config file that's generated on container start (/etc/privoxy/config inside the container). Mine contained two listen statements like so:

listen-address 172.17.0.6:8888
listen-address 172.17.0.6:8888

I commented one of them out and restarted the container, and privoxy was able to start normally. One of the changes in the latest release was to privoxy/scripts/start.sh which I assume caused this issue.

@pkishino
Copy link
Collaborator

pkishino commented Sep 1, 2023

@heavygee can you ctake a look at this as you authored the PR, thanks

@edgd1er
Copy link
Contributor

edgd1er commented Sep 1, 2023

the new way to set the ip is too generic and change both listen lines (ipv4 and ipv6):

sed -i -E "s/^listen-address\s+.*/listen-address ${adr}:$1/" "$2"

Either move

# Remove the listen-address for IPv6 for now. IPv6 compatibility should come later
sed -i -E "s/^listen-address\s+\[\:\:1.*//" "$2"
to line 26, before ipv4 modification, or fix the current sed.

here is an example of the replacement I use on another project using privoxy:

# Set the port for the IPv4 interface
  adr=$(ip -4  a show eth0| grep -oP "(?<=inet )([^/]+)")
  adr=${adr:-"0.0.0.0"}
  sed -i -E "s/^listen-address\s+[0-9]{1,3}.*/listen-address ${adr}:${port}/" "$2"

I'm sorry, i'm not using anymore this project and my fork is too much different from this one to send a PR.

@heavygee
Copy link
Contributor

heavygee commented Sep 1, 2023

Yeah, my bad on that too-grabby sed 🙄 - the #2678 PR has the better fixes in it - can that PR get approved and merged - for preference?

Otherwise, I have submitted PR #2695 to remedy my error.

@pkishino
Copy link
Collaborator

pkishino commented Sep 1, 2023

can all of you please pull :dev branch and test it there, if everything is fine I'll release an update..

@Mossop
Copy link
Author

Mossop commented Sep 2, 2023

can all of you please pull :dev branch and test it there, if everything is fine I'll release an update..

This seems to work for me.

@juliemars
Copy link

can all of you please pull :dev branch and test it there, if everything is fine I'll release an update..

yep working for me as well thanks!

@oregonpillow
Copy link
Contributor

@pkishino would you be open to tests in the pipeline to prevent this kind of issue in the future?

Would you be open to creating CI tests that:

  1. downloads a small public torrent
  2. check the file hash post download to confirm torrenting/vpn functionality worked
  3. a test to confirm privoxy connections work.

i would be happy to help on this.

@pkishino
Copy link
Collaborator

pkishino commented Sep 3, 2023 via email

@usma0118
Copy link

usma0118 commented Sep 3, 2023

+1 facing same issue.

@ilike2burnthing
Copy link
Contributor

@usma0118 #2692 (comment)

@pkishino
Copy link
Collaborator

pkishino commented Sep 4, 2023

fixed by #2696

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