Bug 1474251 - warning: %post(wireshark-gtk-2.2.8-1.fc26.x86_64) scriptlet failed, exit status 2
warning: %post(wireshark-gtk-2.2.8-1.fc26.x86_64) scriptlet failed, exit stat...
Status: ON_QA
Product: Fedora
Classification: Fedora
Component: wireshark (Show other bugs)
27
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Martin Sehnoutka
Fedora Extras Quality Assurance
:
: 1472810 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-24 04:41 EDT by Kamil Páral
Modified: 2017-12-01 17:40 EST (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Kamil Páral 2017-07-24 04:41:03 EDT
Description of problem:

  Running scriptlet: wireshark-gtk-2.2.8-1.fc26.x86_64                                                          29/71 
  Upgrading        : wireshark-gtk-2.2.8-1.fc26.x86_64                                                          29/71 
  Running scriptlet: wireshark-gtk-2.2.8-1.fc26.x86_64                                                          29/71 
the primary link for wireshark must be /usr/sbin/wireshark
warning: %post(wireshark-gtk-2.2.8-1.fc26.x86_64) scriptlet failed, exit status 2
Non-fatal POSTIN scriptlet failure in rpm package wireshark-gtk
Non-fatal POSTIN scriptlet failure in rpm package wireshark-gtk
...
  Cleanup          : wireshark-cli-2.2.7-1.fc26.x86_64                                                          51/71 
  Running scriptlet: wireshark-cli-2.2.7-1.fc26.x86_64                                                          51/71 
  Cleanup          : wireshark-2.2.7-1.fc26.x86_64                                                              52/71 


Version-Release number of selected component (if applicable):
wireshark-gtk-2.2.8-1.fc26.x86_64
Comment 1 Martin Sehnoutka 2017-07-24 04:50:21 EDT
Can you provide me with output of this command?
$ sudo alternatives --display wireshark

Does it help when you remove all wireshark packages and then install them again?
Comment 2 Kamil Páral 2017-07-24 11:17:31 EDT
$ sudo alternatives --display wireshark
wireshark - status is auto.
 link currently points to /usr/sbin/wireshark-gtk
/usr/sbin/wireshark-gtk - priority 10
Current `best' version is /usr/sbin/wireshark-gtk.

> Does it help when you remove all wireshark packages and then install them
> again?

No, the same error even on a clean install.
Comment 3 Martin Sehnoutka 2017-07-25 07:51:46 EDT
The problem is that we moved wireshark binaries from /usr/sbin to /usr/bin during f26 development phase. There is a script, that was supposed to remove wireshark from alternatives and install it again, but it seems not to work.

As a workaround, you can remove all Wireshark packages, then remove alternatives with this command:
/usr/sbin/update-alternatives --remove-all wireshark
and then install wireshark again. It should be fine after that. I'll try to improve the update script, so this is done automatically.
Comment 4 Martin Sehnoutka 2017-08-09 07:27:29 EDT
*** Bug 1472810 has been marked as a duplicate of this bug. ***
Comment 5 Fedora Update System 2017-08-16 07:52:43 EDT
wireshark-2.2.8-2.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-c0a683b4f9
Comment 6 Fedora Update System 2017-08-19 14:52:35 EDT
wireshark-2.2.8-2.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-c0a683b4f9
Comment 7 Enrico Tagliavini 2017-08-24 04:45:54 EDT
I've got the same issue, I've updated to wireshark-qt-2.2.8-2 from updates-testing . Unfortunately the issue is still present after the update, output of dnf shows

  Running scriptlet: wireshark-qt-2.2.8-2.fc26.x86_64                                                                                                                                                                                                                                   3/6 
which: no wireshark in (/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin)
which: no wireshark in (/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin)
the primary link for wireshark must be /usr/sbin/wireshark
warning: %post(wireshark-qt-2.2.8-2.fc26.x86_64) scriptlet failed, exit status 2
Non-fatal POSTIN scriptlet failure in rpm package wireshark-qt
Non-fatal POSTIN scriptlet failure in rpm package wireshark-qt

The output of alternatives is:

$ alternatives --display wireshark 
wireshark - status is auto.
 link currently points to /usr/sbin/wireshark-qt
/usr/sbin/wireshark-qt - priority 50
Current `best' version is /usr/sbin/wireshark-qt.

This is not a fresh Fedora 26 install, it's an upgrade from 25 did few days ago. wireshark symlink is not present at all, no idea how it gone missing, but I never touched it by hand. Nevertheless the 

if [ "$(which wireshark)" == "/usr/sbin/wireshark" ] || [ "$(which wireshark)" == "/sbin/wireshark" ];

will not be true and the fix will not be applied. Maybe change the condition to something like

if alternatives --display wireshark | grep -q '/usr/sbin/wireshark';
then
    /usr/sbin/update-alternatives --remove-all wireshark &> /dev/null || :
fi

Or maybe to a check before this if to see if which wireshark actually return something, if not reinstall the default link.
Comment 8 Martin Sehnoutka 2017-08-28 04:12:54 EDT
Unfortunately the line 
if alternatives --display wireshark | grep -q '/usr/sbin/wireshark';
won't work, because there is no line saying anything about the group link "/usr/sbin/wireshark", there is only the actual binary mentioned 3 times.

I might close this bug as WONTFIX, because it seems to be broken in a different way for everybody and I don't have the capacity to write scriptlets for everything.
Comment 9 Enrico Tagliavini 2017-08-28 04:21:14 EDT
I understand it's not easy, but leaving it unfixed is not really good. As long as it's only one package you can bear with it, but if more packages start doing such a thing...

What about a simple solution as:

if [ -z "$(which wireshark 2>/dev/null)" ] || [ "$(which wireshark)" == "/usr/sbin/wireshark" ] || [ "$(which wireshark)" == "/sbin/wireshark" ];

If you want you can even combine this in a single command

if [ -z "$(which wireshark 2>/dev/null)" -or "$(which wireshark 2>/dev/null)" == "/usr/sbin/wireshark" -or "$(which wireshark 2>/dev/null)" == "/sbin/wireshark" ];

That would also work. If you try to remove an alternative that doesn't exist it's harmless, you have the &> /dev/null || : already.
Comment 10 Kamil Páral 2017-08-28 04:34:11 EDT
(In reply to Martin Sehnoutka from comment #8)
> I might close this bug as WONTFIX, because it seems to be broken in a
> different way for everybody and I don't have the capacity to write
> scriptlets for everything.

It's better to not use alternatives rather than have it broken.
Comment 11 Enrico Tagliavini 2017-08-28 04:38:47 EDT
Oh you mean remove alternatives for wireshark and keeping the two binaries well separated? Agreed, that works indeed. Sorry I didn't understood you wanted to go this way when you said WONTFIX :)
Comment 12 Nick Cross 2017-11-24 04:54:44 EST
I am seeing this on an upgrade to Fedora 27 and then installing wireshark-qt:

Running transaction
  Preparing        :                                                                                                                                    1/1 
  Installing       : libsmi-0.4.8-20.fc27.x86_64                                                                                                        1/5 
  Running scriptlet: libsmi-0.4.8-20.fc27.x86_64                                                                                                        1/5 
  Installing       : compat-lua-libs-5.1.5-9.fc27.x86_64                                                                                                2/5 
  Running scriptlet: compat-lua-libs-5.1.5-9.fc27.x86_64                                                                                                2/5 
  Installing       : wireshark-1:2.4.0-6.fc27.x86_64                                                                                                    3/5 
  Running scriptlet: wireshark-cli-1:2.4.0-6.fc27.x86_64                                                                                                4/5 
  Installing       : wireshark-cli-1:2.4.0-6.fc27.x86_64                                                                                                4/5 
  Running scriptlet: wireshark-cli-1:2.4.0-6.fc27.x86_64                                                                                                4/5 
  Running scriptlet: wireshark-qt-1:2.4.0-6.fc27.x86_64                                                                                                 5/5 
  Installing       : wireshark-qt-1:2.4.0-6.fc27.x86_64                                                                                                 5/5 
  Running scriptlet: wireshark-qt-1:2.4.0-6.fc27.x86_64                                                                                                 5/5 
the primary link for wireshark must be /usr/sbin/wireshark
warning: %post(wireshark-qt-1:2.4.0-6.fc27.x86_64) scriptlet failed, exit status 2
Non-fatal POSTIN scriptlet failure in rpm package wireshark-qt
Non-fatal POSTIN scriptlet failure in rpm package wireshark-qt
  Running scriptlet: wireshark-cli-1:2.4.0-6.fc27.x86_64                                                                                                5/5 
  Running scriptlet: wireshark-qt-1:2.4.0-6.fc27.x86_64                                                                                                 5/5 
  Verifying        : wireshark-qt-1:2.4.0-6.fc27.x86_64                                                                                                 1/5 
  Verifying        : wireshark-cli-1:2.4.0-6.fc27.x86_64                                                                                                2/5 
  Verifying        : compat-lua-libs-5.1.5-9.fc27.x86_64                                                                                                3/5 
  Verifying        : libsmi-0.4.8-20.fc27.x86_64                                                                                                        4/5 
  Verifying        : wireshark-1:2.4.0-6.fc27.x86_64                                                                                                    5/5

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