Bug 18643 - dragoraUpdate when started by normal user tries to get synthesis files - which will fail, etc
Summary: dragoraUpdate when started by normal user tries to get synthesis files - whic...
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Angelo Naselli
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-06 23:31 CEST by Morgan Leijström
Modified: 2016-06-09 07:27 CEST (History)
3 users (show)

See Also:
Source RPM: manatools-1.1.2-7.mga6.src.rpm
CVE:
Status comment:


Attachments
for comment 9 : download window not painted (122.43 KB, image/png)
2016-06-09 05:46 CEST, Morgan Leijström
Details

Description Morgan Leijström 2016-06-06 23:31:28 CEST
It cause unnecessary wait and questions...
I suggest to make it work like MageiaUpdate

Steps to Reproduce:
1. in a terminal as normal user
§ dragoraUpdate

2. There is a message window that when running as normal user it cannot make changes to the system, but it can browse the database.

3. Then it runs curl (i guess trying to retrieve synthesis files)  but it exits with errors 22 and 23 (visible in terminal - the windows are just blank and user have to wait until all downloads have failed...)

4. Updates are shown

5. If user try to update, there is a message about rights.



I think the intention is to be able to see what updates are available even when you do not have rights to do the updates, and that is nice, However that fails 

a) as it can not download synthesis files ( 3. above)

b) even if some user with rights have run some app that downloads synthesis files, at times like today when there is a meta-task update or some rpm related it wants to instal before showing other updates, only that is shown until it is updated - which such user cannot perform, so can not see other updates than than one... 

...so this feature is not working well as is.


I suggest to either

A) work like MageiaUpdate which somehow gain enough privilegies for updating by either ask for normal user password (as per default) or can be set to ask for root.

(this is probably best for both easy implementation and keep to what the ancestor do, also for documentation manual)

or

B) when started as normal user:

i)  add to the information message that it is unable to see updates unless it or other updater program has been run as root and downloaded synthesis files about available packages,

ii) skip trying getting the synthesis files

iii) grey out or hide update button.  Also there is no use for any selection boxes in list, or select all button...
Morgan Leijström 2016-06-06 23:32:23 CEST

CC: (none) => anaselli

Comment 1 Morgan Leijström 2016-06-06 23:45:21 CEST
Clarifying

at 4. above it of course only shows updates if all before have have been installed already, known by using synthesis files already downloaded earlier.

at 5. : if user select to update, packages download but then comes is a message "writing to file /var/lib/rpm/installed-through-deps.list failed: Permission denied"
Marja Van Waes 2016-06-07 14:14:35 CEST

CC: (none) => marja11, matteo.pasotti
Assignee: bugsquad => anaselli

Comment 2 Angelo Naselli 2016-06-07 15:33:13 CEST
indeed it's already implemented. "mana update" does what you asked for.
We thought that "mana" should do what all the /usr/bin/drak-xx-scripts do e.g. get the rights. Of course where we used dbus rigts are required when a specific operation is performed (such as mana clock for instance) 

The issue here is that while i found the time to disable rpmdragora buttons i didn't for mageiaUpdate. The sysntesys problem i believe that is present for both.

Will take a look asap, and if late provide an update.

Status: NEW => ASSIGNED

Comment 3 Mageia Robot 2016-06-08 16:36:21 CEST
commit 6a98d4edc26dca4620ee4773adc23e6cfbefafda
Author: Angelo Naselli <anaselli@...>
Date:   Wed Jun 8 23:34:58 2016 +0859

    mga#18643, dragoraUpdate can be run as user only with mana update
    command now
---
 Commit Link:
   http://gitweb.mageia.org/software/manatools/commit/?id=6a98d4edc26dca4620ee4773adc23e6cfbefafda
Comment 4 Angelo Naselli 2016-06-08 16:38:07 CEST
I disable dragoraUpdate if not run as root, mana update ask for user password as MageiaUpdate does.
Comment 5 Angelo Naselli 2016-06-08 16:38:49 CEST
Can you pleas test the incoming patched package?
Comment 6 Morgan Leijström 2016-06-08 22:46:43 CEST
Fixes verified in manatools-1.1.2-8 :

1)
$ dragoraUpdate -> message tells it need root privilegies and suggest to use mana update instead.

2)
$ mana update -> asks for user password, like MageiaUpdate do.

__TODO
  at 1) above, 

a) that dragoraUpdate dialog is in english (not translated to swedish)

b) clicking OK, it segfaults, output in launching terminal also show "Qt locale directory not set", circumstance i guess is same as in Bug 18653 

<ERR> [qt-ui] YQUI.cc:264 initUI(): Forcing /libQtGui.so.5 open failed
<_M_> [qt-ui] YQApplication.cc:133 loadPredefinedQtTranslations(): Selected language: sv_SE
<WRN> [qt-ui] YQApplication.cc:137 loadPredefinedQtTranslations(): Qt locale directory not set - no translations for predefined Qt dialogs
<_M_> [qt-ui] YQUI.cc:275 initUI(): YQUI initialized. Thread ID: 0x0x7fd64cbb9700
<_M_> [ui] YUILoader.cc:104 deleteUI(): Shutting down UI
Segmenteringsfel (minnesutskrift skapad)

