Trouble starting Cubic

Asked by Arjun

Hi,

Cubic seems like a great project, however I am struggling to even launch it. I just installed the latest version from the PPA. When I open cubic via my GUI app launcher (rofi), nothing happens. When I open cubic from a terminal, I get a polkit prompt. Entering my password in the prompt throws an error saying that I am not authorized. I am part of the sudo group, and have never had such issues. Trying to run cubic via sudo results in a warning saying that it should not be run by a priviledged user.

Am I doing anything wrong?

Thanks in advance

Question information

Language:
English Edit question
Status:
Solved
For:
Cubic Edit question
Assignee:
No assignee Edit question
Solved by:
Cubic PPA
Solved:
Last query:
Last reply:
Revision history for this message
Cubic PPA (cubic-wizard) said :
#1

Please share some information about the OS and environment you are running Cubic from?

Revision history for this message
Cubic PPA (cubic-wizard) said :
#2

..and please also share the output of...

    echo $XDG_SESSION_TYPE

Revision history for this message
Arjun (arjvik) said :
#3

I am running Cubic on Ubuntu 19.04 (disco). If it is relevant at all, I am not using the Gnome DE but instead using i3wm.

`echo $XDG_SESSION_TYPE` returns `x11`

Revision history for this message
Cubic PPA (cubic-wizard) said :
#4

What is the output if you try to run Cubic from the command line (without using `sudo`)?

Type `cubic`, press enter, and paste the output here.

Revision history for this message
Arjun (arjvik) said :
#5

$ cubic
Cubic (Custom Ubuntu ISO Creator) is a graphical user interface application and should be run using the application launcher. See "man cubic" for more information.

==== AUTHENTICATING FOR cubic ===
Enter superuser password to start Cubic
Authenticating as: Arjun Vikram,,, (arjvik)
Password: ...my actual password...
polkit-agent-helper-1: error response to PolicyKit daemon: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie
==== AUTHENTICATION FAILED ===
Error executing command as another user: Not authorized

This incident has been reported.

Revision history for this message
Arjun (arjvik) said :
#6

$ sudo cubic
[sudo] password for arjvik:

Error: Cubic may not be run as a privileged user. Run Cubic using an account with sudo (superuser) membership, and you will be prompted for the superuser password. See "man cubic" for more information.

Revision history for this message
Cubic PPA (cubic-wizard) said :
#7

Comment #5 is the correct way to start Cubic from the command line.

This may be an issue with how policykit is setup on your machine. (May be something changes when you install i3?).

Check if polkitd is running. You can use system monitor or execute the following.

    $ pgrep polkitd

Check if the following packages are installed?

    $ dpkg -l policykit-1
    $ dpkg -l libpolkit-agent-1-0
    $ dpkg -l libpolkit-gobject-1-0
    $ dpkg -l gir1.2-polkit-1.0
    $ dpkg -l gir1.2-polkitagent-1.0

Revision history for this message
Arjun (arjvik) said :
#8

$ pgrep polkitd
966

$ sudo apt list --installed | grep -iE "polkit|policykit"

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

gir1.2-polkit-1.0/disco,now 0.105-25 amd64 [installed,automatic]
libpolkit-agent-1-0/disco,now 0.105-25 amd64 [installed,automatic]
libpolkit-backend-1-0/disco,now 0.105-25 amd64 [installed,automatic]
libpolkit-gobject-1-0/disco,now 0.105-25 amd64 [installed,automatic]
libpolkit-qt5-1-1/disco,now 0.112.0-6 amd64 [installed,automatic]
policykit-1/disco,now 0.105-25 amd64 [installed,automatic]
policykit-desktop-privileges/disco-updates,disco-updates,disco-security,disco-security,now 0.20ubuntu19.04.1 all [installed,automatic]

$ sudo apt install gir1.2-polkitagent-1.0
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'gir1.2-polkit-1.0' instead of 'gir1.2-polkitagent-1.0'
gir1.2-polkit-1.0 is already the newest version (0.105-25).
gir1.2-polkit-1.0 set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

# Hope this helps, let me know if you need anything else

Revision history for this message
Arjun (arjvik) said :
#9

(I meant to add in the previous message, looks like "gir1.2-polkitagent-1.0" is not available in the Ubuntu repos, but when installing the name is redirected to a package that I already have)

Revision history for this message
Cubic PPA (cubic-wizard) said :
#10

Humm...

Seems to match up with what I have in an Ubuntu 19.04 environment that is able to launch cubic...

$ sudo apt list --installed | grep -iE "polkit|policykit"

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

gir1.2-polkit-1.0/disco,now 0.105-25 amd64 [installed,automatic]
libpolkit-agent-1-0/disco,now 0.105-25 amd64 [installed,automatic]
libpolkit-backend-1-0/disco,now 0.105-25 amd64 [installed,automatic]
libpolkit-gobject-1-0/disco,now 0.105-25 amd64 [installed,automatic]
policykit-1/disco,now 0.105-25 amd64 [installed,automatic]
policykit-desktop-privileges/disco,now 0.20 all [installed,upgradable to: 0.20ubuntu19.04.1]

Revision history for this message
Cubic PPA (cubic-wizard) said :
#11

I just noticed something interesting in your comment #5.

Cubic is prompting you for a password in the TERMINAL, but it should be presenting you with a GRAPHICAL authentication dialog.

This is probably because you do not have a graphical agent for polkit (possibly because that's how i3 works???).

Revision history for this message
Best Cubic PPA (cubic-wizard) said :
#12

I'll suggest a couple of options...

OPTION # 1
==========

Try installing the Gnome authentication agent for PolicyKit...

    sudo apt install policykit-1-gnome

OPTION # 2
==========

Try to use a tty PolicyKit agent instead...

    1. Open a terminal, execute the following, and note the resulting PID:

        echo $$

    2. Open a SECOND terminal and execute the following:

        pkttyagent --process <PID FROM STEP 1>

    3. In the FIRST terminal, execute the following:

        pkexec /usr/share/cubic/cubic.py "/usr/share/cubic"

    4. Return to the SECOND terminal and enter your sudo password when prompted.

        You should see output like the following in the SECOND terminal...

            pkttyagent --process <PID FROM STEP 1>
            ==== AUTHENTICATING FOR cubic ===
            Enter superuser password to start Cubic
            Authenticating as: Arjun Vikram,,, (arjvik)
            Password:
            ==== AUTHENTICATION COMPLETE ===

    5. The Cubic GUI should launch from the FIRST terminal.

Revision history for this message
Arjun (arjvik) said :
#13

Yes, Method #2 worked!
Thank you so much for your help!

I'm surprised at how complicated PolicyKit is...
I'll try to install policykit-1-gnome later on and report back with its success.

I'm looking forward to using Cubic now! Thanks for your hard work!

Revision history for this message
Cubic PPA (cubic-wizard) said :
#14

I'm glad it's working!

So the fundamental problem is that i3 doesn't (seem to) have a graphical authentication agent for PolicyKit.
I wonder if there is a specific package for i3 that has a GUI PolicyKit agent?

In any case, please do report your experience with policykit-1-gnome when you get a chance to test it, since it may be helpful for others.