New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Linux] Unable to type password #6811

Closed
nlurkin opened this Issue Oct 14, 2018 · 39 comments

Comments

Projects
None yet
7 participants
@nlurkin
Copy link

nlurkin commented Oct 14, 2018

Expected behaviour

My owncloud client was disconnected from the server at some point this week. It is asking me for my password to reconnect. I expect to type the password and be reconnected.

Actual behaviour

Unfortunately the box asking for the password does not seem to accept input. I type, but nothing happens is displayed and after typing correctly the password (with no visual clue from the window, so I suppose nothing is actually typed) I press OK and the connection is not established.

Steps to reproduce

  1. Start owncloud
  2. Wait for the password box to appear
  3. Try to type password

Server configuration

Operating system: Fedora 26
Web server: Apache2
Database: MySQL
PHP version: 7.1.22
ownCloud version: 10.0.10.4
Storage backend (external storage): Not activated

Client configuration

Client version: 2.5.0
Operating system: CentOS 7.5
OS language: English
Qt version used by client package (Linux only, see also Settings dialog): 5.10.1
Client package (From ownCloud or distro) (Linux only): from http://download.opensuse.org/repositories/isv:/ownCloud:/desktop/CentOS_7/
Installation path of client: Standard from package (/usr/bin)

Logs

When I start owncloud from the command line, I see this error which is probably related to the problem:

Qt: Failed to create XKB context!
Use QT_XKB_CONFIG_ROOT environmental variable to provide an additional search path, add ':' as separator to provide several search paths and/or make sure that XKB configuration data directory contains recent enough contents, to update please see http://cgit.freedesktop.org/xkeyboard-config/ .
  1. Client logfile lines related to the password window:
[ info gui.account.state ]: Invalid credentials for "removed" asking user
[ info gui.account.state ]: AccountState state change:  "Disconnected" -> "Asking Credentials"
[ info gui.folder.manager ]:Account "user@removed" disconnected or paused, terminating or descheduling sync folders
[ info sync.networkjob.determineauthtype ]:Determining auth type for QUrl("removed/remote.php/webdav/")
[ info sync.accessmanager ]:2 "" "removed/remote.php/webdav/" has X-Request-ID "2c17a1f4-c27b-4552-8723-59500c25e2de"
[ info sync.networkjob ]:OCC::SimpleNetworkJob created for "removed" + "" "OCC::Account"
[ info sync.accessmanager ]:6 "PROPFIND" "removed/remote.php/webdav/" has X-Request-ID "3e1dff27-11d9-422f-b414-3565c04ea282"
[ info sync.networkjob ]:OCC::SimpleNetworkJob created for "removed" + "" "OCC::Account"
[ info sync.networkjob.determineauthtype ]:Auth type for QUrl("removed/remote.php/webdav/") is 0
[ info gui.account.manager ]:  Saving account "removed"
[ info gui.account.manager ]:  Saving  1  unknown certs.
[ info gui.account.manager ]:  Saving cookies. "/home/user/.config/ownCloud/cookies0.db"
[ info gui.account.manager ]:  Saved account settings, status: QSettings::Status(NoError)
[ info gui.account.state ]: Credentials asked for "removed" are they ready? true
[ info gui.account.state ]: Invalid credentials for "removed" asking user
@ogoffart

This comment has been minimized.

Copy link
Collaborator

ogoffart commented Oct 15, 2018

Have you tried clicking on the line edit to give it focus? Maybe it simply did not have the focus.

@nlurkin

This comment has been minimized.

Copy link
Author

nlurkin commented Oct 15, 2018

Sure, I tried. And it does have the focus, there is the blinking cursor.
It seems that window just does not accept any keyboard input (also typing enter does not validate the input, and tab does not change the focus to the buttons)

@guruz guruz changed the title Unable to type password [Linux] Unable to type password Oct 15, 2018

@guruz

This comment has been minimized.

Copy link
Collaborator

guruz commented Oct 15, 2018

@nlurkin Do you have a screenshot for us?
What about other input fields, e.g. in the proxy settings of the client?

@guruz guruz added the Needs info label Oct 15, 2018

@nlurkin

This comment has been minimized.

Copy link
Author

nlurkin commented Oct 16, 2018

Yes screenshot attached.
Other input fields also seem to not receive input from keyboard. I tried the proxy settings: I can click on the radio boxes but cannot input anything into the text boxes.
oc_input

@nlurkin

This comment has been minimized.

Copy link
Author

nlurkin commented Oct 16, 2018

