Bug report #4259

Get "no password supplied" error but cannot provide one

Added by Aren Cambre over 13 years ago. Updated almost 13 years ago.

Status:Closed
Priority:High
Assignee:-
Category:GRASS
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

Description

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?

posrgresConnection.png (27.4 KB) Aren Cambre, 2011-09-05 07:01 AM


Related issues

Duplicated by QGIS Application - Bug report #5135: Spurious "Password" field in some GRASS modules Closed 2012-03-08

Associated revisions

History

#1 Updated by Aren Cambre over 13 years ago

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.

#2 Updated by Giovanni Manghi over 13 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?

#3 Updated by Paolo Cavallini over 13 years ago

  • Status changed from Open to Rejected
  • Resolution set to invalid

You have to define connection parameters to the DB before running the command.

#4 Updated by Aren Cambre over 13 years ago

  • Resolution deleted (invalid)

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?

#5 Updated by Paolo Cavallini over 13 years ago

  • Resolution set to invalid

GRASS does not use, by design, QGIS connection. Please read GRASS docs.

#6 Updated by Aren Cambre over 13 years ago

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:
  1. 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.
  2. 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.
  3. 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.
If you keep this as invalid, you're saying that:
  1. Only the least secure state for password management is valid for interacting with GRASS.
  2. 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.

#7 Updated by Aren Cambre almost 13 years ago

  • Affected QGIS version set to master
  • Crashes QGIS or corrupts data set to No

Any chance this can be reconsidered? At a minimum, the UI could be improved to make this more clear to users.

#8 Updated by Jürgen Fischer almost 13 years ago

  • Resolution set to fixed
  • Status changed from Rejected to Closed

Also available in: Atom PDF