Status: ASSIGNED => NEW

Comment 7 Angelo Naselli 2016-06-09 01:23:19 CEST
on comment#6:
a) Well now you could understand now what breaking translations during final release freezing means :) And there is not only Swedish language :p

b) There is nothing i can do. QT seg-faults on exit every (often) now and then, it's an upstream problem i opened time ago: 
https://github.com/libyui/libyui-qt/issues/41

I consider this close then :)

Status: NEW => RESOLVED
Resolution: (none) => FIXED

Comment 8 Morgan Leijström 2016-06-09 05:25:32 CEST
:)
Comment 9 Morgan Leijström 2016-06-09 05:45:10 CEST
There is a strange quirk, probably qt bug too?: sometimes the window is not drawn while downloading the synthesis files.  I it sit there for a few seconds with a grey main window ant on top of that the window that should say it is looking for updates (or somethign like that) but instead it acts like a "hole" to show content that us under the main window, see attached.

that happened now 2 of three starts of
$ mana update

the output in konsole also varies between launches

---------------8<--------------------

hämtade   media_info/MD5SUM
Use of uninitialized value in pattern match (m//) at
        /usr/lib/perl5/vendor_perl/5.22.1/urpm/media.pm line 1471 (#2)
<WRN> [ui-shortcuts] YShortcutManager.cc:85 checkShortcuts(): Not enough widgets with valid shortcut characters - no check

Argument "431k" isn't numeric in numeric eq (==) at
        /usr/lib/perl5/vendor_perl/5.22.1/urpm/download.pm line 542, <$curl> chunk 712 (#3)
    (W numeric) The indicated string was fed as an argument to an operator
    that expected a numeric value instead.  If you're fortunate the message
    will identify which operator was so unfortunate.
    
    Note that for the Inf and NaN (infinity and not-a-number) the
    definition of "numeric" is somewhat unusual: the strings themselves
    (like "Inf") are considered numeric, and anything following them is
    considered non-numeric.
    
hämtade   media_info/20160608-210107-info.xml.lzma

---------------8<--------------------

$ mana update
Subroutine getcwd redefined at
        /usr/lib/perl5/vendor_perl/5.22.1/urpm/download.pm line 13 (#1)
    (W redefine) You redefined a subroutine.  To suppress this warning, say
    
        {
            no warnings 'redefine';
            eval "sub name { ... }";
        }

---------------8<--------------------

 at /usr/lib/perl5/vendor_perl/5.22.2/ManaTools/Rpmdragora/pkg.pm line 258.
writeconf done!
<WRN> [ui-shortcuts] YShortcutManager.cc:85 checkShortcuts(): Not enough widgets with valid shortcut characters - no check
Use of uninitialized value in join or string at
        /usr/lib/perl5/vendor_perl/5.22.1/urpm/download.pm line 918 (#2)
    (W uninitialized) An undefined value was used as if it were already
    defined.  It was interpreted as a "" or a 0, but maybe it was a mistake.
    To suppress this warning assign a defined value to your variables.
    
    To help you figure out what was undefined, perl will try to tell you
    the name of the variable (if any) that was undefined.  In some cases
    it cannot do this, so it also tells you what operation you used the
    undefined value in.  Note, however, that perl optimizes your program
    and the operation displayed in the warning may not necessarily appear
    literally in your program.  For example, "that $foo" is usually
    optimized into "that " . $foo, and the warning will refer to the
    concatenation (.) operator, even though there is no . in
    your program.
    
hämtade   media_info/MD5SUM
Comment 10 Morgan Leijström 2016-06-09 05:46:40 CEST
Created attachment 7953 [details]
for comment 9 : download window not painted
Comment 11 Angelo Naselli 2016-06-09 06:16:37 CEST
yes, i think you run dragoraUpdate --gtk it should not show a frozen windows. Anyway i will check if i can avoid such a behavior by using some poll event calls.
IIUC that happens when downloading media info...

Interesting thing is Argument "431k" i will check if i can understand where we pass k instead of 000 or something like that, there is a misunderstanding in using urpm api maybe.
Comment 12 Morgan Leijström 2016-06-09 06:53:00 CEST
Yep when downloadign media info

"$ mana update --gtk" as well as "# dragoraUpdate --gtk"
works nicely (after installing manatools-gtk)

One strange detail is that they do not open that large grey main window in background like "$ mana update" (without --gtk) do, instead only show that download window.
Comment 13 Angelo Naselli 2016-06-09 07:27:55 CEST
> One strange detail is that they do not open that large grey main window in 
> background like "$ mana update" (without --gtk) do, instead only show that 
> download window.
libyui is a great project that allows to manage with the same code three UI (e.g. gtk, ncurses and qt) but to have such a feature some limitations are needed.
So yes that is one of the differences

Note You need to log in before you can comment on or make changes to this bug.