Skip to content
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

Database backend – broken Postgres config #6752

Closed
vliubko opened this issue May 17, 2019 · 3 comments
Closed

Database backend – broken Postgres config #6752

vliubko opened this issue May 17, 2019 · 3 comments
Labels
bug Used to indicate a potential bug secret/database

Comments

@vliubko
Copy link

vliubko commented May 17, 2019

Describe the bug
Trying to setup Postgres Backend from official guide https://www.vaultproject.io/docs/secrets/databases/postgresql.html and getting an pg error.
My password contains symbol # and that seems an error for parsing (or validation) of my config.

To Reproduce
Steps to reproduce the behavior:

  1. Run vault secrets enable database
  2. Run vault write database/config/my-postgresql-database \ plugin_name=postgresql-database-plugin \ allowed_roles="my-role" \ connection_url="postgresql://{{username}}:{{password}}@localhost:5432/" \ username="root" \ password="root#"
  3. See error
* error creating database object: error verifying connection: pq: Could not detect default username. Please provide one explicitly

Expected behavior
My PostgreSQL allows me symbol # in password. I spent a lot of time finding what exactly broken my config :)

Environment:

  • Vault Server Version (retrieve with vault status): 1.1.2
  • Vault CLI Version (retrieve with vault version): v1.1.2 ('0082501623c0b704b87b1fbc84c2d725994bac54')
  • Server Operating System/Architecture: Vault server in k8s from helm chart https://github.com/helm/charts/tree/master/incubator/vault
    Vault client MacOS
@ncabatoff
Copy link
Collaborator

I think the issue is that the # character has special meaning in URLs. So because we create a connection_url and expand {{password}} to be something with a #, that breaks parsing of the expanded URL. I don't see any potential workaround here, other than not using that character.

@vliubko
Copy link
Author

vliubko commented Jun 6, 2019

Found it's lib/pq issue.

lib/pq#787

@michelvocks
Copy link
Contributor

I'm going to close this issue since this has been fixed with #7089.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Used to indicate a potential bug secret/database
Projects
None yet
Development

No branches or pull requests

4 participants