You are not logged in.

#1 2019-12-10 16:39:18

eloraju
Member
Registered: 2019-12-10
Posts: 3

[SOLVED]Localhost becomes unreachable after waking up from sleep

For some reason my localhost just dies whenever I put my computer to sleep. I noticed this when I was trying to run a node.js server locally and would get this error

listen EADDRNOTAVAIL: address not available 127.0.0.1:9443
Error: listen EADDRNOTAVAIL: address not available 127.0.0.1:9443
    at Server.setupListenHandle [as _listen2] (net.js:1262:19)
    at listenInCluster (net.js:1327:12)
    at doListen (net.js:1460:7)
    at process._tickCallback (internal/process/next_tick.js:63:19)
    at Function.Module.runMain (internal/modules/cjs/loader.js:832:11)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)

Thus far the only remedy I've found is to reboot the machine... I've been trying to find a solution to this for a couple of days now but to no avail. I'm rather new to Arch so this just might come down to my inexperience.

This is what I get running

networkctl status lo

after boot

● 1: lo                                                               
             Link File: /usr/lib/systemd/network/99-default.link      
          Network File: /etc/systemd/network/20-wired.network         
                  Type: loopback                                      
                 State: carrier (configured)
                   MTU: 65536                                         
  Queue Length (Tx/Rx): 1/1                                           
               Address: 127.0.0.1                                     
                        ::1                                           
                   DNS: 1.1.1.1                                       
                        1.0.0.1

And this is what I get running it after waking from sleep

● 1: lo                                                               
             Link File: /usr/lib/systemd/network/99-default.link      
          Network File: /etc/systemd/network/20-wired.network         
                  Type: loopback                                      
                 State: carrier (configured)
                   MTU: 65536                                         
  Queue Length (Tx/Rx): 1/1                                           
                   DNS: 1.1.1.1                                       
                        1.0.0.1  

So the first thing I noticed was that the latter is missing address altogether... Secondly I noticed that the interface has a

Network File: /etc/systemd/network/20-wired.network    

attached to it, event though the examples I found had

Network File: n/a

at that place. But since it works right after boot I dismissed the fact. Sadly all other instances of similar problems were kinda inverted... Everyone else seemed to loose their wifi/ethernet while localhost was puffing along. In my case everything else except localhost is working... Even a small nudge to the right direction is more than welcome at this point. Thanks in advance!

Last edited by eloraju (2019-12-10 21:51:26)

Offline

#2 2019-12-10 16:41:59

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,405

Re: [SOLVED]Localhost becomes unreachable after waking up from sleep

localhost is not a valid hostname (as it's well reserved for the actual meaning of localhost) fix and properly set a hostname: https://wiki.archlinux.org/index.php/Ne … e_hostname

Offline

#3 2019-12-10 17:00:30

eloraju
Member
Registered: 2019-12-10
Posts: 3

Re: [SOLVED]Localhost becomes unreachable after waking up from sleep

I did follow the installation quite thoroughly and I'm pretty sure the hosts shouls be in order. I didn't do anything fancy so I'ts just a copy-pasta from the installation guide.

/etc/hosts
-------
127.0.0.1	localhost
::1		localhost
127.0.1.1	core.localdomain core
/etc/hostname
-------
core

Could this somehow still be the issue?

Offline

#4 2019-12-10 20:24:58

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,161

Offline

#5 2019-12-10 21:50:50

eloraju
Member
Registered: 2019-12-10
Posts: 3

Re: [SOLVED]Localhost becomes unreachable after waking up from sleep

From the thread linked by seth

pablo82 wrote:

`networkctl status lo`:

● 1: lo
             Link File: /usr/lib/systemd/network/99-default.link
          Network File: /etc/systemd/network/noDHCPdns.network
                  Type: loopback
                 State: carrier (configured)
                   MTU: 65536
  Queue Length (Tx/Rx): 1/1

There is no match condition here, so maybe it implies loopback is managed:
`cat /etc/systemd/network/noDHCPdns.network`

[DHCP]
UseDNS=false

will try to disable that

I checked my 25-wireless.network and lo and behold

[]Match] <--------!!!!!!
Name=wl*

[Network]
DHCP=ipv4
DNS=1.1.1.1
DNS=1.0.0.1

Fixed the typo and everything works like a charm once more. Thanks!

Edit:
I realised that I didn't say that I did remove the 20-wired.network and booted the machine just for the localhost to get managed by the aforementioned 25-wireless.network. When I created these configs I first created the 20-wired.network and just copied it and switched the Match condition to match wireless devices.  I clearly had the same typo in that as well and this would explain why just removing the first config did nothing.

Last edited by eloraju (2019-12-11 05:53:28)

Offline

Board footer

Powered by FluxBB