Bug 694597 - Fatal error: can't bind to 127.0.0.1:8118: The hostname is not resolvable
Summary: Fatal error: can't bind to 127.0.0.1:8118: The hostname is not resolvable
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: privoxy
Version: 14
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Karsten Hopp
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-04-07 17:57 UTC by Raphael Groner
Modified: 2013-02-06 21:09 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-06-05 11:18:15 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Raphael Groner 2011-04-07 17:57:38 UTC
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-02 01:23:58 UTC
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 04:03:09 UTC
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 10:30:24 UTC
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 15:22:43 UTC
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 11:12:37 UTC
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 20:42:26 UTC
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 21:17:17 UTC
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 21:56:29 UTC
Thank you for your time and consideration.

Comment 9 bodhi.zazen 2011-06-07 03:57:09 UTC
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 17:00:50 UTC
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.