Bug report #17385

No auth-db saved

Added by Bernhard Ströbl over 2 years ago. Updated over 2 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:invalid
Crashes QGIS or corrupts data:No Copied to github as #:25282

Description

master does not save an auth-db:
  1. go to Settings - Options- Authentication
  2. click on the + Button to add a new authentication
  3. enter your credentials (I entered user/password for a postgres-DB)
  4. click Save
  5. Click OK to close the Options dialogue, the new configuration is listed
  6. Close QGIS
  7. Open QGIS and go to Settings - Options- Authentication: the configuration list is empty
  8. neither is there a qgis-auth.db at $HOME/.local/share/QGIS/QGIS3/profiles/default

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

History

#1 Updated by Bernhard Ströbl over 2 years ago

maybe I should add this is code revision 1ffc3fd
more details: I did not have a qgis-auth.db in the first place, so to reproduce delete/rename yours before starting QGIS

#2 Updated by Alessandro Pasotti over 2 years ago

Can you please attach the logs?

#3 Updated by Bernhard Ströbl over 2 years ago

This is written to the Linux console if starting QGIS from there:
WARNING: Auth db query exec() FAILED
Warning: void DBusMenuExporterPrivate::addAction(QAction*, int): Already tracking action "&Toolbox" under id 268
Warning: void DBusMenuExporterPrivate::addAction(QAction*, int): Already tracking action "&Results Viewer" under id 269
Warning: QMetaObject::invokeMethod: No such method QMenuBar::aboutToShow()
Warning 4: Failed to open /path/to/qgis_master/share/qgis/resources/data/world_map.shp, Keine Berechtigung.
Warning 4: Failed to open /path/to/qgis_master/share/qgis/resources/data/world_map.shp, Keine Berechtigung.
salt hex: e38a089e17abf133bb3e971f6aa49c74
hash hex: 5113dda5436d913198726f0efae6ba78
cipheriv hex: fc1be7b65d12505c9ddaf9f018ec194be60bd44bd0f7f08ec66339e309448a11
Warning: QMetaObject::invokeMethod: No such method QMenuBar::aboutToShow()
Warning: QMetaObject::invokeMethod: No such method QMenuBar::aboutToShow()

Allessandro, did you mean this?

#4 Updated by Alessandro Pasotti over 2 years ago

yes, thanks!

#5 Updated by Giovanni Manghi over 2 years ago

  • Regression? changed from No to Yes

#6 Updated by Andreas Neumann over 2 years ago

@Bernhard - can you try creating a new, virgin profile, change to it and see if auth-manager works fine there?

In my case, all the issues I had in the default profile, were gone. See issue #17386

Also multiple crashes I always (reproducibly) had in the default profile were gone. See issue nr #17357

So I wonder if it could be that over the months of QGIS 3 development, garbage accummulated, or maybe the table layouts of the qgis-auth.db file is now different than it used to be in the past, and this may cause issues?

#7 Updated by Bernhard Ströbl over 2 years ago

I didn't fiddle around with profiles until now, so that's what I did:
  1. In Settings I chose User Profiles - New Profile
  2. I did the steps above (1 to 8) to add a new configuration

no success, the configuration is not saved

#8 Updated by Darek Bobak over 2 years ago

The problem occurs in Windows also. No qgis-auth.db is saved, even in completely fresh profile.

#9 Updated by Alessandro Pasotti over 2 years ago

I've run some manual tests: so far so good, please repeat/verify on your local installation

Note: this is a clean test that assume no previous QGIS installations have been made on the system, on Linux is pretty easy to clean up a system by removing/renaming the settings files/folder as explained in the first step in "Test 1". Other O.S. has similar ways to clean up the settings.
It is always possible to obtain the auth DB path by issuing the following commands in the python console:

QgsApplication.authManager().authenticationDatabasePath()

Test 1 (clean):
- remove/rename all pre-existing .qgis2/ .qgis3/ .local/share/QGIS/ and any other pre-existing qgis-auth.db from your home folder
- remove any pre-existing QGIS password from your O.S. wallet/password manager/keychain
- start your brand new fresh QGIS3-master
- open options->authentication and click on "+" to create a new auth config
- a dialog to set the master password will open
- fill in the form with your new master password and save
- create the new "Basic" configuration and save
- exit QGIS
- start QGIS and verify that the new Basic configuration has been stored
- now create a new one "Basic2" configuration and save
- exit QGIS
- start QGIS
- verify that "Basic" and "Basic2" are in options->authentication

