refuses to connect to localhost http server when in offline mode

Bug #207456 reported by Daniel Newman
20
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mozilla Firefox
Invalid
Medium
Ubuntu
Invalid
Undecided
Unassigned
firefox (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: firefox-3.0

system:
Description: Ubuntu hardy (development branch)
Release: 8.04

firefox:
  Installed: 3.0~b4+nobinonly-0ubuntu1
  Candidate: 3.0~b4+nobinonly-0ubuntu1
  Version table:
 *** 3.0~b4+nobinonly-0ubuntu1 0
        500 http://au.archive.ubuntu.com hardy/main Packages
        100 /var/lib/dpkg/status

The computer in use is running an apache http server. It is not always connected to a network. The firefox home page is set to the localhost http server. When not connected to a network through either ethernet or wifi, starting firefox 3.0 results in a failure to connect to the local server. Manually changing to online mode rectifies the problem. This bug is specific to firefox 3, and did not occur in previous versions.

Revision history for this message
In , Mozilla (mozilla) wrote :

Seconded. Since Novell is shipping autodetection of the network status there are some reports that local webapplications are not accessible.
This is nothing new.
Bug 87717 is about the same problem.

Revision history for this message
In , Darin-moz (darin-moz) wrote :

-> reassign to default owner

Revision history for this message
Daniel Newman (dmnewman) wrote : localhost http server not detected

Binary package hint: firefox-3.0

system:
Description: Ubuntu hardy (development branch)
Release: 8.04

firefox:
  Installed: 3.0~b4+nobinonly-0ubuntu1
  Candidate: 3.0~b4+nobinonly-0ubuntu1
  Version table:
 *** 3.0~b4+nobinonly-0ubuntu1 0
        500 http://au.archive.ubuntu.com hardy/main Packages
        100 /var/lib/dpkg/status

The computer in use is running an apache http server. It is not always connected to a network. The firefox home page is set to the localhost http server. When not connected to a network through either ethernet or wifi, starting firefox 3.0 results in a failure to connect to the local server. Manually changing to online mode rectifies the problem. This bug is specific to firefox 3, and did not occur in previous versions.

Revision history for this message
Alex Sutcliffe (alex.sutcliffe) wrote :

I can confirm that this is how Firefox behaves for me on Hardy. When in offline mode, firefox will not connect to a local http server whether trying localhost, 127.0.0.1 or any other name/ip that resolves to local machine.

I'm not entirely sure whether this is a bug or simply the way it should behave though.

Changed in firefox-3.0:
status: New → Confirmed
Revision history for this message
Teerapap Changwichukarn (teerapap-c) wrote :

I comfirm too. Firefox tells that it's in offline mode.

Revision history for this message
nandhp (nandhp) wrote :

I can confirm this on Gutsy with firefox-3.0 Beta 4 from backports.

Revision history for this message
chudified (chudified) wrote :

This is on Hardy with firefox-3.0 RC1

Revision history for this message
In , Carmelos (carmelos) wrote :

is there anything that could be done about not being able to access localhost when there is no Internet connection? it is really anoying...! Because of this I HAVE TO use M$$ browser (or Opera...) :(((( and I like my Firefox very much...

Revision history for this message
In , Roc-ocallahan (roc-ocallahan) wrote :

You can manually uncheck "work offline".

Revision history for this message
Alexander Sack (asac) wrote : Re: [Bug 207456] Re: localhost http server not detected

On Sat, May 31, 2008 at 02:22:41PM -0000, chudified wrote:
> This is on Hardy with firefox-3.0 RC1
>

Please attach /etc/network/interfaces file and the output of running

 ifconfig

Thanks!

 status incomplete

 - Alexander

Changed in firefox-3.0:
status: Confirmed → Incomplete
Revision history for this message
chudified (chudified) wrote : Re: localhost http server not detected

my interfaces file is:

auto lo
iface lo inet loopback

ifconfig output when my network is disconnected is:

eth0 Link encap:Ethernet HWaddr XX:XX:XX:XX:XX:XX
          UP BROADCAST MULTICAST MTU:1500 Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
          Interrupt:22 Base address:0x2000

lo Link encap:Local Loopback
          inet addr:127.0.0.1 Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING MTU:16436 Metric:1
          RX packets:1639 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1639 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:87208 (85.1 KB) TX bytes:87208 (85.1 KB)

Thanks,
Leo

Revision history for this message
Alexander Sack (asac) wrote : Re: [Bug 207456] Re: localhost http server not detected

On Tue, Jun 03, 2008 at 11:22:17AM -0000, chudified wrote:
> my interfaces file is:
>
> auto lo
> iface lo inet loopback

and /etc/hosts content? and your /etc/resolv.conf ?

 affects ubuntu
 status incomplete
 tag needs-reassignment

 affects ubuntu/firefox-3.0
 status invalid

 - Alexander

Changed in firefox-3.0:
status: Incomplete → Invalid
Revision history for this message
Allen Riddell (ariddell) wrote : Re: localhost http server not detected
Revision history for this message
In , Charles Sullivan (cwsulliv) wrote :

It is darned annoying to have to manually uncheck "work offline" every time I start FF when I'm disconnected from the local network! Please provide an option to disable automatic switching to offline mode.

Revision history for this message
In , Christian Biesinger (cbiesinger) wrote :

once you uncheck work offline, firefox no longer automatically switches between offline and online (until you restart it)

Revision history for this message
In , Charles Sullivan (cwsulliv) wrote :

(In reply to comment #6)
> once you uncheck work offline, firefox no longer automatically switches between
> offline and online (until you restart it)

This is true. But I don't keep FF open when I'm not using it, and as I stated it's darned annoying to have to uncheck the box each time I start it.

As a Linux user, I find it quite unusual that a Linux app with the quality of FF is lacking a configuration option to disable having the app automatically make decisions like this for me.

Revision history for this message
Alexander Sack (asac) wrote : Re: localhost http server not detected

ok, then lets use that.

Changed in firefox-3.0:
status: Invalid → Triaged
Changed in firefox:
status: Unknown → Confirmed
Revision history for this message
In , Steve White (stevan-white) wrote :

In my case, "work offline" comes up selected whether I'm connected to a network or not. I have to un-check it every time I start Firefox in order to browse the web.

The only thing I found that sort of fixed it was to have Network Manager running first, turn off offline mode there, then start Firefox. But that is only a per-session solution.

Here is a list of discussions of the topic:
http://ubuntuforums.org/showthread.php?t=767045
http://ubuntuforums.org/showthread.php?t=800179
http://support.mozilla.com/tiki-view_forum_thread.php?comments_parentId=11503&fo
rumId=1

Revision history for this message
In , Benc-meer (benc-meer) wrote :

Darin: isn't this a dupe of Bug 87717?

Revision history for this message
In , Ajimix (ajimix) wrote :

Hello, Im using Firefox 3.0.1 and Windows XP and I use a lot local websites with no internet connection. I have the Offline problem all the time and I have to uncheck the work offline option. But everytime I restart Firefox I have to do the same again.

I tried with localhost and with 127.0.0.1 and everytime happens the same. Why this option is not saved and how I can solve this problem? Is that a bug?

Revision history for this message
In , COKEDUDE (cokedude) wrote :

Have there been any updates to this? This is also driving me crazy.

Revision history for this message
In , Benc-meer (benc-meer) wrote :

We need to break out the user data by platform. I have a feeling linux users feel it more because they have some new network-detection features...

Revision history for this message
In , Steve White (stevan-white) wrote :

The problem has largely gone away for me. Firefox still gets into offline mode, but only when I start it with the network down, which makes more sense.

I've changed a lot of stuff, and I don't know what change improved the situation. Here is what I can think of:

I'm now running Ubuntu 8.04 Hardy Heron; when I reported before, I was at 7.10 Gutsy Gibbon. I also updated Firefox from 3.0 to 3.0.1.

Besides that, I did a sort of purge of files from my ~/.mozilla/firefox/ directory, that seemed no longer to be used.

But... Windows users are reporting a similar problem with FF 3.0.1... the common denominator would be the .mozilla/firefox directory...

Revision history for this message
In , Gervase Markham (gerv-mozilla) wrote :

benc is right: on Linux, Firefox now responds to dbus messages from Network Manager, which means that if you disconnect the network cable, Firefox goes offline and you can't access your locally-served resources.

I think an exception for 127.0.0.1 and localhost would cover 99% of the cases. We could even make the list of exceptions a pref for the tiny number of people who have other local aliases for their own machine.

Gerv

Revision history for this message
In , Pander (pander) wrote :

I experienced this when travelling by train. After booting my Ubuntu Hardy Heron system, it detects no wired (default) or wireless networks and therefore Firefox 3 is set to normal mode. When the train stops at a station that has a wireless network, even though I don't (try to)access it, the system is not really influenced by this. However when the wireless network goes out of reach, Firefox detects the network has gone when accessing localhost and switches to 'working offline'.

In short, like many other argue, Firefox accessing localhost should not be effected by this. I would like to propose, like others, that accessing localhost is considered like accessing an URL on the local file system.

If one really needs the behaviour that localhost is considered an external URL, it should be possible to enable this functionality somewhere in the preference menu's.

Revision history for this message
In , Pander (pander) wrote :

Perhaps another issue, but slightly related to this is, is caching for localhost. Should caching be used for local files and localhost usage? For developers it is desirable to have caching disabled in these cases. For normal users and in general, not using cache in these cases is probably faster anyway.

Revision history for this message
In , Håkan W (hwaara-gmail-deactivatedaccount) wrote :

*** Bug 461156 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Håkan W (hwaara-gmail-deactivatedaccount) wrote :

Firefox (and other Gecko apps) on OS X now has auto-detection of network link and go into offline mode when you lose network connectivity.

This bug is extremely annoying if you're developing something with a local server.

Revision history for this message
In , IceTheNet (icethenet) wrote :

This bug has now increased with recent upgrade to 3.0.5 using windows vista after upgrade I can't even use localhost as it is blocked in both offline and online mode. I have downloaded and installed opera but I am a FF Fanboy and don't like to have other browsers on my computer. I think you need to fix this bug asap as I have been looking at other browsers as an alternative to firefox. If I am I know other people are also. I run Apache webserver with php and mysql and use dreamweaver to develop websites. I have come to rely on Firefox as a primary web development tool and this just flat out makes me disgusted that the problem has been known about for a long time and not addressed and now it is worse.

Revision history for this message
In , Steve White (stevan-white) wrote :

Problem came back in an upgrade to Ubuntu 8.10 Intrepid.
Solution (again): un-install Networkmanager (no big loss there).

Revision history for this message
In , Egil-wp (egil-wp) wrote :

Seems resonable to have cache disabled for anything that gets translated into 127.0.0.1. After all it's almost like loading a file from disk anyway.

Revision history for this message
In , Egil-wp (egil-wp) wrote :

Just a thought, but maybe there could be something like:
 browser.cache.offline.disable_on='localhost, 127.0.0.1'
and/or
 browser.offline.never_offline_on='localhost, 127.0.0.1'

(similar to network.proxy.no_proxies_on)

Revision history for this message
In , Honzab-moz (honzab-moz) wrote :

(In reply to comment #21)
> Seems resonable to have cache disabled for anything that gets translated into
> 127.0.0.1. After all it's almost like loading a file from disk anyway.

I don't agree. If web developers want to test their cache headers on localhost server the behavior will be different from what is expected normally when address of the same configured server is not localhost.

(In reply to comment #22)
> Just a thought, but maybe there could be something like:
> browser.cache.offline.disable_on='localhost, 127.0.0.1'
> and/or
> browser.offline.never_offline_on='localhost, 127.0.0.1'
>
> (similar to network.proxy.no_proxies_on)

To fix this bug is not that simple and have option like this as well. When necko gets to offline mode DNS and socket service get shutdown. It means we cannot resolve localhost to 127.0.0.1 (ipv4) or ::1 (ipv6) and even we could we cannot run any connections to it. This would mean complex rebuild of the necko infrastructure. There is workaround for this described in comment 6.

Revision history for this message
In , Tomas-boothby (tomas-boothby) wrote :

Perhaps an intermediate solution would be to add a button to the error message -- right next to "try again". I'm bitten by this bug every single day, since I run Sage from localhost (math software with an html interface) on my laptop, and I'm frequently on the move.

Revision history for this message
In , Egil-wp (egil-wp) wrote :

Checkout this extension:
http://multi.nadenade.com/leafy/Mozilla/Offline/
After few months of testing this I can say it works-for-me :-).

Revision history for this message
In , Honzab-moz (honzab-moz) wrote :

(In reply to comment #25)
> Checkout this extension:
> http://multi.nadenade.com/leafy/Mozilla/Offline/
> After few months of testing this I can say it works-for-me :-).

I don't think this fixes this bug somehow.

Revision history for this message
In , Jduell-mcbugs (jduell-mcbugs) wrote :

Would a sensible, quick first step for this problem be to allow users to completely turn off offline mode all the time, in an about:config setting? (I don't see one right now). This would allow people to not have to hit "uncheck work offline" each time they fire up the browser.

It's a blunt hammer, but it may be better than the current behavior for the small subset of users who are getting bit by this bug every day.

Revision history for this message
In , Jduell-mcbugs (jduell-mcbugs) wrote :

Sorry, my wild mouse click set this to be a "confidential" bug. Removing.

Revision history for this message
In , Mark-marksw (mark-marksw) wrote :

Also run into this annoying behavior :(

IMHO with HTML5 and its offline modes coming into play soon, this might be more then annoyance. Offline mode should be triggered per site when there is no connection with the site (after a request has failed) and this will solve the localhost problem as well, and the wifi stability people are complaining on http://support.mozilla.com/tiki-view_forum_thread.php?comments_parentId=11503&forumId=1

Revision history for this message
In , Fmdevelopertim (fmdevelopertim) wrote :

*** Bug 535734 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Matt McCutchen (matt-mattmccutchen) wrote :

*** Bug 440527 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Matt McCutchen (matt-mattmccutchen) wrote :

*** Bug 529861 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Matt McCutchen (matt-mattmccutchen) wrote :

*** Bug 539541 has been marked as a duplicate of this bug. ***

Changed in firefox:
importance: Unknown → Medium
Revision history for this message
In , nerkn (erkintek-gmail) wrote :

Work around is having a 3g stick. It's been 2 years that bug is reported but no action. Do you live in a place where everywhere covered with wifi? Don't you bother 33 bug reports.

Revision history for this message
aaron-bru (aaron-bru) wrote : Re: localhost http server not detected

in case anyone is having issues where localhost is working but localhost virtual hosts are not, (ie site.localhost), with offline mode off, I had to set network.dns.disableIPv6 back to its default value of false to fix the virtual host problem.
http://tristram.squarespace.com/home/2011/6/3/firefox-ignoring-etchosts-when-dns-not-available.html

summary: - localhost http server not detected
+ refuses to connect to localhost http server when in offline mode
affects: firefox-3.0 (Ubuntu) → firefox (Ubuntu)
Revision history for this message
In , Patrick McManus (mcmanus-ducksong) wrote :

is this a dup of 87717 (which was fixed in ff18)?

Revision history for this message
In , Samuel (sc7898) wrote :

It would seem sensible for Firefox to see if a connection to a site is possible each and every time one is typed into the URL bar - and come out of automatic offline mode if one is. I use XAMPP to run a local wiki and a wordpress journal, and I often do so with my laptop's WiFi turned off to save energy. Firefox starts in offline mode whenever WiFi is disabled and so refuses to attempt a connection to even local sites even if I type their address into the URL bar several times. Only going onto that page and specifically pressing 'Try Again' brings it out of offline mode and allows it to access local sites.

Revision history for this message
In , Daniel Stenberg (daniel-haxx) wrote :

I believe automatically switching to offline mode is a bad idea in general and that's what's causing problems such as this.

If "offline" means don't try to resolve anything nor use any sockets, then switching on offline mode should only be done by a more active decision from a user (or script or whatever).

This is related to bug 939318

Revision history for this message
In , Hendy Irawan (ceefour) wrote :

Created attachment 8467544
firefox-local-hosts-bug.png

Contents of my /etc/hosts is as follows:

127.0.1.1 amidea.dev amidea sanad.sanad.amidea.dev

Firefox is NOT in Offline Mode, however with the network disconnected I'm unable to access a local site using Firefox v30. Firefox requires network connection to even browse local sites resolving to 127.0.1.1/127.0.0.1.

Chrome (v35) can access the site normally as depicted in the screenshot.

Occurs in Linux Mint 17 64-bit.

Should I report a new bug? Because this happens irrespective of Work Offline checked or not. Bug 339814 seems to only cater to when Work Offline is checked.

Revision history for this message
In , Hendy Irawan (ceefour) wrote :

I've found another bug that is exactly as my issue, which is Bug 698302 (almost similar but different than this one), reported 3 years ago (!!!).

Revision history for this message
In , Daniel Stenberg (daniel-haxx) wrote :

The problem with using "localhost" that occurs when in offline mode should be fixed with the fix from bug 1140284 (inbound just now). If someone still suffers from this problem even after using that fix, I would like to know how to repeat it!

Problems with accessing local hosts while in offline mode using _other_ hostnames than "localhost" is the problem mentioned in Bug 698302 and is not covered by this specific bug report.

Revision history for this message
In , Daniel Stenberg (daniel-haxx) wrote :

I consider this closed as well with the fix from bug 1140284.

Changed in firefox:
status: Confirmed → Fix Released
Changed in firefox:
status: Fix Released → Invalid
Revision history for this message
Paul White (paulw2u) wrote :

Upstream bug is a duplicate of #1140284
which was closed "RESOLVED FIXED" on 2015-03-12
Target release - Firefox 39
Closing by marking "Fix Released"

Changed in firefox (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.