By the way now that I tested, I can confirm this is linked to the error message that is displayed when I launch owncloud from the command line (see initial post).
Following what I found at the following link: https://bugreports.qt.io/browse/QTBUG-56227
I did
export QT_XKB_CONFIG_ROOT=/usr/share/X11/xkb
and then launching owncloud from that terminal tab works (but is not very convenient as I have to kill the initial instance launch when booting and then restarting it from a terminal without killing that terminal)

@ogoffart

This comment has been minimized.

Copy link
Collaborator

ogoffart commented Oct 16, 2018

I would think something is wrong with your settings.
What's the value of your QT_XKB_CONFIG_ROOT before setting it, and who is setting it to this value.
Don't you have similar problem with other Qt applications?

@nlurkin

This comment has been minimized.

Copy link
Author

nlurkin commented Oct 17, 2018

The variable QT_XKB_CONFIG_ROOT is not set by default. I don't know if my settings are wrong but I didn't change anything myself.
I tested several other QT applications that I have on my laptop and they all work: transmission, VLC, TexStudio

@ckamm ckamm added this to the 2.5.1 milestone Oct 17, 2018

@ckamm

This comment has been minimized.

Copy link
Member

ckamm commented Oct 17, 2018

@guruz Looking at https://bugreports.qt.io/browse/QTBUG-56351 this may be related to the Qt we provide not having the default path configured? Is our Qt configured with -xkb-config-root or -qt-xkbcommon-x11? If not, using the former option to set a config path may help. But I don't know what side-effects there'd be. Also, from the bugtracker it sounds like this bug was supposed to be fixed for 5.8.0.

@michaelstingl

This comment has been minimized.

Copy link
Collaborator

michaelstingl commented Oct 18, 2018

Another user reported QT_XKB_CONFIG_ROOT related issues: #6818 (comment)

@guruz

This comment has been minimized.

Copy link
Collaborator

guruz commented Oct 19, 2018

@fujibluejay Does it work for you if you set the QT_XKB_CONFIG_ROOT variable like in #6811 (comment) ?

CC @jnweiger ... possible Qt configure change needed.

@guruz guruz added packaging and removed packaging labels Oct 20, 2018

@guruz

This comment has been minimized.

Copy link
Collaborator

guruz commented Oct 20, 2018

So @fujibluejay also had to run the export QT_XKB_CONFIG_ROOT=/usr/share/X11/xkb like @nlurkin
#6818 (comment)

