Bug 694597 - Fatal error: can't bind to 127.0.0.1:8118: The hostname is not resolvable
Fatal error: can't bind to 127.0.0.1:8118: The hostname is not resolvable
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: privoxy (Show other bugs)
14
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Karsten Hopp
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-04-07 13:57 EDT by Raphael Groner
Modified: 2013-02-06 16:09 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-06-05 07:18:15 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Raphael Groner 2011-04-07 13:57:38 EDT
Description of problem:
/var/log/privoxy/logfile is spammed with the above message. Privoxy service does not start automatically, but it is able to run manually.

Version-Release number of selected component (if applicable):
privoxy-3.0.16-3.fc14.x86_64

How reproducible:
Sometimes

Steps to Reproduce:
1. boot Fedora
2. Try to connect to a web page with enabled Tor/Privoxy proxy setting.
3.
  
Actual results:
no connection, privoxy service not running

Expected results:
Privoxy service starts automatically

Additional info:
Comment 1 bodhi.zazen 2011-06-01 21:23:58 EDT
I had this problem in Fedora 15 as well.

I solved it by adding this to /etc/sysctl.conf

net.ipv6.conf.all.disable_ipv6 = 1
Comment 2 bodhi.zazen 2011-06-02 00:03:09 EDT
It seems the problem is indeed that privoxy is running too soon in the boot process.

I reviewed the boot scripts and did not want to add a sleep there, so I called it from rc.local

/bin/sleep 20 && /etc/init.d/privoxy start

With a sleep of to privoxy failed , so somewhere between 10-20 second delay was needed.
Comment 3 Raphael Groner 2011-06-02 06:30:24 EDT
Thanks for debugging and the suggested work-around.
As you mentioned already and in regard to a working package due to the bugging default boot script, I don't think that this is a good solution with a manual modification to rc.local that is for user speciffic configuration. There should be a fixed package in the repository.
Comment 4 bodhi.zazen 2011-06-02 11:22:43 EDT
No, it is a work around, not a fix.

My perception is that most distos are trying to boot boot speed and many of the boot scripts run concurrently , so for example, rc.local runs, but not last, after everything else, and thus I needed a fairly substantial sleep to allow the networking scripts to settle.

Thank you for looking into the issue on Fedora.
Comment 5 Raphael Groner 2011-06-05 07:12:37 EDT
The problem is here that the loopback device is not running. The following command fixed it for me by starting the network service automatically. It starts the loopback device that will otherwise be there after NetworkManager has started the network, but that's too late for privoxy.

# chkconfig network on
Comment 6 bodhi.zazen 2011-06-06 16:42:26 EDT
Fair enough, is there any way to package privoxy so that the network service is started automatically without user intervention ?
Comment 7 Raphael Groner 2011-06-06 17:17:17 EDT
I thought about how this could be solved to have no user intervention required. But it's a thing depending on configuration. The address and port can be configured, default is 127.0.0.1 as address and 8118 as port.

The network service is part of the initscripts package, but it could be any other service that provides the network address and port to bind to (maybe on another machine). The bad thing is that privoxy package comes with an activated start script installed by default, maybe this should be removed from the package - but then the user will be also forced to start privoxy correctly configured. So, nothing will be won.

Summary: It's neither a bug of privoxy, nor of initscripts. Unfortunately, mostly a configuration problem.
Comment 8 bodhi.zazen 2011-06-06 17:56:29 EDT
Thank you for your time and consideration.
Comment 9 bodhi.zazen 2011-06-06 23:57:09 EDT
Your proposed solution did not work here

chkconfig | grep network
network        	0:off	1:off	2:on	3:on	4:on	5:on	6:off

With those settings, if I reboot, privoxy fails without an error message in the logs.

If I use 

/bin/sleep 20 && /etc/init.d/privoxy start

in rc.local it starts
Comment 10 Raphael Groner 2011-06-07 13:00:50 EDT
Feel free to open a new bug report. 
My problem is solved, so I've already closed this bug with comment #5. :)

Note You need to log in before you can comment on or make changes to this bug.