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

Getting password information from keyring crashes pgcli, using keyring pass #1338

Closed
3 tasks done
YarekTyshchenko opened this issue May 19, 2022 · 0 comments · Fixed by #1347
Closed
3 tasks done

Getting password information from keyring crashes pgcli, using keyring pass #1338

YarekTyshchenko opened this issue May 19, 2022 · 0 comments · Fixed by #1347
Labels

Comments

@YarekTyshchenko
Copy link

YarekTyshchenko commented May 19, 2022

Description

Getting password information from keyring crashes pgcli, using keyring pass.

Expected behaviour is that pgcli assumes that password is not in the keyring.

Error: failed to retrieve secret "python-keyring/pgcli/foo@localhost": entry is not in the password store
Traceback (most recent call last):
  File "/usr/bin/pgcli", line 33, in <module>
    sys.exit(load_entry_point('pgcli==3.1.0', 'console_scripts', 'pgcli')())
  File "/usr/lib/python3/dist-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/pgcli/main.py", line 1313, in cli
    pgcli.connect(database, host, user, port)
  File "/usr/lib/python3/dist-packages/pgcli/main.py", line 531, in connect
    passwd = keyring.get_password("pgcli", key)
  File "/usr/lib/python3/dist-packages/keyring/core.py", line 55, in get_password
    return get_keyring().get_password(service_name, username)
  File "/home/yarek/.local/lib/python3.9/site-packages/keyring_pass/__init__.py", line 70, in get_password
    ret = command(['pass', 'show', self.get_key(servicename, username)])
  File "/home/yarek/.local/lib/python3.9/site-packages/keyring_pass/__init__.py", line 16, in command
    output = subprocess.check_output(cmd, **kwargs)
  File "/usr/lib/python3.9/subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['pass', 'show', 'python-keyring/pgcli/foo@localhost']' returned non-zero exit status 11.

The command used is gopass, pass returns exit code 1. However, the command failure should not stop pgcli from continuing and assuming password is not in the keyring.

Your environment

Linux, Ubuntu 21.10
pgcli
Version: 3.1.0

  • Please provide your OS and version information.
  • Please provide your CLI version.
  • What is the output of pip freeze command.

Pip freeze:

