Bug report #4259
Get "no password supplied" error but cannot provide one
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||fixed|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||14203|
When I run GRASS's v.in.ogr.qgis via the GRASS plugin, I get this error:
*v.in.ogr -o "dsn=PG:dbname='de' host=localhost port=5432 user='postgres' sslmode=disable" "layer=raw.TxDOT crash" "where="Cnty_ID" = 57" output=pointdata snap=-1 min_area=0.0001
ERROR 1: PQconnectdb failed.
fe_sendauth: no password supplied
￼Unable to open data source
Finished with error*
The problem is there is no place to enter a password in the dialog.
I can only make a guess as to what's going on. I did not tell QGIS to remember the password for security reasons. But it shouldn't matter whether I check this--QGIS should remember the password for the duration of the session, right?
#2 Updated by Giovanni Manghi about 10 years ago
Aren Cambre wrote:
Confirmed: when the DB connection is set to remember the password, GRASS has no problem. This seems like a problem when you're dealing with sensitive data; it's preferable to not have the password stored in clear text on the hard drive.
is this really a QGIS problem or a GRASS one? Did you try to import a Postgis vector into native GRASS?
#4 Updated by Aren Cambre about 10 years ago
- Resolution deleted (
This is minimally a UI bug.
A user may decline to save the password in the connection if he doesn't want the password stored on clear text on the hard drive. This is is a valid measure to increase security. If this happens, QGIS prompts the user the first time the connection is accessed in the user session.
The UI problem is twofold:
1. Nowhere in the UI does it tell me that I needed to save the password in the connection for GRASS to work.
2. If I didn't save the password, I have no opportunity to re-enter a password.
And I don't think it's a UI problem. Even if I don't save the password in the connection, QGIS does know the password for the duration of the QGIS session. How do I know? After I type in a password for the first time, all subsequent accesses to the same connection don't re-prompt me for the password. So if QGIS "remembers" the password for the user session, why can't it share it with GRASS when it fires off a GRASS module?
#6 Updated by Aren Cambre about 10 years ago
- File posrgresConnection.png added
- Resolution deleted (
I understand. QGIS constructs a connection string for GRASS, which is passed to GRASS in the command line.
That's not the issue.
The problem is if I don't check Save Password in the Create a New PostGIS connection dialog (what you get after hitting New or Edit in the Add PostGIS Table dialog) in QGIS when setting up a connection--way before I can even think about doing anything with GRASS--then QGIS declines to provide the password to GRASS.
Why does does saving the password have anything to do with whether QGIS provides the password to GRASS? There is no logical connection between the two, hence it's unintuitive. It's not explained anywhere in the UI.QGIS should do one of:
- Provide the password to GRASS even if it's not saved in the connection. QGIS does know the password if I've opened the PostGIS layer upon which I want it to operate. QGIS prompted me for a password when I opened the layer. See the attached image.
- When I invoke a GRASS module and I didn't save the password in the connection file, allow me the opportunity to specify a password instead of just causing an error.
- At least inform me of the problem, that QGIS can't give GRASS the password because QGIS needs me to save the password in the connection before invoking grass.
- Only the least secure state for password management is valid for interacting with GRASS.
- The UI is not going to tell anyone about this, nor will it allow the user to provide a password to GRASS, forcing more secure users to play a large guessing game every time they invoke GRASS.