You are not logged in.

#26 2017-04-08 00:26:11

mufeed2000
Member
Registered: 2017-04-05
Posts: 22

Re: [kind-of-SOLVED] dict is slow and uses network unnecessarily

Ok. it all works now.
looks like the dict-wn package is messed up.
So, to get it working right, simply install dictd, dict-wn and any other dictionary available for dictd (preferably, gcide).
Re-installing dict-wn and then, installing dict-gcide fixed it in my case.
All the dictionary files are actually in the AUR only, which is kind of sad.
Anyway, I have it fixed. Now i'll mark this SOLVED.

Offline

#27 2017-04-08 03:53:42

seth
Member
Registered: 2012-09-03
Posts: 23,232

Re: [kind-of-SOLVED] dict is slow and uses network unnecessarily

Ie. you didn't restart/reconfigure (SIGHUP) the dict server after un/installing packages?
dict will fail to connect to any server because
a) you aliased the dict.org ones to 127.0.0.1
b) your local dictd doesn't start what usually happens for a config error or no available dictionary - try to run "dictd" from a terminal emulator (xterm) and compare the output

Offline

#28 2017-04-08 14:02:15

respiranto
Member
Registered: 2015-05-15
Posts: 479
Website

Re: [kind-of-SOLVED] dict is slow and uses network unnecessarily

I am the maintainer of dict-wn.

Unfortunately, I am not able to reproduce the explained problem. Apart from the building process, installing any of my dict-* packages (including dict-foldoc) should be identical.

Your dict{,d}.conf appear to have been edited manually, however even with these, I am unable to stumble upon any problem here. You might, however, want to try whether changing back to the default¹ mitigates your issue.

Was your local dictd actually running all the time? When it is not, the dict client will fall back to dict.org i.a., due to `--enable-dictorg', as you have already noted. If dictd is actually running (with all default settings and a correct and working network setup), then dict should connect to it, that is, if localhost or something equivalent is the first entry in dict.conf. The latter appears to be the case, while the former does not.
During installation of any of the mentioned dict-* packages, dictd should be (re-)started (thanks to the .install file). This might partially explain, why it helped to install another dict database. However, the .install file should also fix the configuration. Could you please post the three versions of dictd.conf - before any database was installed, after installing (only) dict-wn and after installing another (additional) one?


¹ Without (not necessarily illegal) modifications, the files should look like this after installing dictd and dict-wn:

$ cat /etc/dict/dict.conf
# This is the configuration file for dict.
# 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
$ cat /etc/dict/dictd.conf
# dictd configuration file.
# whipped up by michael conrad tilstra <michael@gentoo.org>

# Informational message

global {
    site site.info
}

# who's allowed.  You might want to change this.
access {
  allow *
}

# Dictionaries are listed below.
# The initrc script scans /usr/lib/dict and adds all of the dictionaries
# it finds here.
#
# The initrc script will delete everything after the the last line and
# replace it with what it finds.  So add all of your things above.
#
# If this is a problem for people, contact me and
# we can work out a different method.
#
#LASTLINE
database wn {
	data /usr/share/dictd/wn.dict.dz
	index /usr/share/dictd/wn.index
}

Offline

#29 2017-04-08 17:40:14

mufeed2000
Member
Registered: 2017-04-05
Posts: 22

Re: [kind-of-SOLVED] dict is slow and uses network unnecessarily

respiranto wrote:

I am the maintainer of dict-wn.

Unfortunately, I am not able to reproduce the explained problem. Apart from the building process, installing any of my dict-* packages (including dict-foldoc) should be identical.

Your dict{,d}.conf appear to have been edited manually, however even with these, I am unable to stumble upon any problem here. You might, however, want to try whether changing back to the default¹ mitigates your issue.

Was your local dictd actually running all the time? When it is not, the dict client will fall back to dict.org i.a., due to `--enable-dictorg', as you have already noted. If dictd is actually running (with all default settings and a correct and working network setup), then dict should connect to it, that is, if localhost or something equivalent is the first entry in dict.conf. The latter appears to be the case, while the former does not.
During installation of any of the mentioned dict-* packages, dictd should be (re-)started (thanks to the .install file). This might partially explain, why it helped to install another dict database. However, the .install file should also fix the configuration. Could you please post the three versions of dictd.conf - before any database was installed, after installing (only) dict-wn and after installing another (additional) one?


¹ Without (not necessarily illegal) modifications, the files should look like this after installing dictd and dict-wn:

$ cat /etc/dict/dict.conf
# This is the configuration file for dict.
# 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
$ cat /etc/dict/dictd.conf
# dictd configuration file.
# whipped up by michael conrad tilstra <michael@gentoo.org>

# Informational message

global {
    site site.info
}

# who's allowed.  You might want to change this.
access {
  allow *
}

# Dictionaries are listed below.
# The initrc script scans /usr/lib/dict and adds all of the dictionaries
# it finds here.
#
# The initrc script will delete everything after the the last line and
# replace it with what it finds.  So add all of your things above.
#
# If this is a problem for people, contact me and
# we can work out a different method.
#
#LASTLINE
database wn {
	data /usr/share/dictd/wn.dict.dz
	index /usr/share/dictd/wn.index
}

Yes. I know.
I had arch installed earlier and with that install, nothing was wrong. NOTE: I was on the same installation when you upgraded wordnet from 3.0 to 3.1.
Then, I installed Antergos alongside arch for testing and i faced the same issue i had faced until earlier today.
Then, as explained in the first post, i had a ransomware attack and ended up reinstalling Arch. This time, dict faced the said issue.

Also, I do believe that there is some difference in configuration b/w gcide and wn (or wn and foldoc). dict-wn still uses config files from /etc. But right now, it seems like its loading the config from elsewhere and said config has simply: server localhost.
My dictd was running all the time and it was confirmed from systemctl.

I edited my config because the default config (same as in your post) was not working for me and i was facing this issue.

Thanks for helping me out (to everyone here, especially seth) and thanks for the dict-wn package (to respiranto).
For now (and possibly forever), my issue has been resolved.

BUT I'm going to try some stuff with dict and dict-wn so that you can reproduce this bug.
Could you try to reproduce it in a fresh livecd?

Offline

#30 2017-04-08 20:09:44

respiranto
Member
Registered: 2015-05-15
Posts: 479
Website

Re: [kind-of-SOLVED] dict is slow and uses network unnecessarily

mufeed2000 wrote:

Also, I do believe that there is some difference in configuration b/w gcide and wn (or wn and foldoc). dict-wn still uses config files from /etc.

What do you mean by that? dict-wn itself does not use anything, it's a database for (mainly) dictd. However, it updates /etc/dict/dictd.conf if dictd is installed in order to enable the latter to use the new database.

But right now, it seems like its loading the config from elsewhere and said config has simply: server localhost.

That should be in /etc/dict/dict.conf, which is never touched by the installation procedure of any of my dict-* packages.

My dictd was running all the time and it was confirmed from systemctl.

Well, if dictd is running and dict is configured to try localhost first, then the local dictd should be replying. There is no way in which the databases should be able to influence this.

I edited my config because the default config (same as in your post) was not working for me and i was facing this issue.

That is, changing it did not solve anything? Elsewise, which problem did it solve?

Thanks for helping me out (to everyone here, especially seth) and thanks for the dict-wn package (to respiranto).
For now (and possibly forever), my issue has been resolved.

I would not really call this issue resolved, since apparently the source of the problem is still unknown.

BUT I'm going to try some stuff with dict and dict-wn so that you can reproduce this bug.
Could you try to reproduce it in a fresh livecd?

I'll try in a minimum installation soon.

Offline

#31 2017-04-08 20:26:18

respiranto
Member
Registered: 2015-05-15
Posts: 479
Website

Re: [kind-of-SOLVED] dict is slow and uses network unnecessarily

I wrote:

I'll try in a minimum installation soon.

Works fine there.

Offline

#32 2017-04-09 00:50:04

mufeed2000
Member
Registered: 2017-04-05
Posts: 22

Re: [kind-of-SOLVED] dict is slow and uses network unnecessarily

