Advertisement
Guest User

Untitled

a guest
Jul 7th, 2017
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.53 KB | None | 0 0
  1. Error Message
  2.  
  3. sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not translate host name "musicbrainz_db" to address: Name or service not known
  4.  
  5. Stacktrace
  6.  
  7. self = Engine(postgresql://musicbrainz:***@musicbrainz_db:5432/musicbrainz_db)
  8. fn = <bound method Pool.connect of <sqlalchemy.pool.NullPool object at 0x7f48e37ff4a8>>
  9. connection = None
  10.  
  11. def _wrap_pool_connect(self, fn, connection):
  12. dialect = self.dialect
  13. try:
  14. > return fn()
  15.  
  16. /usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py:2147:
  17. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  18.  
  19. self = <sqlalchemy.pool.NullPool object at 0x7f48e37ff4a8>
  20.  
  21. def connect(self):
  22. """Return a DBAPI connection from the pool.
  23.  
  24. The connection is instrumented such that when its
  25. ``close()`` method is called, the connection will be returned to
  26. the pool.
  27.  
  28. """
  29. if not self._use_threadlocal:
  30. > return _ConnectionFairy._checkout(self)
  31.  
  32. /usr/local/lib/python3.6/site-packages/sqlalchemy/pool.py:387:
  33. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  34.  
  35. cls = <class 'sqlalchemy.pool._ConnectionFairy'>
  36. pool = <sqlalchemy.pool.NullPool object at 0x7f48e37ff4a8>, threadconns = None
  37. fairy = None
  38.  
  39. @classmethod
  40. def _checkout(cls, pool, threadconns=None, fairy=None):
  41. if not fairy:
  42. > fairy = _ConnectionRecord.checkout(pool)
  43.  
  44. /usr/local/lib/python3.6/site-packages/sqlalchemy/pool.py:766:
  45. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  46.  
  47. cls = <class 'sqlalchemy.pool._ConnectionRecord'>
  48. pool = <sqlalchemy.pool.NullPool object at 0x7f48e37ff4a8>
  49.  
  50. @classmethod
  51. def checkout(cls, pool):
  52. > rec = pool._do_get()
  53.  
  54. /usr/local/lib/python3.6/site-packages/sqlalchemy/pool.py:516:
  55. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  56.  
  57. self = <sqlalchemy.pool.NullPool object at 0x7f48e37ff4a8>
  58.  
  59. def _do_get(self):
  60. > return self._create_connection()
  61.  
  62. /usr/local/lib/python3.6/site-packages/sqlalchemy/pool.py:1229:
  63. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  64.  
  65. self = <sqlalchemy.pool.NullPool object at 0x7f48e37ff4a8>
  66.  
  67. def _create_connection(self):
  68. """Called by subclasses to create a new ConnectionRecord."""
  69.  
  70. > return _ConnectionRecord(self)
  71.  
  72. /usr/local/lib/python3.6/site-packages/sqlalchemy/pool.py:333:
  73. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  74.  
  75. self = <sqlalchemy.pool._ConnectionRecord object at 0x7f48e26669b0>
  76. pool = <sqlalchemy.pool.NullPool object at 0x7f48e37ff4a8>, connect = True
  77.  
  78. def __init__(self, pool, connect=True):
  79. self.__pool = pool
  80. if connect:
  81. > self.__connect(first_connect_check=True)
  82.  
  83. /usr/local/lib/python3.6/site-packages/sqlalchemy/pool.py:461:
  84. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  85.  
  86. self = <sqlalchemy.pool._ConnectionRecord object at 0x7f48e26669b0>
  87. first_connect_check = True
  88.  
  89. def __connect(self, first_connect_check=False):
  90. pool = self.__pool
  91.  
  92. # ensure any existing connection is removed, so that if
  93. # creator fails, this attribute stays None
  94. self.connection = None
  95. try:
  96. self.starttime = time.time()
  97. > connection = pool._invoke_creator(self)
  98.  
  99. /usr/local/lib/python3.6/site-packages/sqlalchemy/pool.py:651:
  100. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  101.  
  102. connection_record = <sqlalchemy.pool._ConnectionRecord object at 0x7f48e26669b0>
  103.  
  104. def connect(connection_record=None):
  105. if dialect._has_events:
  106. for fn in dialect.dispatch.do_connect:
  107. connection = fn(
  108. dialect, connection_record, cargs, cparams)
  109. if connection is not None:
  110. return connection
  111. > return dialect.connect(*cargs, **cparams)
  112.  
  113. /usr/local/lib/python3.6/site-packages/sqlalchemy/engine/strategies.py:105:
  114. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  115.  
  116. self = <sqlalchemy.dialects.postgresql.psycopg2.PGDialect_psycopg2 object at 0x7f48e37ff550>
  117. cargs = ()
  118. cparams = {'database': 'musicbrainz_db', 'host': 'musicbrainz_db', 'password': 'musicbrainz', 'port': 5432, ...}
  119.  
  120. def connect(self, *cargs, **cparams):
  121. > return self.dbapi.connect(*cargs, **cparams)
  122.  
  123. /usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py:393:
  124. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  125.  
  126. dsn = 'dbname=musicbrainz_db user=musicbrainz password=musicbrainz host=musicbrainz_db port=5432'
  127. database = 'musicbrainz_db', user = 'musicbrainz', password = 'musicbrainz'
  128. host = 'musicbrainz_db', port = 5432, connection_factory = None
  129. cursor_factory = None, async = False, kwargs = {}
  130. items = [('dbname', 'musicbrainz_db'), ('user', 'musicbrainz'), ('password', 'musicbrainz'), ('host', 'musicbrainz_db'), ('port', 5432)]
  131.  
  132. def connect(dsn=None,
  133. database=None, user=None, password=None, host=None, port=None,
  134. connection_factory=None, cursor_factory=None, async=False, **kwargs):
  135. """
  136. Create a new database connection.
  137.  
  138. The connection parameters can be specified either as a string:
  139.  
  140. conn = psycopg2.connect("dbname=test user=postgres password=secret")
  141.  
  142. or using a set of keyword arguments:
  143.  
  144. conn = psycopg2.connect(database="test", user="postgres", password="secret")
  145.  
  146. The basic connection parameters are:
  147.  
  148. - *dbname*: the database name (only in dsn string)
  149. - *database*: the database name (only as keyword argument)
  150. - *user*: user name used to authenticate
  151. - *password*: password used to authenticate
  152. - *host*: database host address (defaults to UNIX socket if not provided)
  153. - *port*: connection port number (defaults to 5432 if not provided)
  154.  
  155. Using the *connection_factory* parameter a different class or connections
  156. factory can be specified. It should be a callable object taking a dsn
  157. argument.
  158.  
  159. Using the *cursor_factory* parameter, a new default cursor factory will be
  160. used by cursor().
  161.  
  162. Using *async*=True an asynchronous connection will be created.
  163.  
  164. Any other keyword parameter will be passed to the underlying client
  165. library: the list of supported parameters depends on the library version.
  166.  
  167. """
  168. items = []
  169. if database is not None:
  170. items.append(('dbname', database))
  171. if user is not None:
  172. items.append(('user', user))
  173. if password is not None:
  174. items.append(('password', password))
  175. if host is not None:
  176. items.append(('host', host))
  177. if port is not None:
  178. items.append(('port', port))
  179.  
  180. items.extend([(k, v) for (k, v) in kwargs.items() if v is not None])
  181.  
  182. if dsn is not None and items:
  183. raise TypeError(
  184. "'%s' is an invalid keyword argument when the dsn is specified"
  185. % items[0][0])
  186.  
  187. if dsn is None:
  188. if not items:
  189. raise TypeError('missing dsn and no parameters')
  190. else:
  191. dsn = " ".join(["%s=%s" % (k, _param_escape(str(v)))
  192. for (k, v) in items])
  193.  
  194. > conn = _connect(dsn, connection_factory=connection_factory, async=async)
  195. E psycopg2.OperationalError: could not translate host name "musicbrainz_db" to address: Name or service not known
  196.  
  197. /usr/local/lib/python3.6/site-packages/psycopg2/__init__.py:164: OperationalError
  198.  
  199. The above exception was the direct cause of the following exception:
  200.  
  201. self = <critiquebrainz.frontend.views.test.test_release_group.ReleaseGroupViewsTestCase testMethod=test_release_group_page>
  202.  
  203. def test_release_group_page(self):
  204. # Basic release group page should be available.
  205. > response = self.client.get("/release-group/c2e0ff67-fb31-4443-ae0e-22ecf010463b")
  206.  
  207. critiquebrainz/frontend/views/test/test_release_group.py:8:
  208. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  209. /usr/local/lib/python3.6/site-packages/werkzeug/test.py:791: in get
  210. return self.open(*args, **kw)
  211. /usr/local/lib/python3.6/site-packages/flask/testing.py:127: in open
  212. follow_redirects=follow_redirects)
  213. /usr/local/lib/python3.6/site-packages/werkzeug/test.py:764: in open
  214. response = self.run_wsgi_app(environ, buffered=buffered)
  215. /usr/local/lib/python3.6/site-packages/werkzeug/test.py:677: in run_wsgi_app
  216. rv = run_wsgi_app(self.application, environ, buffered=buffered)
  217. /usr/local/lib/python3.6/site-packages/werkzeug/test.py:884: in run_wsgi_app
  218. app_rv = app(environ, start_response)
  219. /usr/local/lib/python3.6/site-packages/flask/app.py:1997: in __call__
  220. return self.wsgi_app(environ, start_response)
  221. /usr/local/lib/python3.6/site-packages/flask/app.py:1985: in wsgi_app
  222. response = self.handle_exception(e)
  223. /usr/local/lib/python3.6/site-packages/flask/app.py:1540: in handle_exception
  224. reraise(exc_type, exc_value, tb)
  225. /usr/local/lib/python3.6/site-packages/flask/_compat.py:33: in reraise
  226. raise value
  227. /usr/local/lib/python3.6/site-packages/flask/app.py:1982: in wsgi_app
  228. response = self.full_dispatch_request()
  229. /usr/local/lib/python3.6/site-packages/flask/app.py:1614: in full_dispatch_request
  230. rv = self.handle_user_exception(e)
  231. /usr/local/lib/python3.6/site-packages/flask/app.py:1517: in handle_user_exception
  232. reraise(exc_type, exc_value, tb)
  233. /usr/local/lib/python3.6/site-packages/flask/_compat.py:33: in reraise
  234. raise value
  235. /usr/local/lib/python3.6/site-packages/flask/app.py:1612: in full_dispatch_request
  236. rv = self.dispatch_request()
  237. /usr/local/lib/python3.6/site-packages/flask/app.py:1598: in dispatch_request
  238. return self.view_functions[rule.endpoint](**req.view_args)
  239. critiquebrainz/frontend/views/release_group.py:18: in entity
  240. release_group = mb_release_group.get_release_group_by_id(id)
  241. critiquebrainz/frontend/external/musicbrainz_db/release_group.py:22: in get_release_group_by_id
  242. includes=['artists', 'releases', 'release-group-rels', 'url-rels', 'work-rels', 'tags']
  243. critiquebrainz/frontend/external/musicbrainz_db/release_group.py:35: in fetch_multiple_release_groups
  244. release_group = get_something_by_gid(query, models.ReleaseGroupGIDRedirect, mbid)
  245. /usr/local/lib/python3.6/site-packages/mbdata/utils/__init__.py:55: in get_something_by_gid
  246. artist = query.filter_by(gid=gid).first()
  247. /usr/local/lib/python3.6/site-packages/sqlalchemy/orm/query.py:2755: in first
  248. ret = list(self[0:1])
  249. /usr/local/lib/python3.6/site-packages/sqlalchemy/orm/query.py:2547: in __getitem__
  250. return list(res)
  251. /usr/local/lib/python3.6/site-packages/sqlalchemy/orm/query.py:2855: in __iter__
  252. return self._execute_and_instances(context)
  253. /usr/local/lib/python3.6/site-packages/sqlalchemy/orm/query.py:2876: in _execute_and_instances
  254. close_with_result=True)
  255. /usr/local/lib/python3.6/site-packages/sqlalchemy/orm/query.py:2885: in _get_bind_args
  256. **kw
  257. /usr/local/lib/python3.6/site-packages/sqlalchemy/orm/query.py:2867: in _connection_from_session
  258. conn = self.session.connection(**kw)
  259. /usr/local/lib/python3.6/site-packages/sqlalchemy/orm/session.py:998: in connection
  260. execution_options=execution_options)
  261. /usr/local/lib/python3.6/site-packages/sqlalchemy/orm/session.py:1003: in _connection_for_bind
  262. engine, execution_options)
  263. /usr/local/lib/python3.6/site-packages/sqlalchemy/orm/session.py:403: in _connection_for_bind
  264. conn = bind.contextual_connect()
  265. /usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py:2112: in contextual_connect
  266. self._wrap_pool_connect(self.pool.connect, None),
  267. /usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py:2151: in _wrap_pool_connect
  268. e, dialect, self)
  269. /usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py:1465: in _handle_dbapi_exception_noconnection
  270. exc_info
  271. /usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py:203: in raise_from_cause
  272. reraise(type(exception), exception, tb=exc_tb, cause=cause)
  273. /usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py:186: in reraise
  274. raise value.with_traceback(tb)
  275. /usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py:2147: in _wrap_pool_connect
  276. return fn()
  277. /usr/local/lib/python3.6/site-packages/sqlalchemy/pool.py:387: in connect
  278. return _ConnectionFairy._checkout(self)
  279. /usr/local/lib/python3.6/site-packages/sqlalchemy/pool.py:766: in _checkout
  280. fairy = _ConnectionRecord.checkout(pool)
  281. /usr/local/lib/python3.6/site-packages/sqlalchemy/pool.py:516: in checkout
  282. rec = pool._do_get()
  283. /usr/local/lib/python3.6/site-packages/sqlalchemy/pool.py:1229: in _do_get
  284. return self._create_connection()
  285. /usr/local/lib/python3.6/site-packages/sqlalchemy/pool.py:333: in _create_connection
  286. return _ConnectionRecord(self)
  287. /usr/local/lib/python3.6/site-packages/sqlalchemy/pool.py:461: in __init__
  288. self.__connect(first_connect_check=True)
  289. /usr/local/lib/python3.6/site-packages/sqlalchemy/pool.py:651: in __connect
  290. connection = pool._invoke_creator(self)
  291. /usr/local/lib/python3.6/site-packages/sqlalchemy/engine/strategies.py:105: in connect
  292. return dialect.connect(*cargs, **cparams)
  293. /usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py:393: in connect
  294. return self.dbapi.connect(*cargs, **cparams)
  295. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  296.  
  297. dsn = 'dbname=musicbrainz_db user=musicbrainz password=musicbrainz host=musicbrainz_db port=5432'
  298. database = 'musicbrainz_db', user = 'musicbrainz', password = 'musicbrainz'
  299. host = 'musicbrainz_db', port = 5432, connection_factory = None
  300. cursor_factory = None, async = False, kwargs = {}
  301. items = [('dbname', 'musicbrainz_db'), ('user', 'musicbrainz'), ('password', 'musicbrainz'), ('host', 'musicbrainz_db'), ('port', 5432)]
  302.  
  303. def connect(dsn=None,
  304. database=None, user=None, password=None, host=None, port=None,
  305. connection_factory=None, cursor_factory=None, async=False, **kwargs):
  306. """
  307. Create a new database connection.
  308.  
  309. The connection parameters can be specified either as a string:
  310.  
  311. conn = psycopg2.connect("dbname=test user=postgres password=secret")
  312.  
  313. or using a set of keyword arguments:
  314.  
  315. conn = psycopg2.connect(database="test", user="postgres", password="secret")
  316.  
  317. The basic connection parameters are:
  318.  
  319. - *dbname*: the database name (only in dsn string)
  320. - *database*: the database name (only as keyword argument)
  321. - *user*: user name used to authenticate
  322. - *password*: password used to authenticate
  323. - *host*: database host address (defaults to UNIX socket if not provided)
  324. - *port*: connection port number (defaults to 5432 if not provided)
  325.  
  326. Using the *connection_factory* parameter a different class or connections
  327. factory can be specified. It should be a callable object taking a dsn
  328. argument.
  329.  
  330. Using the *cursor_factory* parameter, a new default cursor factory will be
  331. used by cursor().
  332.  
  333. Using *async*=True an asynchronous connection will be created.
  334.  
  335. Any other keyword parameter will be passed to the underlying client
  336. library: the list of supported parameters depends on the library version.
  337.  
  338. """
  339. items = []
  340. if database is not None:
  341. items.append(('dbname', database))
  342. if user is not None:
  343. items.append(('user', user))
  344. if password is not None:
  345. items.append(('password', password))
  346. if host is not None:
  347. items.append(('host', host))
  348. if port is not None:
  349. items.append(('port', port))
  350.  
  351. items.extend([(k, v) for (k, v) in kwargs.items() if v is not None])
  352.  
  353. if dsn is not None and items:
  354. raise TypeError(
  355. "'%s' is an invalid keyword argument when the dsn is specified"
  356. % items[0][0])
  357.  
  358. if dsn is None:
  359. if not items:
  360. raise TypeError('missing dsn and no parameters')
  361. else:
  362. dsn = " ".join(["%s=%s" % (k, _param_escape(str(v)))
  363. for (k, v) in items])
  364.  
  365. > conn = _connect(dsn, connection_factory=connection_factory, async=async)
  366. E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not translate host name "musicbrainz_db" to address: Name or service not known
  367.  
  368. /usr/local/lib/python3.6/site-packages/psycopg2/__init__.py:164: OperationalError
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement