[SOLVED] Reflector Simple bug

Looking at here : https://endeavouros.com/docs/pacman/a-gui-for-selecting-arch-mirrors/ I attempted to use reflector-simple. However, it dumps with an error message, most likely created because my country has a space in it’s name (New Zealand)

reflector-simple
usage: Reflector.py [-h] [--connection-timeout n] [--list-countries]
                    [--cache-timeout n] [--save <filepath>]
                    [--sort {age,rate,country,score,delay}] [--threads n]
                    [--verbose] [--info] [-a n] [-c <country>] [-f n]
                    [-i <regex>] [-x <regex>] [-l n] [--score n] [-n n]
                    [-p <protocol>] [--completion-percent [0-100]] [--isos]
                    [--ipv4] [--ipv6]
Reflector.py: error: unrecognized arguments: Zealand

Works here. This is the output:

################################################################################
################# Arch Linux mirrorlist generated by Reflector #################
################################################################################
# With:       reflector -c NZ --protocol https --age 8 --sort rate --number 10 --save /tmp/tmp.2tY0hBhbB4
# When:       2020-03-11 20:00:39 UTC
# From:       https://www.archlinux.org/mirrors/status/json/
# Retrieved:  2020-03-11 19:57:31 UTC
# Last Check: 2020-03-11 19:24:51 UTC

## New Zealand
Server = https://mirror.smith.geek.nz/archlinux/$repo/os/$arch

What is your version of reflector-simple?

pacman -Q reflector-simple

pacman -Q reflector-simple
reflector-simple 1.2.1-1

That is the correct version.
Is it possible that you have special settings for the reflector command?
Could you show the output of commands:

pacman -Q reflector
type reflector

[onyx@onyx-pc ~]$ pacman -Q reflector
reflector 2019.10-2
[onyx@onyx-pc ~]$ type reflector
reflector is /usr/bin/reflector
[onyx@onyx-pc ~]$ cat /etc/reflector-auto.conf
-c New Zealand -c Australia -f 15 -p https -a 2

Seems like you are using /etc/reflector-auto.conf, and it has an error how the country is given.
It should be like

   -c "New Zealand" -c Australia -f 15 -p https -a 2

or

   -c NZ -c Australia -f 15 -p https -a 2

Hope this helps.

Thanks, Manuel.

after running reflector first, then running reflector-simple, it has stopped bombing out with the error above.
Nothing changed in the reflector-auto.conf! No other files touched manually.
Very strange.

Can you show a picture of your selections in the reflector-simple window?
By default it is not using reflector-auto.conf.

Worldwide, Australia, HTTP
->OK

It is not persistent, in that I must select these each time, otherwise it is just New Zealand and https checked.

The defaults are by design to keep this app simple.

In the picture you don’t have reflector-auto.conf selected (which is OK if that is the way you want).

Actually, also reflector fails with country names that have spaces if the name is not surrounded by quotes.

EDIT: the persistent options can be stored in file /etc/reflector-auto.conf (although you’ll see them only in the resulting mirrorlist file).

Aha! So yes, I must have clicked to do the reflector-auto.conf in the first instance, as I can get a failure again, by choosing that. Thanks, mystery solved.
Therefore it does come down to the reflector-auto.conf being badly formatted ( though I had no idea how, as I never knew it existed until venturing down this rabbit hole! )
So I edited that file, and went back to do reflector-simple, chose only reflector-auto.conf, and got the following :

[onyx@onyx-pc ~]$ cat  /etc/reflector-auto.conf 
-c "New Zealand" -c Worlwide -c Australia -f 15 -p https -a 2
[onyx@onyx-pc ~]$ cat /etc/pacman.d/mirrorlist
################################################################################
################# Arch Linux mirrorlist generated by Reflector #################
################################################################################
# With:       reflector -c NZ --protocol https -c NZ -c Worlwide -c Australia -f 15 -p https -a 2 --age 2 --sort rate --number 10 --save /tmp/tmp.1xWLgjIE04
# When:       2020-03-11 21:49:22 UTC
# From:       https://www.archlinux.org/mirrors/status/json/
# Retrieved:  2020-03-11 21:49:00 UTC
# Last Check: 2020-03-11 21:29:56 UTC

## New Zealand
Server = https://mirror.smith.geek.nz/archlinux/$repo/os/$arch
[onyx@onyx-pc ~]$ 

Is that correct? It seems to ignore the Australia and Worldwide in building the mirrorlist?

EDIT: Doh! i missed a d in worldwide, let’s check that again…

NOT choosing reflector-auto.conf works.

1 Like

Interesting. I must check why choosing reflector-auto.conf causes this behavior.
Thanks for reporting it!

1 Like

The issue about using file /etc/reflector-auto.conf was found.
This is now fixed in reflector-simple version 1.3-1.

Thanks again for the report! :smile:

3 Likes