Bug 1212919

Summary: kdesu does not launch kate
Product: [openSUSE] openSUSE Tumbleweed Reporter: Frank Krüger <fkrueger>
Component: KDE ApplicationsAssignee: E-Mail List <opensuse-kde-bugs>
Status: NEW --- QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: fabian, fkrueger, fvogt
Version: Current   
Target Milestone: ---   
Hardware: x86-64   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Frank Krüger 2023-07-02 17:06:55 UTC
Given TW20230629 and starting "kdesu kate &" from the console: After entering the root password kate is not launched at all, with the error messages:

kate[29943]: qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
kate[29943]: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Any idea?
Comment 1 Fabian Vogt 2023-07-02 17:54:01 UTC
I assume this is with an X11 session of Plasma?

What's the output of "xauth list"?

If you run "su", what's the output of "xauth list" inside?
Comment 2 Frank Krüger 2023-07-02 18:09:19 UTC
(In reply to Fabian Vogt from comment #1)
> I assume this is with an X11 session of Plasma?
> 
> What's the output of "xauth list"?

gropius/unix:0  MIT-MAGIC-COOKIE-1  5c8ee00c7ae25ee87e693770f7894955
#ffff##:0  MIT-MAGIC-COOKIE-1  5c8ee00c7ae25ee87e693770f7894955

> If you run "su", what's the output of "xauth list" inside?

ropius/unix:0  MIT-MAGIC-COOKIE-1  5c8ee00c7ae25ee87e693770f7894955
#ffff##:0  MIT-MAGIC-COOKIE-1  5c8ee00c7ae25ee87e693770f7894955
Comment 3 Frank Krüger 2023-07-02 18:10:26 UTC
(In reply to Fabian Vogt from comment #1)
> I assume this is with an X11 session of Plasma?

Yes, X11 session.
Comment 4 Frank Krüger 2023-07-02 19:18:47 UTC
Might this issue actually be a feature? Cf. https://build.opensuse.org/package/view_file/openSUSE:Factory/kate/0001-Defuse-root-block.patch?expand=1
Comment 5 Fabian Vogt 2023-07-03 06:39:36 UTC
The xauth output looks good. What's $DISPLAY? Does xterm show any better error message?

(In reply to Frank Krüger from comment #4)
> Might this issue actually be a feature? Cf.
> https://build.opensuse.org/package/view_file/openSUSE:Factory/kate/0001-
> Defuse-root-block.patch?expand=1

No, it would clearly indicate that. In this case it fails to connect to the X server.
Comment 6 Frank Krüger 2023-07-03 16:40:45 UTC
(In reply to Fabian Vogt from comment #5)
> What's $DISPLAY? 
echo $DISPLAY
:0
> Does xterm show any better error message?
Unfortunately not. By the way, kwrite works fine with kdesu.
Comment 7 Fabian Vogt 2023-07-03 16:58:23 UTC
I was able to reproduce the issue.

It's because kate forks into the background, but that causes the kdesu session to stop and the xauth file is deleted. Depending on whether the forked kate was quick enough or not, the X11 connection is successful or not.

You can use kdesu -c "kate -b" instead.
Comment 8 Frank Krüger 2023-07-03 18:33:38 UTC
(In reply to Fabian Vogt from comment #7)
> I was able to reproduce the issue.
> 
> It's because kate forks into the background, but that causes the kdesu
> session to stop and the xauth file is deleted. Depending on whether the
> forked kate was quick enough or not, the X11 connection is successful or not.
> 
> You can use kdesu -c "kate -b" instead.

This works. Thx.