Bug 238924

Summary: Zenity says "This option is not available."
Product: [Fedora] Fedora Reporter: Jasper O. Hartline <jasperhartline>
Component: zenityAssignee: Matthias Clasen <mclasen>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideKeywords: Reopened
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-05-04 13:27:56 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
strace of Zenity none

Description Jasper O. Hartline 2007-05-03 21:08:56 UTC
Description of problem:
Using this string in a shell script:

RETURN=$(/usr/sbin/chroot $SYSDIR /usr/bin/zenity --title "Firewall
Configuration" --list --radiolist TRUE Enabled FALSE Disabled --column "Item"
--column "Option")

Zenity returns saying "This option is not available. See --help for all possible
options"

Version-Release number of selected component (if applicable):
zenity-2.18.0-1.fc7

How reproducible:
Use the Zenity version listed above, in a script using chroot and a directory,
where Zenity is installed.

Steps to Reproduce:
1.
2.
3.
  
Actual results:
Zenity says this option isn't available.

Expected results:
Standard behavior, readiolist pops up, etc.

Additional info:
No additional information at this time.

Comment 1 Matthias Clasen 2007-05-03 22:54:30 UTC
It doesn't say that here, but instead pops up a dialog containing just the radio
column. It works better if you add another --column

Comment 2 Jasper O. Hartline 2007-05-04 00:01:39 UTC
Well, if you could tell me why it is behaving like this, I would appreciate it..
I think I've been mixing and matching different quotes, with no quotes, I'm
really out of ideas, take a look:

[root@localhost ~]# perl -e '$RETURN = `/usr/bin/zenity --text \"Firewall
Configuration\" --list --column \"Item\" --column \"Option\" --checklist TRUE
Enabled FALSE Disabled`'
[root@localhost ~]# rpm -q zenity
zenity-2.16.0-1.fc6
[root@localhost ~]# perl -e '$RETURN = `/usr/sbin/chroot
/tmp/kadischi.q6brJG/system /usr/bin/zenity --text \"Firewall Configuration\"
--list --column \"Item\" --column \"Option\" --checklist TRUE Enabled FALSE
Disabled`'
This option is not available. Please see --help for all possible usages.
[root@localhost ~]# /usr/sbin/chroot /tmp/kadischi.q6brJG/system /bin/rpm -q zenity
zenity-2.18.0-1.fc7
[root@localhost ~]#

The first invokation of zenity, which is a Fedora Core 6 zenity package, brings
up the expected window, with the right options, the second one does not.
strace output will be provided which may give you more insight, as I have
already looked at it.

Comment 3 Jasper O. Hartline 2007-05-04 00:04:00 UTC
Created attachment 154090 [details]
strace of Zenity

Attached strace output:

strace perl -e '$RETURN = `/usr/sbin/chroot /tmp/kadischi.q6brJG/system
/usr/bin/zenity --text \"Firewall Configuration\" --list --column \"Item\"
--column \"Option\" --checklist TRUE Enabled FALSE Disabled`' >/tmp/strace.log
2>&1

Comment 4 Matthias Clasen 2007-05-04 00:08:01 UTC
no idea, in any case, this is not a zenity problem, but some shell/perl quoting
problem.

Comment 5 Jasper O. Hartline 2007-05-04 03:09:22 UTC
I'm not seeing how the addition of "/usr/sbin/chroot /tmp/directory/" makes it
fail, leaving this to be a shell/perl quoting problem.

It also fails with the same "This option is not available" using this in a BASH
script:

RETURN=$(/usr/sbin/chroot $SYSDIR /usr/bin/zenity --title "Firewall
Configuration" --list  --radiolist TRUE Enabled FALSE Disabled --column "Item"
--column "Option")

If I run that directly in the shell without /usr/sbin/chroot $SYSDIR, it works
fine. That doesn't sound to me like a shell/perl quoting problem exactly.

Comment 6 Matthias Clasen 2007-05-04 03:30:51 UTC
RETURN=$(/usr/sbin/chroot / /usr/bin/zenity --text "Firewall Configuration"
--list --radiolist E TRUE D FALSE --column "Item" --column "Option")

works fine here. You will have to debug this yourself, I'm afraid. I'd propose
to first see if SYSDIR=/ works, and then proceed to look for problems inside
your SYSDIR.

Comment 7 Jasper O. Hartline 2007-05-04 13:27:56 UTC
Ok. Using strace I have located the problem, bringing it out of the Perl script
and running it directly from the fake rootfs. The missing /tmp/.X11-unix and
sockets associated with it, along with the hosts's ACL regarding connections to
the X server were causing Zenity to return the option not available message.

This could be considered a red herring error message, and I've since taken this
issue up on Gnome's bugzilla.

One thing however, is after the issues above are rectified for using Zenity in a
seperate rootfs, under chroot(1), if no fonts are installed, Zenity will fail
also, stating this is the case.

Perhaps the Zenity package should have a Requires on a standard font package.
Thanks Matthias.