adal==1.2.7
adblock==0.5.1
antlr4-python3-runtime==4.7.2
apparmor==3.0.3
applicationinsights==0.11.10
argcomplete==1.8.1
asciinema==2.0.2
asgiref==3.3.0
attrs==20.3.0
autobahn==17.10.1
Automat==20.2.0
azure-appconfiguration==1.1.1
azure-batch==11.0.0
azure-cli==2.32.0
azure-cli-core==2.32.0
azure-cli-telemetry==1.0.6
azure-common==1.1.27
azure-core==1.21.1
azure-cosmos==3.2.0
azure-datalake-store==0.0.52
azure-graphrbac==0.60.0
azure-identity==1.7.1
azure-keyvault==1.1.0
azure-keyvault-administration==4.0.0b3
azure-keyvault-keys==4.5.0b4
azure-loganalytics==0.1.1
azure-mgmt-advisor==9.0.0
azure-mgmt-apimanagement==0.2.0
azure-mgmt-appconfiguration==2.0.0
azure-mgmt-applicationinsights==1.0.0
azure-mgmt-authorization==0.61.0
azure-mgmt-batch==16.0.0
azure-mgmt-batchai==7.0.0b1
azure-mgmt-billing==6.0.0
azure-mgmt-botservice==0.3.0
azure-mgmt-cdn==11.0.0
azure-mgmt-cognitiveservices==13.0.0
azure-mgmt-compute==23.1.0
azure-mgmt-consumption==2.0.0
azure-mgmt-containerinstance==9.1.0
azure-mgmt-containerregistry==8.2.0
azure-mgmt-containerservice==16.1.0
azure-mgmt-core==1.3.0
azure-mgmt-cosmosdb==7.0.0b2
azure-mgmt-databoxedge==1.0.0
azure-mgmt-datalake-analytics==0.2.1
azure-mgmt-datalake-nspkg==3.0.1
azure-mgmt-datalake-store==0.5.0
azure-mgmt-datamigration==10.0.0
azure-mgmt-deploymentmanager==0.2.0
azure-mgmt-devtestlabs==4.0.0
azure-mgmt-dns==8.0.0
azure-mgmt-eventgrid==9.0.0
azure-mgmt-eventhub==9.1.0
azure-mgmt-extendedlocation==1.0.0
azure-mgmt-hdinsight==9.0.0
azure-mgmt-imagebuilder==1.0.0
azure-mgmt-iotcentral==9.0.0
azure-mgmt-iothub==2.1.0
azure-mgmt-iothubprovisioningservices==1.0.0
azure-mgmt-keyvault==9.3.0
azure-mgmt-kusto==0.3.0
azure-mgmt-loganalytics==12.0.0
azure-mgmt-managedservices==1.0.0
azure-mgmt-managementgroups==0.2.0
azure-mgmt-maps==2.0.0
azure-mgmt-marketplaceordering==1.1.0
azure-mgmt-media==7.0.0
azure-mgmt-monitor==3.0.0
azure-mgmt-msi==0.2.0
azure-mgmt-netapp==5.1.0
azure-mgmt-network==19.3.0
azure-mgmt-nspkg==3.0.2
azure-mgmt-policyinsights==1.0.0
azure-mgmt-privatedns==1.0.0
azure-mgmt-rdbms==10.0.0
azure-mgmt-recoveryservices==2.0.0
azure-mgmt-recoveryservicesbackup==4.0.0
azure-mgmt-redhatopenshift==1.0.0
azure-mgmt-redis==13.1.0
azure-mgmt-relay==0.1.0
azure-mgmt-reservations==0.6.0
azure-mgmt-resource==20.0.0
azure-mgmt-search==8.0.0
azure-mgmt-security==2.0.0b1
azure-mgmt-servicebus==6.0.0
azure-mgmt-servicefabric==1.0.0
azure-mgmt-servicefabricmanagedclusters==1.0.0
azure-mgmt-servicelinker==1.0.0b1
azure-mgmt-signalr==1.0.0
azure-mgmt-sql==3.0.1
azure-mgmt-sqlvirtualmachine==1.0.0b1
azure-mgmt-storage==19.0.0
azure-mgmt-synapse==2.1.0b3
azure-mgmt-trafficmanager==0.51.0
azure-mgmt-web==4.0.0
azure-multiapi-storage==0.7.0
azure-nspkg==3.0.2
azure-storage-common==1.4.2
azure-synapse-accesscontrol==0.5.0
azure-synapse-artifacts==0.10.0
azure-synapse-managedprivateendpoints==0.3.0
azure-synapse-spark==0.2.0
bcrypt==3.1.7
beautifulsoup4==4.9.3
blinker==1.4
bottle==0.12.19
Brotli==1.0.9
cachetools==4.2.1
cbor==1.0.0
certifi==2020.6.20
cffi==1.15.0
chardet==3.0.4
cli-helpers==2.1.0
click==7.1.2
colorama==0.4.4
command-not-found==0.3
configobj==5.0.6
constantly==15.1.0
cryptography==3.3.2
cycler==0.10.0
Cython==0.29.21
dbus-python==1.2.16
Deprecated==1.2.13
distro==1.5.0
distro-info==1.0
dnspython==1.16.0
docker==5.0.3
docker-compose==1.29.2
dockerpty==0.4.1
docopt==0.6.2
docutils==0.18.1
ecdsa==0.16.1
fabric==2.6.0
fasteners==0.14.1
Flask==1.1.2
future==0.18.2
gcalcli==4.3.0
GeoIP==1.3.2
Glances==3.1.5
google-api-python-client==1.7.11
google-auth==1.5.1
google-auth-httplib2==0.0.4
gyp==0.1
h11==0.12.0
h2==4.0.0
hkdf==0.0.3
hpack==4.0.0
html5lib==1.1
httpie==2.4.0
httplib2==0.18.1
humanfriendly==10.0
humanize==0.0.0
hyperframe==6.0.0
hyperlink==19.0.0
idna==2.10
importlib-metadata==4.0.1
incremental==17.5.0
influxdb==5.2.3
invoke==1.6.0
iotop==0.6
isodate==0.6.1
itsdangerous==1.1.0
javaproperties==0.5.2
jeepney==0.7.1
Jinja2==2.11.3
jmespath==0.10.0
jsondiff==1.3.0
jsonschema==3.2.0
kaitaistruct==0.9
keyring==23.0.1
keyring-pass==0.7.0
kiwisolver==1.3.1
knack==0.9.0
launchpadlib==1.10.13
lazr.restfulclient==0.14.2
lazr.uri==1.0.5
ldap3==2.8.1
LibAppArmor==3.0.3
libvirt-python==7.6.0
lxml==4.6.3
lz4==3.1.3+dfsg
magic-wormhole==0.12.0
Markdown==3.3.4
MarkupSafe==1.1.1
matplotlib==3.3.4
mitmproxy==6.0.2
monotonic==1.5
more-itertools==4.2.0
msal==1.16.0
msal-extensions==0.3.1
msgpack==1.0.0
msrest==0.6.21
msrestazure==0.6.4
netaddr==0.8.0
netifaces==0.10.9
numpy==1.19.5
nvpy==2.1.0
oauth2client==4.1.3
oauthlib==3.1.0
olefile==0.46
packaging==21.3
paramiko==2.9.2
parsedatetime==2.6
pass-audit==1.1
passlib==1.7.4
pathlib2==2.3.6
pendulum==2.1.2
pexpect==4.8.0
pgcli==3.1.0
pgspecial==1.11.10
Pillow==8.1.2
pkginfo==1.8.2
ply==3.11
portalocker==1.7.1
prompt-toolkit==3.0.19
protobuf==3.12.4
psutil==5.8.0
psycopg2==2.8.6
publicsuffix2==2.20191221
py-ubjson==0.16.1
pyasn1==0.4.8
pyasn1-modules==0.2.1
pycairo==1.16.2
pycparser==2.21
pycryptodomex==3.9.7
PyGithub==1.55
Pygments==2.7.1
PyGObject==3.40.1
PyHamcrest==1.9.0
PyICU==2.5
pyinotify==0.9.6
PyJWT==2.3.0
PyNaCl==1.4.0
pyOpenSSL==20.0.1
pyparsing==2.4.7
pyperclip==1.8.0
pypng==0.0.20
PyQRCode==1.2.1
PyQt5==5.15.4
PyQt5-sip==12.9.0
PyQtWebEngine==5.15.4
pyrsistent==0.18.0
pysmi==0.3.2
pysnmp==4.4.12
PySocks==1.7.1
pystache==0.5.4
python-apt==2.2.1
python-dateutil==2.8.1
python-debian===0.1.39ubuntu1
python-dotenv==0.19.2
python-snappy==0.5.3
PyTrie==0.2
pytz==2021.1
pytzdata==2020.1
PyYAML==5.3.1
qutebrowser==2.0.2
requests==2.25.1
requests-file==1.5.1
requests-oauthlib==1.3.0
requests-toolbelt==0.9.1
rsa==4.0
ruamel.yaml==0.16.12
ruamel.yaml.clib==0.2.2
scp==0.13.6
screen-resolution-extra==0.0.0
SecretStorage==3.3.1
semver==2.13.0
service-identity==18.1.0
setproctitle==1.2.1
simplejson==3.17.2
simplenote==2.1.4
six==1.16.0
sortedcontainers==2.1.0
sos==4.3
soupsieve==2.2.1
spake2==0.8
speedtest-cli==2.1.3
SQLAlchemy==1.3.22
sqlparse==0.4.1
ssh-import-id==5.11
sshtunnel==0.1.5
systemd-python==234
tabulate==0.8.7
terminaltables==3.1.0
texttable==1.6.4
tldextract==2.2.1
tornado==6.1
tqdm==4.57.0
Twisted==20.3.0
txaio==20.4.1
txtorcon==20.0.0
u-msgpack-python==2.3.0
ubuntu-advantage-tools==27.8
ubuntu-drivers-common==0.0.0
ufw==0.36.1
unattended-upgrades==0.1
uritemplate==3.0.1
urllib3==1.26.5
urwid==2.1.2
vobject==0.9.6.1
wadllib==1.3.5
wcwidth==0.1.9
webencodings==0.5.1
websocket-client==0.56.0
Werkzeug==1.0.1
wrapt==1.13.3
wsaccel==0.6.2
wsproto==0.15.0
xkcdpass==1.16.5
xkit==0.0.0
xmltodict==0.12.0
zipp==1.0.0
zope.interface==5.2.0
zxcvbn==4.4.28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants