You are not logged in.

#1 2012-07-01 00:16:48

Vladder
Member
From: España
Registered: 2012-01-21
Posts: 13

Reflector has stopped working with sudo.

Hi, I have an alias created in my .bashrc file to update my archlinux, use reflector on it as follows ...

alias u="sudo reflector --sort rate -l 10 -f 5 --save /etc/pacman.d/mirrorlist && yaourt -Syyu --aur"

By upgrading reflector recently, it has stopped working with sudo. If I do run as root it works well, but if I run with sudo ...

yuki ~  $  u
Contraseña: 
Traceback (most recent call last):
  File "/usr/bin/reflector", line 5, in <module>
    Reflector.main()
  File "/usr/lib/python3.2/site-packages/Reflector.py", line 515, in main
    ms, mirrors = process_options(options)
  File "/usr/lib/python3.2/site-packages/Reflector.py", line 474, in process_options
    mirrors = ms.get_mirrors()
  File "/usr/lib/python3.2/site-packages/Reflector.py", line 189, in get_mirrors
    return self.get_obj()['urls']
  File "/usr/lib/python3.2/site-packages/Reflector.py", line 182, in get_obj
    self.retrieve()
  File "/usr/lib/python3.2/site-packages/Reflector.py", line 124, in retrieve
    cache_file = get_cache_home('mirrorstatus.json')
  File "/usr/lib/python3.2/site-packages/Reflector.py", line 32, in get_cache_home
    path = os.path.join(require_path('HOME'), '.cache')
NameError: global name 'require_path' is not defined

I have tried to find a solution to the final error (I think that's the problem) but I have not managed to fix it
Can anyone help?
Thank you. A greeting.

Offline

#2 2012-07-01 01:56:20

doug piston
Member
From: Seattle
Registered: 2011-09-11
Posts: 387
Website

Re: Reflector has stopped working with sudo.

I can report the same here.

I just updated minutes ago with this error

resolving dependencies...
looking for inter-conflicts...

Targets (1): reflector-2012.6.30-1

Total Installed Size:   0.09 MiB
Net Upgrade Size:       0.02 MiB

Proceed with installation? [Y/n] y
(1/1) checking package integrity                                        [----------------------------------------] 100%
(1/1) loading package files                                             [----------------------------------------] 100%
(1/1) checking for file conflicts                                       [----------------------------------------] 100%
error: failed to commit transaction (conflicting files)
reflector: /usr/lib/python3.2/site-packages/__pycache__/Reflector.cpython-32.pyc exists in filesystem
Errors occurred, no packages were upgraded.

So I rm'd /usr/lib/python3.2/site-packages/__pycache__/Reflector.cpython-32.pyc (possibly not the smartest idea) but upgrade went through. Ran reflector and now have same error as OP. In 'su' works as intended.

Not helpful I know but thought I would add some info.

Cheers.

Last edited by doug piston (2012-07-01 01:57:03)

Offline

#3 2012-07-01 02:16:01

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,965
Website

Re: Reflector has stopped working with sudo.

Culpa mea. It should be fixed in the newest version.

You can get it from my repo right now or wait for your mirror to synchronize.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#4 2012-07-01 02:23:34

doug piston
Member
From: Seattle
Registered: 2011-09-11
Posts: 387
Website

Re: Reflector has stopped working with sudo.

You sir, are a gentleman and a scholar. Thanks. smile

Offline

#5 2012-07-01 10:26:26

Vladder
Member
From: España
Registered: 2012-01-21
Posts: 13

Re: Reflector has stopped working with sudo.

Now, reflector works fine already. Thank you.

Cheers. ;-)

Offline

#6 2012-07-01 14:01:32

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: Reflector has stopped working with sudo.

Please mark as [solved]. Thanks. smile


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#7 2012-07-01 21:27:24

viking60
Member
From: Valhalla
Registered: 2010-08-02
Posts: 95
Website

Re: Reflector has stopped working with sudo.

Hm I have not been able to find any repo where this is fixed yet:

feil: kunne ikke utføre transaksjon (motstridende filer)
reflector: /usr/lib/python3.2/site-packages/__pycache__/Reflector.cpython-32.pyc finnes i filsystemet
Feil oppstod, ingen pakker ble oppgradert.

