OperationalError on all queries
See original GitHub issueDescription
I get the following error when I start pgcli:
Exception in thread completion_refresh:
Traceback (most recent call last):
File "/usr/lib64/python2.7/threading.py", line 812, in __bootstrap_inner
self.run()
File "/usr/lib64/python2.7/threading.py", line 765, in run
self.__target(*self.__args, **self.__kwargs)
File "/usr/lib/python2.7/site-packages/pgcli/completion_refresher.py", line 60, in _bg_refresh
**e.extra_args)
File "/usr/lib/python2.7/site-packages/pgcli/pgexecute.py", line 173, in __init__
self.connect()
File "/usr/lib/python2.7/site-packages/pgcli/pgexecute.py", line 198, in connect
**kwargs)
File "/usr/lib64/python2.7/site-packages/psycopg2/__init__.py", line 130, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
OperationalError: could not translate host name " /tmp" to address: Name or service not known
I can execute psql commands fine, but all queries just return the above error, as well.
Your environment
Centos 7 Python 2.7.5 Installed pgcli via pip Postgres version 10.3
I’ve tried installing pgcli on an empty virtualenv, but get the same results.
pip freeze:
backports.csv==1.0.5
backports.ssl-match-hostname==3.4.0.2
chardet==2.2.1
cli-helpers==1.0.1
click==6.7
configobj==5.0.6
decorator==3.4.0
fail2ban==0.9.7
humanize==0.5.1
iniparse==0.4
iotop==0.6
kitchen==1.1.1
langtable==0.0.31
perf==0.1
pgcli==1.9.0
pgspecial==1.10.0
prompt-toolkit==1.0.15
psycopg2-binary==2.7.4
pycurl==7.19.0
Pygments==2.2.0
pygobject==3.22.0
pygpgme==0.3
pyliblzma==0.5.3
python-augeas==0.5.0
python-dmidecode==3.10.13
python-linux-procfs==0.4.9
pyudev==0.15
pyxattr==0.5.1
schedutils==0.4
setproctitle==1.1.10
six==1.9.0
slip==0.4.0
slip.dbus==0.4.0
sqlparse==0.2.4
tabulate==0.8.2
terminaltables==3.1.0
urlgrabber==3.10
virtualenv==15.2.0
wcwidth==0.1.7
yum-langpacks==0.4.2
yum-metadata-parser==1.1.4
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:6 (2 by maintainers)
Top Results From Across the Web
python - SQL operational error while searching for a query in ...
This is a follow up from this question: SQL query, IMDB data : To find an actors who did more films with Yash...
Read more >OperationalError: sorry, too many clients already - Django Forum
So, I tried running the query and immediately picking some PID's and ports to see if there were any active processes running with...
Read more >sqlite3.OperationalError: no such table: playbooks #263 - GitHub
After running a playbook which does something, it works better indeed. However I think the tool could be enhanced to detect an empty...
Read more >SQL Part 2: Working with Databases through Python
Identifying SQL-Specific Errors: sqlite3.OperationalError ... This exception is generated by SQLite3, usually when our query syntax is incorrect. When you receive ...
Read more >MySQLdb._exceptions.OperationalError: (2006, '') when ...
So when I get a MySQLdb._exceptions.OperationalError: (2006, '') when closing a SQL query. Is it because of the connection? mysql- ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sure!
This is from the same machine as expressed in my initial report:
pgcli will only work as expected with the following command:
pgcli -U postgres -h localhost
For what it’s worth, I’m running into the same problem and @joaodlf’s workaround is working.