dictd icon indicating copy to clipboard operation
dictd copied to clipboard

"Cannot connect to any servers" (but I can telnet to the server)

Open jbrea opened this issue 2 years ago • 4 comments

I ran into a weird behavior: Everything runs normally when I am connected to the internet (wlan or ethernet), e.g.

$ dict -I -v
Configuration file:
   server localhost
  dictd 1.13.1/rf on Linux 5.17.4-arch1-1
  On machina: up 11:07, 8 forks (43.2/hour)
  
  Database      Headwords         Index          Data  Uncompressed
  moby-thesaurus      30263        528 kB         10 MB         28 MB

When I am offline I get

$ dict -I -v
Configuration file:
   server localhost
Cannot connect to any servers

but I can still access and query the local dict server with

$ telnet localhost 2628

Any ideas why dict fails to connect to the server when I am offline?

jbrea avatar Apr 26 '22 11:04 jbrea

  1. Have a look at dict.conf configuration file
  2. Does "dict -h localhost -p 2628 -I -v" work as expected in both cases?
  3. What does "netstat -lntp | grep 2628" say?

cheusov avatar May 03 '22 16:05 cheusov

Thanks for the support!

  1. This is my dict.conf
# Usually all you will ever need here is the server keywords.
# Refer to the dict manpage for other options.
# It will only check the second server if the first fails
server localhost
# server dict.org
  1. "dict -h localhost -p 2628 -I -v" works as expected when I am connected to the internet. Otherwise it returns
$ dict -h localhost -p 2628 -I -v
Configuration file:
   server localhost
Cannot connect to any servers
  1. I'm on archlinux and use ss instead of netstat.
$ ss -lntp | grep 2628
LISTEN 0      10           0.0.0.0:2628      0.0.0.0:*    

jbrea avatar May 04 '22 07:05 jbrea

  1. Is your hostname "localhost" assigned to 127.0.0.1 or something like this and lo0 network interface is up? What does "ifconfig" command or equivalent "ip" says about running network interfaces?
  2. Do you use latest github version "dict" or latest stable release version?

cheusov avatar May 14 '22 13:05 cheusov

Thanks.

$ getent hosts  
127.0.0.1       localhost
$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
  1. This is the version I use: dictd 1.13.1/rf on Linux 5.17.5-arch1-1.

jbrea avatar May 15 '22 13:05 jbrea