Pacman-mirrors Interactive mode brocken #123

Closed
opened 2018-03-08 13:26:47 +00:00 by philm · 22 comments
philm commented 2018-03-08 13:26:47 +00:00 (Migrated from gitlab2.manjaro.org)

Created by: scachemaille

I just tried
sudo pacman-mirros -i
and it seems broken.
I have the following error:

   0.339 Germany        : https://mirror.philpot.de/manjaro/
   0.134 Germany        : http://mirror.philpot.de/manjaro/
Traceback (most recent call last):
  File "/usr/bin/pacman-mirrors", line 57, in <module>
    pm.run()
  File "/usr/lib/python3.6/site-packages/pacman_mirrors/pacman_mirrors.py", line 912, in run
    self.build_interactive_mirror_list()
  File "/usr/lib/python3.6/site-packages/pacman_mirrors/pacman_mirrors.py", line 609, in build_interactive_mirror_list
    self.default)
  File "/usr/lib/python3.6/site-packages/pacman_mirrors/dialogs/graphicalui.py", line 160, in run
    window = GraphicalUI(server_list, random, default)
  File "/usr/lib/python3.6/site-packages/pacman_mirrors/dialogs/graphicalui.py", line 54, in __init__
    "{}h {}m".format(server["last_sync"][:2],
TypeError: 'int' object is not subscriptable

pacman-mirrors 4.7.5-1

*Created by: scachemaille* I just tried `sudo pacman-mirros -i` and it seems broken. I have the following error: ``` 0.339 Germany : https://mirror.philpot.de/manjaro/ 0.134 Germany : http://mirror.philpot.de/manjaro/ Traceback (most recent call last): File "/usr/bin/pacman-mirrors", line 57, in <module> pm.run() File "/usr/lib/python3.6/site-packages/pacman_mirrors/pacman_mirrors.py", line 912, in run self.build_interactive_mirror_list() File "/usr/lib/python3.6/site-packages/pacman_mirrors/pacman_mirrors.py", line 609, in build_interactive_mirror_list self.default) File "/usr/lib/python3.6/site-packages/pacman_mirrors/dialogs/graphicalui.py", line 160, in run window = GraphicalUI(server_list, random, default) File "/usr/lib/python3.6/site-packages/pacman_mirrors/dialogs/graphicalui.py", line 54, in __init__ "{}h {}m".format(server["last_sync"][:2], TypeError: 'int' object is not subscriptable ``` pacman-mirrors 4.7.5-1
philm commented 2018-03-08 13:58:44 +00:00 (Migrated from gitlab2.manjaro.org)

Created by: Skycoder42

Can confirm this with 4.7.6-2 as well. It's excatly the same error.

*Created by: Skycoder42* Can confirm this with 4.7.6-2 as well. It's excatly the same error.
philm commented 2018-03-16 21:10:55 +00:00 (Migrated from gitlab2.manjaro.org)

Created by: petsam

Same error
Version 4.7.6

*Created by: petsam* Same error Version 4.7.6
philm commented 2018-03-19 06:43:20 +00:00 (Migrated from gitlab2.manjaro.org)

Created by: fhdk

File "/usr/lib/python3.6/site-packages/pacman_mirrors/dialogs/graphicalui.py", line 54, in __init__
    "{}h {}m".format(server["last_sync"][:2]

This lead me to think that some data is missing in the status.json file.

Under which conditions does the error occur?

When the error occurs what is the content of custom-mirrors.json (if any) and status.json from /var/lib/pacman-mirrors?

I cant reproduce it.

pacman-mirrors-interactive

*Created by: fhdk* ``` File "/usr/lib/python3.6/site-packages/pacman_mirrors/dialogs/graphicalui.py", line 54, in __init__ "{}h {}m".format(server["last_sync"][:2] ``` This lead me to think that some data is missing in the `status.json` file. Under which conditions does the error occur? When the error occurs what is the content of `custom-mirrors.json` (if any) and `status.json` from `/var/lib/pacman-mirrors`? I cant reproduce it. ![pacman-mirrors-interactive](https://user-images.githubusercontent.com/22748698/37581498-2e893730-2b49-11e8-90ac-7dd139b89566.png)
philm commented 2018-03-19 10:11:21 +00:00 (Migrated from gitlab2.manjaro.org)

Created by: Skycoder42

Here are my files, right after running sudo pacmam-mirrors -i. I also added pacman-mirrors.conf.

*Created by: Skycoder42* Here are my files, right after running `sudo pacmam-mirrors -i`. I also added `pacman-mirrors.conf`. - [pacman-mirrors.conf](https://github.com/manjaro/pacman-mirrors/files/1824538/pacman-mirrors.conf.txt) - [custom-mirrors.json](https://github.com/manjaro/pacman-mirrors/files/1824534/custom-mirrors.json.txt) - [status.json](https://github.com/manjaro/pacman-mirrors/files/1824535/status.json.txt)
philm commented 2018-03-19 14:09:54 +00:00 (Migrated from gitlab2.manjaro.org)

Created by: fhdk

Your pacman-mirrors.conf contains invalid settings. The current valid configuration is here

The other files is OK.

Using the command mentioned in OP

sudo pacman-mirrors -i

I cannot reproduce the issue. Not even with a full mirror pool. (pacman-mirrors -c all)

*Created by: fhdk* Your `pacman-mirrors.conf` contains invalid settings. The current valid configuration is [here](https://github.com/manjaro/pacman-mirrors/blob/master/conf/pacman-mirrors.conf) The other files is OK. Using the command mentioned in OP sudo pacman-mirrors -i I cannot reproduce the issue. Not even with a full mirror pool. (`pacman-mirrors -c all`)
philm commented 2018-03-19 14:35:41 +00:00 (Migrated from gitlab2.manjaro.org)

Created by: petsam

My pacman-mirrors.conf

##
#/etc/pacman-mirrors.conf
##

#Branch Pacman should use (stable, testing, unstable)
Branch = testing

#Generation method
#1) rank   - rank mirrors depending on their access time
#2) random - randomly generate the output mirrorlist
Method = rank

#Define protocols and priority
#  separated by comma 'https,http' or 'http,https'
#ATM available protocols are: http, https, ftp
#Not specifying a protocol will ban the protocol from being used
#If a mirror has more than one protocol defined only the first is written to the mirrorlist
#Empty means all in reversed alphabetic order
Protocols =

#Get a list of all available counties with 'pacman-mirrors -l'
#Value can be 'Custom' or nothing which means all
# OnlyCountry = 

#When set to False - all certificates are accepted.
#Use only if you fully trust all ssl-enabled mirrors.
SSLVerify = True
*Created by: petsam* My `pacman-mirrors.conf` ``` ## #/etc/pacman-mirrors.conf ## #Branch Pacman should use (stable, testing, unstable) Branch = testing #Generation method #1) rank - rank mirrors depending on their access time #2) random - randomly generate the output mirrorlist Method = rank #Define protocols and priority # separated by comma 'https,http' or 'http,https' #ATM available protocols are: http, https, ftp #Not specifying a protocol will ban the protocol from being used #If a mirror has more than one protocol defined only the first is written to the mirrorlist #Empty means all in reversed alphabetic order Protocols = #Get a list of all available counties with 'pacman-mirrors -l' #Value can be 'Custom' or nothing which means all # OnlyCountry = #When set to False - all certificates are accepted. #Use only if you fully trust all ssl-enabled mirrors. SSLVerify = True ```
philm commented 2018-03-19 14:55:42 +00:00 (Migrated from gitlab2.manjaro.org)

Created by: fhdk

@Skycoder42

right after running sudo pacmam-mirrors -i

Could you copy status.json and custom-mirrors.json before you it?

*Created by: fhdk* @Skycoder42 >right after running sudo pacmam-mirrors -i Could you copy `status.json` and `custom-mirrors.json` before you it?
philm commented 2018-03-19 15:03:37 +00:00 (Migrated from gitlab2.manjaro.org)

Created by: fhdk

@Skycoder42
Are you running on Wayland?

Is it on TTY?

*Created by: fhdk* @Skycoder42 Are you running on Wayland? Is it on TTY?
philm commented 2018-03-19 16:55:48 +00:00 (Migrated from gitlab2.manjaro.org)

Created by: xircon

Same error. Plasma xorg.
first.zip
second.zip

First - before interactive
Second - After.

*Created by: xircon* Same error. Plasma xorg. [first.zip](https://github.com/manjaro/pacman-mirrors/files/1825984/first.zip) [second.zip](https://github.com/manjaro/pacman-mirrors/files/1825985/second.zip) First - before interactive Second - After.
philm commented 2018-03-19 17:04:18 +00:00 (Migrated from gitlab2.manjaro.org)

Created by: xircon

Just updated to pacman-mirrors-4.8.1-3 - still crashing in interactive mode.

*Created by: xircon* Just updated to pacman-mirrors-4.8.1-3 - still crashing in interactive mode.
philm commented 2018-03-19 17:08:09 +00:00 (Migrated from gitlab2.manjaro.org)

Created by: fhdk

@xircon
Could you post the error message from 4.8.1-3?

*Created by: fhdk* @xircon Could you post the error message from 4.8.1-3?
philm commented 2018-03-19 17:11:14 +00:00 (Migrated from gitlab2.manjaro.org)

Created by: commonsourcecs

v. 4.7.6-2
Failing for me with this return:

Traceback (most recent call last):
  File "/usr/bin/pacman-mirrors", line 57, in <module>
    pm.run()
  File "/usr/lib/python3.6/site-packages/pacman_mirrors/pacman_mirrors.py", line 912, in run
    self.build_interactive_mirror_list()
  File "/usr/lib/python3.6/site-packages/pacman_mirrors/pacman_mirrors.py", line 609, in build_interactive_mirror_list
    self.default)
  File "/usr/lib/python3.6/site-packages/pacman_mirrors/dialogs/graphicalui.py", line 160, in run
    window = GraphicalUI(server_list, random, default)
  File "/usr/lib/python3.6/site-packages/pacman_mirrors/dialogs/graphicalui.py", line 54, in __init__
    "{}h {}m".format(server["last_sync"][:2],
TypeError: 'int' object is not subscriptable

pacman-mirrors.tar.gz
I had run '-i' before creating the first archive already, but here is one after command fail again:
pacman-mirrors2.tar.gz

*Created by: commonsourcecs* v. 4.7.6-2 Failing for me with this return: ``` Traceback (most recent call last): File "/usr/bin/pacman-mirrors", line 57, in <module> pm.run() File "/usr/lib/python3.6/site-packages/pacman_mirrors/pacman_mirrors.py", line 912, in run self.build_interactive_mirror_list() File "/usr/lib/python3.6/site-packages/pacman_mirrors/pacman_mirrors.py", line 609, in build_interactive_mirror_list self.default) File "/usr/lib/python3.6/site-packages/pacman_mirrors/dialogs/graphicalui.py", line 160, in run window = GraphicalUI(server_list, random, default) File "/usr/lib/python3.6/site-packages/pacman_mirrors/dialogs/graphicalui.py", line 54, in __init__ "{}h {}m".format(server["last_sync"][:2], TypeError: 'int' object is not subscriptable ``` [pacman-mirrors.tar.gz](https://github.com/manjaro/pacman-mirrors/files/1826040/pacman-mirrors.tar.gz) I had run '-i' before creating the first archive already, but here is one after command fail again: [pacman-mirrors2.tar.gz](https://github.com/manjaro/pacman-mirrors/files/1826056/pacman-mirrors2.tar.gz)
philm commented 2018-03-19 17:20:19 +00:00 (Migrated from gitlab2.manjaro.org)

Created by: fhdk

@xircon
@commonsourcecs

That is most weird - that code does not existin 4.8.1

File "/usr/lib/python3.6/site-packages/pacman_mirrors/dialogs/graphicalui.py", line 54, in __init__
    "{}h {}m".format(server["last_sync"][:2],

github.com/manjaro/pacman-mirrors@0ab1f1c438/pacman_mirrors/dialogs/graphicalui.py (L49-L58)

*Created by: fhdk* @xircon @commonsourcecs That is most weird - that code does not existin 4.8.1 ``` File "/usr/lib/python3.6/site-packages/pacman_mirrors/dialogs/graphicalui.py", line 54, in __init__ "{}h {}m".format(server["last_sync"][:2], ``` https://github.com/manjaro/pacman-mirrors/blob/0ab1f1c438eeed43fa96616d3e07c2deff9e75bc/pacman_mirrors/dialogs/graphicalui.py#L49-L58
philm commented 2018-03-19 17:57:14 +00:00 (Migrated from gitlab2.manjaro.org)

Created by: commonsourcecs

Found source for me.
'-i' fails when there is any discrepancy in the list. In my region/list, there is one mirror currently Timed Out.
To test, I switched to Netherlands (all mirrors active and synced to Testing). Then ran '-i' on its own again.
That worked.

*Created by: commonsourcecs* Found source for me. '-i' fails when there is any discrepancy in the list. In my region/list, there is one mirror currently Timed Out. To test, I switched to Netherlands (all mirrors active and synced to Testing). Then ran '-i' on its own again. That worked.
philm commented 2018-03-19 18:00:34 +00:00 (Migrated from gitlab2.manjaro.org)

Created by: xircon

Had to nip out - 4.8.1-5 same problems - do you want the zip?

*Created by: xircon* Had to nip out - 4.8.1-5 same problems - do you want the zip?
philm commented 2018-03-19 18:01:50 +00:00 (Migrated from gitlab2.manjaro.org)

Created by: xircon

Yes, mirror times out:

   0.213 Germany        : https://mirror.netcologne.de/manjaro/
   ..... Germany        : https://repo.rhindon.net/manjaro/
   ..... Germany        : https://repo.stdout.net/manjaro/
.: ERROR [Errno -2] Name or service not known 'https://repo.stdout.net/manjaro/'

Could be the problem?

*Created by: xircon* Yes, mirror times out: ``` 0.213 Germany : https://mirror.netcologne.de/manjaro/ ..... Germany : https://repo.rhindon.net/manjaro/ ..... Germany : https://repo.stdout.net/manjaro/ .: ERROR [Errno -2] Name or service not known 'https://repo.stdout.net/manjaro/' ``` Could be the problem?
philm commented 2018-03-19 18:04:15 +00:00 (Migrated from gitlab2.manjaro.org)

Created by: bogdancovaciu

Hello,
Finally i'm here too, even if i feel that is way too overwhelming. Here are the files you requested on manjaro forum:
pacman_mirrors_1.zip
pacman_mirrors_2.zip

Are in the order you requested and hopefully helpful!

*Created by: bogdancovaciu* Hello, Finally i'm here too, even if i feel that is way too overwhelming. Here are the files you requested on manjaro forum: [pacman_mirrors_1.zip](https://github.com/manjaro/pacman-mirrors/files/1826288/pacman_mirrors_1.zip) [pacman_mirrors_2.zip](https://github.com/manjaro/pacman-mirrors/files/1826289/pacman_mirrors_2.zip) Are in the order you requested and hopefully helpful!
philm commented 2018-03-19 18:09:13 +00:00 (Migrated from gitlab2.manjaro.org)

Created by: commonsourcecs

4.8.1-1 also
Confirmed that '-i' fails with list containing 'Timed Out' mirrors but succeeds on list without.
This can also be mitigated for lists with bad mirror, as long as another option is passed such as using -ic. It would appear -i needs help sorting or making sense of oddities in the list.
(while simple '-a' seems deprecated now, '--api' or '-B' no longer works in 4.8.1-1 though)

*Created by: commonsourcecs* 4.8.1-1 also Confirmed that '-i' fails with list containing 'Timed Out' mirrors but succeeds on list without. This can also be mitigated for lists with bad mirror, as long as another option is passed such as using -ic. It would appear -i needs help sorting or making sense of oddities in the list. (while simple '-a' seems deprecated now, '--api' or '-B' no longer works in 4.8.1-1 though)
philm commented 2018-03-19 18:26:58 +00:00 (Migrated from gitlab2.manjaro.org)

Created by: fhdk

Yes - the api is my bad - I added some checks for any api related argument eg -B without the actual --api present - and it failed me. This has been corrected.

*Created by: fhdk* Yes - the api is my bad - I added some checks for any api related argument eg -B without the actual `--api` present - and it failed me. This has been corrected.
philm commented 2018-03-19 19:37:24 +00:00 (Migrated from gitlab2.manjaro.org)

Created by: Skycoder42

With version Version 4.8.1dev (4.8.1-6) the error message has changed a little:

Traceback (most recent call last):
  File "/usr/bin/pacman-mirrors", line 57, in <module>
    pm.run()
  File "/usr/lib/python3.6/site-packages/pacman_mirrors/pacman_mirrors.py", line 853, in run
    self.build_interactive_mirror_list()
  File "/usr/lib/python3.6/site-packages/pacman_mirrors/pacman_mirrors.py", line 585, in build_interactive_mirror_list
    interactive_list = mirrorFn.translate_pool_to_interactive(worklist)
  File "/usr/lib/python3.6/site-packages/pacman_mirrors/mirrors/mirrorFn.py", line 207, in translate_pool_to_interactive
    "last_sync": "{}h {}m".format(mirror["last_sync"][:2].replace(":", ""),
TypeError: 'int' object is not subscriptable

EDIT: I too have the mirror that times out. After removing the mirror from the custom-mirrors.json (or removing the file) it worked again (The speedtest before still tests the broken mirror, but as it is not the custom-mirrors.json it works fine). Note: The entry hat -1 for all 3 branches, so it was easy to find.

@fhdk Im using kwin with X11, not wayland. And yes, it's a normal graphical console, aka a tty. But as it seems the reson is are the broken custom mirrors.

*Created by: Skycoder42* With version `Version 4.8.1dev` (4.8.1-6) the error message has changed a little: ``` Traceback (most recent call last): File "/usr/bin/pacman-mirrors", line 57, in <module> pm.run() File "/usr/lib/python3.6/site-packages/pacman_mirrors/pacman_mirrors.py", line 853, in run self.build_interactive_mirror_list() File "/usr/lib/python3.6/site-packages/pacman_mirrors/pacman_mirrors.py", line 585, in build_interactive_mirror_list interactive_list = mirrorFn.translate_pool_to_interactive(worklist) File "/usr/lib/python3.6/site-packages/pacman_mirrors/mirrors/mirrorFn.py", line 207, in translate_pool_to_interactive "last_sync": "{}h {}m".format(mirror["last_sync"][:2].replace(":", ""), TypeError: 'int' object is not subscriptable ``` **EDIT:** I too have the mirror that times out. After removing the mirror from the `custom-mirrors.json` (or removing the file) it worked again (The speedtest before still tests the broken mirror, but as it is not the custom-mirrors.json it works fine). Note: The entry hat `-1` for all 3 branches, so it was easy to find. @fhdk Im using kwin with X11, not wayland. And yes, it's a normal graphical console, aka a tty. But as it seems the reson is are the broken custom mirrors.
philm commented 2018-03-19 19:45:24 +00:00 (Migrated from gitlab2.manjaro.org)

Created by: fhdk

The issue has been solved with the release of 4.8.2

*Created by: fhdk* The issue has been solved with the release of 4.8.2
philm commented 2018-03-19 19:50:11 +00:00 (Migrated from gitlab2.manjaro.org)

Created by: commonsourcecs

4.8.2-2

Traceback (most recent call last):
  File "/usr/bin/pacman-mirrors", line 57, in <module>
    pm.run()
  File "/usr/lib/python3.6/site-packages/pacman_mirrors/pacman_mirrors.py", line 853, in run
    self.build_interactive_mirror_list()
  File "/usr/lib/python3.6/site-packages/pacman_mirrors/pacman_mirrors.py", line 585, in build_interactive_mirror_list
    interactive_list = mirrorFn.translate_pool_to_interactive(worklist)
  File "/usr/lib/python3.6/site-packages/pacman_mirrors/mirrors/mirrorFn.py", line 213, in translate_pool_to_interactive
    "last_sync": "{}h {}m".format(mirror["last_sync"][:2].replace(":", ""),
TypeError: 'int' object is not subscriptable
*Created by: commonsourcecs* 4.8.2-2 ``` Traceback (most recent call last): File "/usr/bin/pacman-mirrors", line 57, in <module> pm.run() File "/usr/lib/python3.6/site-packages/pacman_mirrors/pacman_mirrors.py", line 853, in run self.build_interactive_mirror_list() File "/usr/lib/python3.6/site-packages/pacman_mirrors/pacman_mirrors.py", line 585, in build_interactive_mirror_list interactive_list = mirrorFn.translate_pool_to_interactive(worklist) File "/usr/lib/python3.6/site-packages/pacman_mirrors/mirrors/mirrorFn.py", line 213, in translate_pool_to_interactive "last_sync": "{}h {}m".format(mirror["last_sync"][:2].replace(":", ""), TypeError: 'int' object is not subscriptable ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
applications/pacman-mirrors#123
No description provided.