Test 2 (profile)
- from a clean installation: perform "Test 1"
- start QGIS
- create a new profile "myprofile" from settings->user profiles->new profile
- switch to the the new "myprofile" QGIS instance window
- from options->authentication verify that there are not any authentication configurations in the DB
- create a new "Basic My" authentication congiguration and save
- close all QGIS instances
- start QGIS and activate "myprofile"
- from options->authentication verify that the "Basic My" auth config is there and has the right content

@Andreas, AFAIK the DB table structure has not changed.

#10 Updated by Bernhard Ströbl over 2 years ago

Hi Alessandro,
bad news, it does not work any better today:

Alessandro Pasotti wrote:

Test 1 (clean):
- remove/rename all pre-existing .qgis2/ .qgis3/ .local/share/QGIS/ and any other pre-existing qgis-auth.db from your home folder

done, either renamed (.qgis2) or deleted

- remove any pre-existing QGIS password from your O.S. wallet/password manager/keychain

done

- start your brand new fresh QGIS3-master

done, freshly compiled 17aa88c

- open options->authentication and click on "+" to create a new auth config
- a dialog to set the master password will open
- fill in the form with your new master password and save

done

- create the new "Basic" configuration and save

done

- exit QGIS
- start QGIS and verify that the new Basic configuration has been stored

has not been stored, no qgis-quth.db in the default profile, when entering settings - options - authentication I am (again) asked to set the master password

#11 Updated by Alessandro Pasotti over 2 years ago

Thanks for testing, unfortunately I still cannot reproduce this issue, all the a.m. tests are passing for me.

What platform are you testing on?
How did you build QGIS?

When you say:
"has not been stored, no qgis-quth.db in the default profile, when entering settings - options - authentication I am (again) asked to set the master password"
does it also mean that your list of authentication configurations is empty?

#12 Updated by Bernhard Ströbl over 2 years ago

System Ubuntu 16.04 (64bit)
I realized that the building guide received an update. I will go thoroughly through all the steps again an call back
yes, the list was empty after the restart (no qgis-auth.db no list)

#13 Updated by Alessandro Pasotti over 2 years ago

Trying to understand what could step in between: how are you managing the master password when asked to create it?

Are you storing it in the wallet as is the default option?

What if you re-open the newly created auth configuration righ after you create it (before restarting QGIS)? Like in:

Test 3 (clean):
- remove/rename all pre-existing .qgis2/ .qgis3/ .local/share/QGIS/ and any other pre-existing qgis-auth.db from your home folder
- remove any pre-existing QGIS password from your O.S. wallet/password manager/keychain
- start your brand new fresh QGIS3-master
- open options->authentication and click on "+" to create a new auth config
- a dialog to set the master password will open
- fill in the form with your new master password and save
- create the new "Basic" configuration and save
- re-open the "Basic" configuration by clicking on it in the options->authentication list
- verify that the content is correct
- before exiting QGIS check if the qgis-auth.db file was created in the user profile folder, like in:

ls ~/.local/share/QGIS/QGIS3/profiles/default/qgis-auth.db 
/home/user/.local/share/QGIS/QGIS3/profiles/default/qgis-auth.db

#14 Updated by Bernhard Ströbl over 2 years ago

  • Status changed from Open to Closed

OK,
sorry for bothering you, seems to be my fault:
After completely removing my compile directory and freshly compiling in a new one the issue is gone
my apologies for the noise

#15 Updated by Alessandro Pasotti over 2 years ago

No need to aplogise, there is no worse tester that a developer and that's why we need people like you that keeps testing and find and report issues!

#16 Updated by Darek Bobak over 2 years ago

Is the problem corrected in the OSGEO4W install? Because in my new, fresh install (installed on the new account on Windows on virtual machine - in a completely fresh environment) the problem still exist.

QGIS version
2.99.0-Master
QGIS code revision
af6b4cc791
Compiled against Qt
5.9.2
Running against Qt
5.9.2
Compiled against GDAL/OGR
2.2.2
Running against GDAL/OGR
2.2.2
Compiled against GEOS
3.5.0-CAPI-1.9.0
Running against GEOS
3.5.0-CAPI-1.9.0 r4084
PostgreSQL Client Version
9.2.4
SpatiaLite Version
4.3.0
QWT Version
6.1.3
PROJ.4 Version
493
QScintilla2 Version
2.10.1
This copy of QGIS writes debugging output.

#17 Updated by Patrick Dunford over 2 years ago

Is this related to the message shown. This message comes up randomly for auth_db on some of my computers.

#18 Updated by Giovanni Manghi over 2 years ago

  • Resolution set to invalid

Patrick Dunford wrote:

Is this related to the message shown. This message comes up randomly for auth_db on some of my computers.

tried this suggestions? #17385-13

[EDIT: Links to notes are #ticket-notenumber]

Also available in: Atom PDF