@jnweiger I cannot say how our Qt shall be compiled (I'm not a Linux guy), I think @ogoffart @ckamm should decide.

@ckamm

This comment has been minimized.

Copy link
Member

ckamm commented Oct 22, 2018

@jnweiger I also don't know what to do exactly

  • Does the build env have xkbcommon-x11? What's the config root path there?
  • It seems both /usr/share/X11/xkb and /usr/local/share/X11/xkb are common. Ubuntu uses the former
  • In the build env, what's the XKB_CONFIG_ROOT that our Qt gets built with?

Trying to configure Qt with -xbk-config-root /usr/share/X11/xkb might solve the problem, but it'd be great to know why this issue even pops up in the first place. Why only on CentOS 7.5?

@guruz guruz added the packaging label Oct 23, 2018

@guruz

This comment has been minimized.

Copy link
Collaborator

guruz commented Oct 23, 2018

@guruz

This comment has been minimized.

Copy link
Collaborator

guruz commented Oct 23, 2018

In the build env, what's the XKB_CONFIG_ROOT that our Qt gets built with?
Does the build env have xkbcommon-x11? What's the config root path there?

There is something on https://build.opensuse.org/package/view_file/isv:ownCloud:desktop/ocqt5101-qt5-qtbase/ocqt5101-qt5-qtbase.spec?expand=1 but I don't know what is used.
I wanted to check the build results (right side) in https://build.opensuse.org/package/show/isv:ownCloud:desktop/ocqt5101-qt5-qtbase but it's disabled?

@guruz

This comment has been minimized.

Copy link
Collaborator

guruz commented Oct 23, 2018

Actually there is still a log:

[ 253s] + ./configure -prefix /usr -L /opt/ownCloud/qt-5.10.1/lib64 -libdir /opt/ownCloud/qt-5.10.1/lib64 -archdatadir /opt/ownCloud/qt-5.10.1/lib64/qt5 -bindir /opt/ownCloud/qt-5.10.1/lib64/qt5/bin -datadir /opt/ownCloud/qt-5.10.1/share/qt5 -docdir /usr/share/doc/ocqt5101-qt5 -examplesdir /opt/ownCloud/qt-5.10.1/lib64/qt5/examples -headerdir /opt/ownCloud/qt-5.10.1/include/qt5 -importdir /opt/ownCloud/qt-5.10.1/lib64/qt5/imports -libexecdir /opt/ownCloud/qt-5.10.1/lib64/qt5/libexec -plugindir /opt/ownCloud/qt-5.10.1/lib64/qt5/plugins -sysconfdir /etc/xdg -translationdir /opt/ownCloud/qt-5.10.1/share/qt5/translations -verbose -reduce-relocations -optimized-qmake -accessibility -no-strip -opensource -no-separate-debug-info -shared -xkb -qt-xkbcommon -qt-xkbcommon-x11 -xkb-config-root /usr/share/X11/xkb/ -dbus-linked -sm -rpath -system-libjpeg -openssl-linked -system-libpng -fontconfig -system-freetype -cups -system-zlib -no-iconv -no-pch -glib -system-sqlite -no-sql-mysql -no-strip -qt-xcb -no-egl -no-eglfs -no-opengl -release -plugin-sql-sqlite -nomake tests -plugin-sql-psql -I/usr/include/pgsql/ -I/usr/include/pgsql/server -plugin-sql-odbc -plugin-sql-mysql -I/usr/include/mysql/ -v
`
(https://build.opensuse.org/public/build/isv:ownCloud:desktop/CentOS_7/x86_64/ocqt5101-qt5-qtbase/_log)

So -xkb-config-root /usr/share/X11/xkb/ is already set...?!

@guruz

This comment has been minimized.

Copy link
Collaborator

guruz commented Oct 23, 2018

429s] WARNING: Could not find XKB config root, use -xkb-config-root to set a path to
[ 429s] XKB configuration data. This is required for keyboard input support.

@guruz

This comment has been minimized.

Copy link
Collaborator

guruz commented Oct 23, 2018

Maybe -xkb-config-root can't be found during configure, but is there on the final deployed system?

[  427s] Checking for XKB config root... 
[  427s] + /bin/pkg-config --exists --silence-errors xkeyboard-config
[  427s] test config.gui.tests.xkbconfigroot gave result 
[  427s] Checking for xkbcommon... 
[  427s] Trying source 0 (type pkgConfig) of library xkbcommon ...
[  427s] + /bin/pkg-config --exists --silence-errors xkbcommon
[  427s] pkg-config did not find package.
[  427s]   => source produced no result.
[  427s] test config.gui.libraries.xkbcommon FAILED

Someone with more Linux knowledge needs to take this over @jnweiger @ogoffart @ckamm

@ogoffart

This comment has been minimized.

Copy link
Collaborator

ogoffart commented Oct 23, 2018

I don't know much about that, but Qt 5.11 removed this config option, and the env variable ( http://code.qt.io/cgit/qt/qtbase.git/commit/?id=d5abf545971da717014d316127045fc19edbcd65 )
So maybe this is just a bug in Qt 5.10, which is already fixed upstream.

@ckamm

This comment has been minimized.

Copy link
Member

ckamm commented Oct 24, 2018

@guruz @jnweiger In my tests with v5.10.1 the -xkb-config-root switch had no effect. Probably the simplest fix is to ensure /usr/share/X11/xkb/ is available on the build machines so Qt's configure picks it as default path. The correct output for the configure should be:

test config.gui.tests.xkbconfigroot gave result /usr/share/X11/xkb

@guruz guruz removed the Needs info label Oct 24, 2018

@guruz guruz unassigned ckamm and ogoffart Oct 24, 2018

@guruz guruz added the gold-ticket label Oct 24, 2018

@guruz

This comment has been minimized.

Copy link
Collaborator

guruz commented Oct 24, 2018

Probably the simplest fix is to ensure /usr/share/X11/xkb/ is available on the build machines so Qt's configure picks it as default path.

Sounds good

@jnweiger Feel free to also fix this for 2.5.0 packages not only from 2.5.1

@jnweiger

This comment has been minimized.

Copy link
Contributor

jnweiger commented Oct 24, 2018

@ckamm @guruz thank you for the analysis.
I'll set up a build env for qtbase on centos7, and see, of the /usr/share/X11/xkb/ path is there.
xkbcommon-x11 is not in the build env. Looking into that.

Our Logic seems to do the wrong thing in the CentOS RHEL case:

%if 0%{?el6} || 0%{?el7}
%global use_qt_xkbcommon 1
%endif
...
%if ! 0%{?use_qt_xkbcommon}
BuildRequires:  pkgconfig(xkbcommon-x11) >= 0.4.1
%endif

This explicitly excludes xkbcommon-x11 on CentOS builds and refers to the bundled 3rdparty/xkbcommon/ instead. I cannot see a reason why it is that way.

@jnweiger

This comment has been minimized.

Copy link
Contributor

jnweiger commented Oct 24, 2018

With xkbcommon-x11 installed the configure output looks better:

[   58s] test config.gui.libraries.xkbcommon succeeded
[   59s]   xkbcommon-evdev ........................ yes

/usr/share/X11/xkb is there now. Hope that has the desired effect. Pushing into internal and external OBS. Tomorrow's daily build should have the fix here: https://software.opensuse.org//download.html?project=isv%3AownCloud%3Adesktop%3Adaily%3A2.5&package=owncloud-client

@jnweiger

This comment has been minimized.

Copy link
Contributor

jnweiger commented Oct 25, 2018

Only CentOS-7 has xkbcommon-x11. CentOS-6, RHEL-6, RHEL-7 would need a different fix. Not sure if these are affected at all.

@ckamm

This comment has been minimized.

Copy link
Member

ckamm commented Oct 25, 2018

@jnweiger guruz said in #6811 (comment) that RHEL-6 was also affected.

Looking at this again: I think when using the system xkbcommon-x11 this path isn't necessary. But when using -qt-xkbcommon-x11, like on systems where it isn't otherwise available, the path is important. However, as far as I can tell the 5.10.1 configure is borked and never actually uses the -xkb-config-root flag for something.

Maybe a workaround would be to manually set QMAKE_XKB_CONFIG_ROOT = /usr/share/X11/xkb in src/gui/qtgui-config.pri after the configure step for these cases.

@ckamm

This comment has been minimized.

Copy link
Member

ckamm commented Oct 25, 2018

Alternatively, here's a patch though I'm no Qt configure expert! @ogoffart

diff --git a/src/gui/configure.json b/src/gui/configure.json
index dab66fafb4..0e562a94c5 100644
--- a/src/gui/configure.json
+++ b/src/gui/configure.json
@@ -45,7 +45,7 @@
             "xcb-xlib": "boolean",
             "xinput2": "boolean",
             "xkb": "boolean",
-            "xkb-config-root": "string",
+            "xkb-config-root": { "type": "string", "name": "xkb_config_root" },
             "xkbcommon": { "type": "enum", "values": [ "no", "qt", "system" ] },
             "xkbcommon-evdev": "boolean",
             "xkbcommon-x11": { "type": "enum", "name": "xkbcommon", "values": [ "no", "qt", "system" ] }
diff --git a/src/gui/configure.pri b/src/gui/configure.pri
index aaffa835dc..5a9ed1347b 100644
--- a/src/gui/configure.pri
+++ b/src/gui/configure.pri
@@ -43,6 +43,13 @@ defineTest(qtConfTest_directX) {
 }
 
 defineTest(qtConfTest_xkbConfigRoot) {
+    !isEmpty(config.input.xkb_config_root) {
+            $${1}.value = $$config.input.xkb_config_root
+            export($${1}.value)
+            $${1}.cache += value
+            export($${1}.cache)
+            return(true)
+    }
     qtConfTest_getPkgConfigVariable($${1}): return(true)
 
     for (dir, $$list("/usr/share/X11/xkb", "/usr/local/share/X11/xkb")) {

Possibly the simplest solution would be mkdir /usr/share/X11/xkb before configure is run.

@jnweiger

This comment has been minimized.

Copy link
Contributor

jnweiger commented Oct 25, 2018

Ah, I see, an empty /usr/share/X11/xkb already should do the trick? That is almost easy. mkdir is not allowed in OBS. We use a workaround. If that does not help, I'll try the patching from #6811 (comment)

With existing /usr/shar/X11/xkb on CentOS_6 I still get

[  206s] Checking for xkbcommon... 
[  206s] Trying source 0 (type pkgConfig) of library xkbcommon ...
[  206s] + /usr/bin/pkg-config --exists --silence-errors xkbcommon
[  206s] pkg-config did not find package.
[  206s]   => source produced no result.
[  206s] test config.gui.libraries.xkbcommon FAILED

Hmm - does that mean it would not work? Or is that fine as we use our own xkbcommon?
Should the directoy exist at compile time only, or also at runtime?

@ckamm

This comment has been minimized.

Copy link
Member

ckamm commented Oct 25, 2018

Hmm - if we use the qt-builtin xkbcommon it should be ok if the build environment doesn't have one? Check whether QMAKE_XKB_CONFIG_ROOT is set in src/gui/qtgui-config.pri.

On the other hand: yes, that directory needs to contain the expected files at runtime. As far as I can tell it does exist for the current batch of reports because they workaround by setting QT_XKB_CONFIG_ROOT to this very path (one of them on RHEL6). But if that's true there should be a package that provides the data that we could install in the build environment.

@fujibluejay

This comment has been minimized.

Copy link

fujibluejay commented Oct 25, 2018

Only CentOS-7 has xkbcommon-x11. CentOS-6, RHEL-6, RHEL-7 would need a different fix. Not sure if these are affected at all.

RHEL 6 is affected by this issue. I've seen it. I had to
export QT_XKB_CONFIG_ROOT=/usr/share/X11/xkb
in order to make the client accept keyboard input.

@jnweiger

This comment has been minimized.

Copy link
Contributor

jnweiger commented Oct 25, 2018

For CentOS-6 and RHEL-6 I have found package xkeyboard-config providing a populated /usr/share/X11/xkb folder.

  • build and runtime dependency to xkeyboard-config added
  • line to src/gui/qtgui-config.pri added
  • patches from #6811 (comment) applied

But I am still getting test config.gui.libraries.xkbcommon FAILED after all this.
Pushed into OBS, let's see what happens there.

grep QMAKE_XKB_CONFIG_ROOT qtgui-config.pri 
QMAKE_XKB_CONFIG_ROOT = /usr/share/X11/xkb/
QMAKE_XKB_CONFIG_ROOT = /usr/share/X11/xkb

The first probably was autodetected, the second was mine. That is a good sign...

@ckamm

This comment has been minimized.

Copy link
Member

ckamm commented Oct 25, 2018

@jnweiger Looks good! Just having the xkb folder populated should be enough. It's possible that failing xkbcommon test may be ignored - it's unrelated to the path detection at least.

@jnweiger

This comment has been minimized.

Copy link
Contributor

jnweiger commented Oct 25, 2018

@ckamm ckamm added the ReadyToTest label Oct 26, 2018

@fujibluejay

This comment has been minimized.

Copy link

fujibluejay commented Oct 26, 2018

@jnweiger 2.5.1.10909-0.10400.1.daily20181025 did not address this issue for me; I still had to export QT_XKB_CONFIG_ROOT in order for it to accept keyboard input. Without that, there were also errors shown when I started it:

QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-mumble'
xkbcommon: ERROR: failed to add default include path
Qt: Failed to create XKB context!
Use QT_XKB_CONFIG_ROOT environmental variable to provide an additional search path, add ':' as separator to provide several search paths and/or make sure that XKB configuration data directory contains recent enough contents, to update please see http://cgit.freedesktop.org/xkeyboard-config/ .
xkbcommon: ERROR: failed to add default include path

That last one and the xkbcommon error continued to repeat in batches of three every 15-30 seconds until I stopped the client.

@ckamm

This comment has been minimized.

Copy link
Member

ckamm commented Oct 26, 2018

@jnweiger @fujibluejay The key component would be the updated Qt build. Was that included in the test?

@guruz

This comment has been minimized.

Copy link
Collaborator

guruz commented Oct 26, 2018

Good question, did @jnweiger 's update change the oC-Qt package version so that it would get upgraded?
(otherwise also updating also 2.5.0 later in the 2.5.0 packages won't work..)

@jnweiger

This comment has been minimized.

Copy link
Contributor

jnweiger commented Oct 29, 2018

@fujibluejay do you have ocqt5101-libQt5Core5-5.10.1-27.1.x86_64.rpm installed?
The '-27.1' part indicates the build from 2018-10-25 19:55:28

@fujibluejay

This comment has been minimized.

Copy link

fujibluejay commented Oct 29, 2018

@jnweiger Ah, that was it. Apparently it didn't update the ocqt packages. After getting them all updated from the daily repo (just libQt5Core5 was not enough, although it did allow updating just that one), it's working properly. Thanks! That client now works as expected.

@jnweiger

This comment has been minimized.

Copy link
Contributor

jnweiger commented Oct 29, 2018

Great to hear that it works!
Thanks for testing! I assume you don't have the environment variable QT_XKB_CONFIG_ROOT set during testing. Is that correct?

@guruz We have no hard dependency on a specific version number of the Qt-libs. Thus it depends on the package manager, if it chooses to update dependencies or not. A yum update would offer the list of new libraries sooner or later :-)

@fujibluejay

This comment has been minimized.

Copy link

fujibluejay commented Oct 29, 2018

@jnweiger Correct. It works without setting QT_XKB_CONFIG_ROOT.

@jnweiger

This comment has been minimized.

Copy link
Contributor

jnweiger commented Oct 29, 2018

Closed fixed. The updated libs will ship with 2.5.1 according to the milestone. 2.5.0 remains as is.

@jnweiger jnweiger closed this Oct 29, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment