Bug report #17386

Authentication manager behaves weird

Added by Andreas Neumann over 6 years ago. Updated over 6 years ago.

Status:Closed
Priority:High
Assignee:Alessandro Pasotti
Category:Authentication system
Affected QGIS version:master Regression?:Yes
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:25283

Description

Issue Nr 1: Already at QGIS startup I get two warnings:

WARNING: QGIS authentication Auth query exec() FAILED
WARNING: QGIS authentication Auth query exec() FAILED


Issue Nr 2: Subsequent issue for already existing connections (Postgis): if I click on the "Edit" button of an existing connection, I get error messages:

Configuration 'up539g3' not in database

At the same time a KDE error message pops up: QGIS authentication Auth query exec() FAILED

See first screenshot attached.


Issue Nr 3:
if I want to add a new authentication configuration, QGIS asks me for my master password and I get the following error messages:

Master password has been successfully written to your Wallet/KeyRing
Auth db query exec() FAILED
Master password: FAILED to access database

subsequently I can't add a new configuration and QGIS keeps asking for my master password.

qgis_auth_manager_errors.png (229 KB) Andreas Neumann, 2017-11-02 03:35 PM

Screenshot_2017-11-30_17-54-26.png (6.38 KB) Patrick Dunford, 2017-11-30 10:38 AM

History

#1 Updated by Andreas Neumann over 6 years ago

maybe linked to #17385

#2 Updated by Andreas Neumann over 6 years ago

If I open the qgis-auth.db file in QGIS and have a look in the table auth_configs there is an entry with the correct ID that QGIS complains it cannot find:

wkt_geom rowid id name uri type version config
NULL 1 up539g3 svc@postgis_zg Basic 2 24d0922e5fadb48fb585d0a5e57660359b80a1fc2e0c09b9b859c9fc9c14445bb7b24640c5274d39b5996c1e11f9e81df547797836484fcf6273a8ccbc4a39aa

So obviously there is some problem that QGIS can't access my qgis-auth.db file correctly.

#3 Updated by Andreas Neumann over 6 years ago

If I run the Python code

QgsApplication.authManager().authenticationDatabasePath()

the result is

'/home/an/.local/share/QGIS/QGIS3/profiles/default/qgis-auth.db'

Which seems correct. The file exists and can be opened in QGIS.

#4 Updated by Andreas Neumann over 6 years ago

When opening a new QGIS profile, authentication manager works fine.

Perhaps this is a migration issue with an old qgis-auth.db from older QGIS 3 profiles?

#5 Updated by Alessandro Pasotti over 6 years ago

@Andreas, there is really a lot of things going on here and I need more information to track this down:

- are there any previous configurations in the settings?
- are the QGIS settings migrated from previous?

A possible cause:
- you have an auth cfg in a WMS settings on qgis2
- the migration routine will copy that WMS to the new settings, with its auth cfg
- the migration routine does NOT copy the qgis-auth.db (that would be a separate, AFAIK unreported bug)
- when you try to open the WMS, the auth config is searched in the (new, empty) auth DB without success

Does it make sense to you? All error messages from QGIS make sense: what it sais is that a given auth cfg is not in the DB (because it wasn't migrated).

If all that makes sense: please close this bug and file a new one for migrating (just copying) the auth DB from a pre-existing QGIS2 installation to the new QGIS3 default profile on first run.

#6 Updated by Alessandro Pasotti over 6 years ago

I filed #17403 myself

#7 Updated by Alessandro Pasotti over 6 years ago

  • Status changed from Open to Closed
  • Resolution set to not reproducable

#8 Updated by Patrick Dunford over 6 years ago

This message comes up randomly at startup.

#9 Updated by Harrissou Santanna over 6 years ago

This message comes up randomly at startup.

"It's also shown when you :
- open e.g. the Create a New WMS Connection (you can replace WMS by any of the other db/protocol providers, except Oracle as far i could say)
- click the + button in the Authentication tab of the Settings --> Options dialog

Note that I don't use the authentication feature. And I'm on Windows here, 2a960c5ec1."

This is what I was about to send until I read some comments above and create a new profile user. The QGIS instance that opens does not suffer this bug afaics, no message pops up. Could you try a new profile?

#10 Updated by Richard Duivenvoorde over 6 years ago

  • Status changed from Closed to Reopened

Confirmed here:

Authentication Manager: Auth db query exec() FAILED

Authentication Manager : Query exec() van database voor authenticatie MISLUKT

I see both in master in my local QGIS (Debian self compiled in home network environment) and in a work environment (behind proxy) with a OSGeo4W64 nightly of today.

Just browsing some data and it will pop up...

#11 Updated by Andreas Neumann over 6 years ago

In my setup, this message also pops up, when I open the "Options" dialogue in the "Settings" menu, regardless of which tab is active.

#12 Updated by Giovanni Manghi over 6 years ago

  • Resolution deleted (not reproducable)

#13 Updated by Harrissou Santanna over 6 years ago

Andreas Neumann wrote:

In my setup, this message also pops up, when I open the "Options" dialogue in the "Settings" menu, regardless of which tab is active.

Was not my case before but with b59bd94e I also get the message when I open the Options dialog (on Windows) and only with the "default" profile

#14 Updated by Mathieu Pellerin - nIRV over 6 years ago

  • Regression? changed from No to Yes
  • Status changed from Reopened to Closed
  • Resolution set to fixed/implemented

Also available in: Atom PDF