Well, tbh, i'm not sure about anything.
Manual config changes didn't help at all.
Also the fact that it did once work well for me.
While dictd was running, dict would look up localhost and give the definition from localhost BUT it would take longer time than the instantaneous reply that it would normally give. However, when i turn off Wi-Fi, I get the instantaneous reply that was usual for dict. Turning it back on slows dict down again.
Yes. dict.conf SHOULD be untouched and it is. But the configuration is now being loaded from elsewhere.

dict -d wn word -v
Configuration file:
   server localhost
1 definition found

From WordNet (r) 3.1 (2011) [wn]:
...
cat /etc/dict/dict.conf
server 127.0.0.1
server localhost

Is there any way to clear all config for an application? Like factory reset maybe?

Offline

#33 2017-04-09 01:21:14

respiranto
Member
Registered: 2015-05-15
Posts: 479
Website

Re: [kind-of-SOLVED] dict is slow and uses network unnecessarily

mufeed2000 wrote:

Well, tbh, i'm not sure about anything.
Manual config changes didn't help at all.
Also the fact that it did once work well for me.
While dictd was running, dict would look up localhost and give the definition from localhost BUT it would take longer time than the instantaneous reply that it would normally give. However, when i turn off Wi-Fi, I get the instantaneous reply that was usual for dict. Turning it back on slows dict down again.
Yes. dict.conf SHOULD be untouched and it is. But the configuration is now being loaded from elsewhere.

dict -d wn word -v
Configuration file:
   server localhost
1 definition found

From WordNet (r) 3.1 (2011) [wn]:
...

dict only tells you here, that the configuration file's (not commented) content is `server localhost', there are still the mentioned hard-coded fallback values. You can find out the actual answer's source by issuing `dict -I' (That's a capital i).
However, this still does not explain, why the answer was immediate (i.e. from localhost) when off-line. It appears like dict preferred the remote server over yours, which should not be the case, regarding your configuration file.

I just noted, that localhost was resolved to ::1 instead of 127.0.0.1 on your machine. Running `dict -h ::1 -I' fails on my machine. Since the failing configuration apparently only had `server localhost', this might be the culprit. Possibly the line `server 127.0.0.1' eliminated it.

Is there any way to clear all config for an application? Like factory reset maybe?

Unfortunately I know of no simpler option than the following.

$ pacman -Rn pkg && pacman -S pkg

Last edited by respiranto (2017-04-09 01:22:22)

Offline

#34 2017-04-09 01:39:33

mufeed2000
Member
Registered: 2017-04-05
Posts: 22

Re: [kind-of-SOLVED] dict is slow and uses network unnecessarily

The line saying server 127.0.0.1 didn't fix anything. I had tried it earlier and it hadn't worked. sad
I'm going to try and reset dict, dictd and dict-wn. But last time i used pacman's '-Rn', it still left behind files. So, might not work well enough.
I'm still at a loss as to what the actual issue is.
It is, as you said, not truly resolved.

EDIT: It seems the file loaded instead of /etc/dict/dict.conf is ~/.dictrc. Any idea what created that?

Last edited by mufeed2000 (2017-04-09 04:02:06)

Offline

#35 2017-04-09 04:13:59

mufeed2000
Member
Registered: 2017-04-05
Posts: 22

Re: [kind-of-SOLVED] dict is slow and uses network unnecessarily

I tried doing -Rn and then -S. dict worked as it should have. It must be the .dictrc, there's no other explanation. sad

Offline

#36 2017-04-09 19:52:39

respiranto
Member
Registered: 2015-05-15
Posts: 479
Website

Re: [kind-of-SOLVED] dict is slow and uses network unnecessarily

Never thought of a local config-file, even though its existence makes perfectly sense. Surely it has been the culprit.

dict should not create it, however. That must have been yourself or some script or other program (such as a graphical frontend) you ran.

PS: Would you mind changing the note you left on the AUR page in order to reflect the new situation?

Last edited by respiranto (2017-04-09 19:54:49)

Offline

#37 2017-04-10 11:19:40

mufeed2000
Member
Registered: 2017-04-05
Posts: 22

Re: [kind-of-SOLVED] dict is slow and uses network unnecessarily

ok. sorry. Thanks for all the work.

Offline

Board footer

Powered by FluxBB