What repo are you using?


"Common sense is not common"

Offline

#8 2012-07-02 00:07:00

KLIM
Member
Registered: 2010-11-18
Posts: 33

Re: Reflector has stopped working with sudo.

So what are the solution here?

Should we

rm /usr/lib/python3.2/site-packages/__pycache__/Reflector.cpython-32.pyc

Or wait for the mirrors to sync?

Offline

#9 2012-07-02 03:26:12

loafer
Member
From: the pub
Registered: 2009-04-14
Posts: 1,772

Re: Reflector has stopped working with sudo.

Please see Xyne's post.


All men have stood for freedom...
For freedom is the man that will turn the world upside down.
Gerrard Winstanley.

Offline

#10 2012-07-02 12:51:05

SanskritFritz
Member
From: Budapest, Hungary
Registered: 2009-01-08
Posts: 1,928
Website

Re: Reflector has stopped working with sudo.

loafer, I don't think Xyne was talking about the Reflector.cpython-32.pyc file problem, but rather about the sudo one. So with the risk of hijacking the thread, the question remains: how should we install the newest reflector with this file conflict? Is this a sign of a problem or can be neglected by using the --force?

My mirror seems up-to-date:

community/reflector 2012.7.1-1 [installed: 2012.3.26-1]
xyne-any/reflector 2012.7.1-1 [installed: 2012.3.26-1]

error: failed to commit transaction (conflicting files)
reflector: /usr/lib/python3.2/site-packages/__pycache__/Reflector.cpython-32.pyc exists in filesystem


zʇıɹɟʇıɹʞsuɐs AUR || Cycling in Budapest with a helmet camera || Revised log levels proposal: "FYI" "WTF" and "OMG" (John Barnette)

Offline

#11 2012-07-02 13:00:49

Psykorgasm
Member
Registered: 2011-11-24
Posts: 178

Re: Reflector has stopped working with sudo.

Well, I just forced the reflector update (before the sudo problem update came out) and it didn't break and the sudo fix/update didnt throw the same error and works fine now, I'd assume it's safe to force the package in this case.

Offline

#12 2012-07-02 16:29:06

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,965
Website

Re: Reflector has stopped working with sudo.

The .pyc error is unrelated. I don't actually know why those occasionally leak in to the filesystem. I'll look into it and release an update when I have a solution.

Last edited by Xyne (2012-07-02 16:29:36)


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#13 2012-07-02 17:33:16

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,965
Website

Re: Reflector has stopped working with sudo.

Ok, I've just looked through all of my Python packages. Aside from still using the "build" function instead of the "package" function (which has now been corrected), they all follow the Python packaging guidelines, i.e. they use setup.py with "--optimize=1" to generate .pyc files.

I haven't changed those functions in ages so I really don't know why the previous reflector package failed to track the .pyc file. Regardless, I have just updated all of my own packages and checked for conflicts. There were none.

If the conflict persists, please post the output of "pacman -Qi reflector; pacman -Ql reflector".

Last edited by Xyne (2012-07-02 17:33:40)


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#14 2012-07-02 18:15:53

wrarus
Member
Registered: 2010-12-14
Posts: 2

Re: Reflector has stopped working with sudo.

(31/31) checking for file conflicts                                                             [########################################################] 100%
error: failed to commit transaction (conflicting files)
reflector: /usr/lib/python3.2/site-packages/__pycache__/Reflector.cpython-32.pyc exists in filesystem
Errors occurred, no packages were upgraded.

[walt@athlonx2 ~]$ pacman -Qi reflector;pacman -Ql reflector
Name           : reflector
Version        : 2012.3.26-1
URL            : http://xyne.archlinux.ca/projects/reflector
Licenses       : GPL
Groups         : None
Provides       : None
Depends On     : python3
Optional Deps  : None
Required By    : None
Conflicts With : None
Replaces       : None
Installed Size :  76.00 KiB
Packager       : Xyne
Architecture   : any
Build Date     : Mon 26 Mar 2012 06:02:28 AM EDT
Install Date   : Wed 28 Mar 2012 04:33:45 PM EDT
Install Reason : Explicitly installed
Install Script : No
Description    : A Python 3 module and script to retrieve and filter the latest Pacman mirror list.

reflector /usr/
reflector /usr/bin/
reflector /usr/bin/reflector
reflector /usr/lib/
reflector /usr/lib/python3.2/
reflector /usr/lib/python3.2/site-packages/
reflector /usr/lib/python3.2/site-packages/Reflector-2012.3.26-py3.2.egg-info
reflector /usr/lib/python3.2/site-packages/Reflector.py
reflector /usr/lib/python3.2/site-packages/Reflector.pyc
reflector /usr/lib/python3.2/site-packages/Reflector.pyo

[walt@athlonx2 ~]$ pacman -Qo /usr/lib/python3.2/site-packages/__pycache__/Reflector.cpython-32.pyc
error: No package owns /usr/lib/python3.2/site-packages/__pycache__/Reflector.cpython-32.pyc

Offline

#15 2012-07-02 18:28:16

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,965
Website

Re: Reflector has stopped working with sudo.

@wrarus
Thanks.

Does anyone know if this is due to a recent Python update? It seems that the default location for byte-compiled code has changed.

Just force the update (pacman -Sf reflector") for now. Do not force a full system upgrade, only the individual package.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#16 2012-07-02 18:30:13

amsri
Member
Registered: 2011-06-17
Posts: 48

Re: Reflector has stopped working with sudo.

Same Problem here:

 (13/13) checking package integrity                 [######################] 100%
(13/13) loading package files                      [######################] 100%
(13/13) checking for file conflicts                [######################] 100%
error: failed to commit transaction (conflicting files)
reflector: /usr/lib/python3.2/site-packages/__pycache__/Reflector.cpython-32.pyc exists in filesystem
Errors occurred, no packages were upgraded.
[ashu@hplaptop ~]$ pacman -Qi reflector
Name           : reflector
Version        : 2012.3.26-1
URL            : http://xyne.archlinux.ca/projects/reflector
Licences       : GPL
Groups         : None
Provides       : None
Depends On     : python3
Optional Deps  : None
Required By    : None
Conflicts With : None
Replaces       : None
Installed Size :  76.00 KiB
Packager       : Xyne
Architecture   : any
Build Date     : Mon 26 Mar 2012 11:02:28 BST
Install Date   : Mon 26 Mar 2012 23:15:40 BST
Install Reason : Explicitly installed
Install Script : No
Description    : A Python 3 module and script to retrieve and filter the latest
                 Pacman mirror list.

[ashu@hplaptop ~]$ pacman -Ql reflector 
reflector /usr/
reflector /usr/bin/
reflector /usr/bin/reflector
reflector /usr/lib/
reflector /usr/lib/python3.2/
reflector /usr/lib/python3.2/site-packages/
reflector /usr/lib/python3.2/site-packages/Reflector-2012.3.26-py3.2.egg-info
reflector /usr/lib/python3.2/site-packages/Reflector.py
reflector /usr/lib/python3.2/site-packages/Reflector.pyc
reflector /usr/lib/python3.2/site-packages/Reflector.pyo

Offline

#17 2012-07-02 23:30:15

viking60
Member
From: Valhalla
Registered: 2010-08-02
Posts: 95
Website

Re: Reflector has stopped working with sudo.

This time it fits: Please see Xyne's post wink


"Common sense is not common"

Offline

#18 2012-07-06 03:43:45

fester
Member
Registered: 2011-02-09
Posts: 18

Re: Reflector has stopped working with sudo.

I wasn't using sudo, but I received the same error message:

 error: failed to cache JSON data ([Errno 2] No such file or directory: '/root/.cache/mirrorstatus.json')

I then tried to touch the file and I got this:

  # touch /root/.cache/mirrorstatus.json
touch: cannot touch ‘/root/.cache/mirrorstatus.json’: No such file or directory

So I mkdir ~/.cache and it worked. Somehow, it was working just fine before, but now it required a new cache directory that it didn't make.

Offline

Board footer

Powered by FluxBB