Advertisement
Guest User

Untitled

a guest
Mar 8th, 2019
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 361.59 KB | None | 0 0
  1. --------------------------------------------------------------------------------
  2. INFO in middleware [/usr/local/lib/python3.6/site-packages/ddtrace/contrib/flask/middleware.py:31]:
  3. initializing trace middleware
  4. --------------------------------------------------------------------------------
  5. Prearing test env ['manage.py', 'test']
  6. 2019-03-08T18:34:17.363781Z [error ] stdlib_log [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  7. The files belonging to this database system will be owned by user "postgres".
  8. This user must also own the server process.
  9.  
  10. The database cluster will be initialized with locales
  11. COLLATE: C
  12. CTYPE: C.UTF-8
  13. MESSAGES: C
  14. MONETARY: C
  15. NUMERIC: C
  16. TIME: C
  17. The default database encoding has accordingly been set to "UTF8".
  18. The default text search configuration will be set to "english".
  19.  
  20. Data page checksums are disabled.
  21.  
  22. creating directory /tmp/pgtests ... ok
  23. creating subdirectories ... ok
  24. selecting default max_connections ... 100
  25. selecting default shared_buffers ... 128MB
  26. selecting dynamic shared memory implementation ... posix
  27. creating configuration files ... ok
  28. running bootstrap script ... ok
  29. performing post-bootstrap initialization ... sh: locale: not found
  30. 2019-03-08 18:34:17.822 UTC [38] WARNING: no usable system locales were found
  31. ok
  32. syncing data to disk ... ok
  33.  
  34. Success.
  35.  
  36.  
  37. WARNING: enabling "trust" authentication for local connections
  38. You can change this by editing pg_hba.conf or using the option -A, or
  39. --auth-local and --auth-host, the next time you run initdb.
  40. waiting for server to start.... done
  41. server started
  42. create_test_db.sql: No such file or directory
  43. CREATE DATABASE
  44. CREATE ROLE
  45. CREATE DATABASE
  46. CREATE ROLE
  47. 63:C 08 Mar 18:34:24.294 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
  48. 63:C 08 Mar 18:34:24.294 # Redis version=4.0.11, bits=64, commit=2857805f, modified=0, pid=63, just started
  49. 63:C 08 Mar 18:34:24.294 # Configuration loaded
  50. Running tests.
  51. ============================= test session starts ==============================
  52. platform linux -- Python 3.6.8, pytest-3.1.1, py-1.8.0, pluggy-0.4.0
  53. rootdir: /usr/src/app, inifile:
  54. plugins: cov-2.5.1
  55. collected 101 items
  56.  
  57. tests/test_apigee.py ...
  58. tests/test_chatbot.py ...F...F.
  59. tests/test_oauth.py .....F...F.FF
  60. tests/test_oauth_utils.py .................
  61. tests/test_user.py ..FFFF..F.........F.F....FFFFFF...............F..FF
  62. tests/test_utils.py .
  63. tests/test_vaporizer.py .......
  64.  
  65. ----------- coverage: platform linux, python 3.6.8-final-0 -----------
  66. Name Stmts Miss Branch BrPart Cover Missing
  67. ------------------------------------------------------------------------
  68. auth/__init__.py 9 6 0 0 33% 7-17
  69. auth/apigee/__init__.py 0 0 0 0 100%
  70. auth/apigee/views.py 22 1 6 2 89% 16, 15->16, 26->29
  71. auth/app.py 81 17 8 4 76% 29-30, 49-55, 63-64, 83-84, 91-93, 95-97, 124, 41->44, 60->63, 90->91, 94->95
  72. auth/chatbot/__init__.py 0 0 0 0 100%
  73. auth/chatbot/utils.py 38 8 15 7 72% 22-23, 37, 41, 44, 47, 50, 65, 36->37, 40->41, 43->44, 46->47, 49->50, 60->exit, 60->65
  74. auth/chatbot/views.py 61 9 4 1 85% 32-34, 41-42, 73-74, 104-105, 40->41
  75. auth/config.py 92 0 0 0 100%
  76. auth/controllers.py 18 3 6 2 79% 17-19, 16->17, 24->27
  77. auth/error_handlers.py 35 10 3 0 66% 35-36, 42-46, 58-59, 71-72
  78. auth/extensions.py 26 0 0 0 100%
  79. auth/logging/__init__.py 2 0 0 0 100%
  80. auth/logging/config.py 24 1 2 1 92% 51, 50->51
  81. auth/logging/processors.py 29 12 12 1 49% 13, 19-21, 26-27, 44-49, 12->13
  82. auth/mailer.py 32 4 6 1 87% 23-24, 41-42, 40->41
  83. auth/middleware.py 54 2 10 3 92% 78-79, 35->45, 51->55, 58->60
  84. auth/models.py 173 15 34 7 87% 30, 63, 70, 92, 94-95, 107-108, 127, 131-133, 141, 228-229, 62->63, 67->70, 91->92, 93->94, 106->107, 126->127, 140->141
  85. auth/oauth/__init__.py 0 0 0 0 100%
  86. auth/oauth/exceptions.py 9 0 4 1 92% 10->9
  87. auth/oauth/providers.py 7 0 0 0 100%
  88. auth/oauth/utils.py 106 13 29 1 87% 65, 79-82, 180-191, 64->65
  89. auth/oauth/views.py 90 17 2 0 82% 69-71, 99-100, 121-122, 141-146, 160-165
  90. auth/token/__init__.py 0 0 0 0 100%
  91. auth/token/decorators.py 49 10 18 5 75% 18-21, 53-54, 56-57, 61-62, 15->18, 52->53, 55->56, 60->61, 63->65
  92. auth/token/storage.py 65 21 20 7 60% 15, 32-40, 43-51, 66-70, 90-93, 14->15, 62->exit, 65->66, 72->76, 79->exit, 80->83, 87->90
  93. auth/token/utils.py 78 47 22 0 37% 14-45, 49, 66-67, 77-78, 85, 89-91, 95-106
  94. auth/utils.py 56 15 20 5 66% 27, 29, 35-42, 55-61, 26->exit, 26->27, 28->29, 54->55, 62->50
  95. auth/vaporizer/__init__.py 0 0 0 0 100%
  96. auth/vaporizer/utils.py 30 22 8 0 21% 15-36
  97. auth/vaporizer/views.py 47 6 6 1 87% 29, 41-45, 28->29
  98. auth/views.py 275 124 94 9 50% 26, 40, 49, 51, 54-63, 87-102, 110-121, 132-137, 140-158, 164-165, 171, 181-186, 225, 227, 230-243, 254-256, 269-284, 291-308, 320, 361-364, 39->40, 48->49, 50->51, 85->87, 130->132, 180->181, 224->225, 226->227, 318->320
  99. ------------------------------------------------------------------------
  100. TOTAL 1508 363 329 58 71%
  101. Coverage HTML written to dir htmlcov
  102.  
  103.  
  104. =================================== FAILURES ===================================
  105. ________________ ChatbootGoogleCallbackTestCase.test_valid_code ________________
  106.  
  107. self = Connection<host=localhost,port=6379,db=0>
  108.  
  109. def connect(self):
  110. "Connects to the Redis server if not already connected"
  111. if self._sock:
  112. return
  113. try:
  114. > sock = self._connect()
  115.  
  116. /usr/local/lib/python3.6/site-packages/redis/connection.py:484:
  117. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  118.  
  119. self = Connection<host=localhost,port=6379,db=0>
  120.  
  121. def _connect(self):
  122. "Create a TCP socket connection"
  123. # we want to mimic what socket.create_connection does to support
  124. # ipv4/ipv6, but we want to set options prior to calling
  125. # socket.connect()
  126. err = None
  127. for res in socket.getaddrinfo(self.host, self.port, 0,
  128. socket.SOCK_STREAM):
  129. family, socktype, proto, canonname, socket_address = res
  130. sock = None
  131. try:
  132. sock = socket.socket(family, socktype, proto)
  133. # TCP_NODELAY
  134. sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
  135.  
  136. # TCP_KEEPALIVE
  137. if self.socket_keepalive:
  138. sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
  139. for k, v in iteritems(self.socket_keepalive_options):
  140. sock.setsockopt(socket.SOL_TCP, k, v)
  141.  
  142. # set the socket_connect_timeout before we connect
  143. sock.settimeout(self.socket_connect_timeout)
  144.  
  145. # connect
  146. sock.connect(socket_address)
  147.  
  148. # set the socket_timeout now that we're connected
  149. sock.settimeout(self.socket_timeout)
  150. return sock
  151.  
  152. except socket.error as _:
  153. err = _
  154. if sock is not None:
  155. sock.close()
  156.  
  157. if err is not None:
  158. > raise err
  159.  
  160. /usr/local/lib/python3.6/site-packages/redis/connection.py:541:
  161. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  162.  
  163. self = Connection<host=localhost,port=6379,db=0>
  164.  
  165. def _connect(self):
  166. "Create a TCP socket connection"
  167. # we want to mimic what socket.create_connection does to support
  168. # ipv4/ipv6, but we want to set options prior to calling
  169. # socket.connect()
  170. err = None
  171. for res in socket.getaddrinfo(self.host, self.port, 0,
  172. socket.SOCK_STREAM):
  173. family, socktype, proto, canonname, socket_address = res
  174. sock = None
  175. try:
  176. sock = socket.socket(family, socktype, proto)
  177. # TCP_NODELAY
  178. sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
  179.  
  180. # TCP_KEEPALIVE
  181. if self.socket_keepalive:
  182. sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
  183. for k, v in iteritems(self.socket_keepalive_options):
  184. sock.setsockopt(socket.SOL_TCP, k, v)
  185.  
  186. # set the socket_connect_timeout before we connect
  187. sock.settimeout(self.socket_connect_timeout)
  188.  
  189. # connect
  190. > sock.connect(socket_address)
  191.  
  192. /usr/local/lib/python3.6/site-packages/redis/connection.py:529:
  193. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  194.  
  195. self = <gevent._socket3.socket [closed] object, fd=-1, family=10, type=1, proto=6>
  196. address = ('::1', 6379, 0, 0)
  197.  
  198. def connect(self, address):
  199. if self.timeout == 0.0:
  200. return _socket.socket.connect(self._sock, address)
  201. if isinstance(address, tuple):
  202. r = getaddrinfo(address[0], address[1], self.family)
  203. address = r[0][-1]
  204. if self.timeout is not None:
  205. timer = Timeout.start_new(self.timeout, timeout('timed out'))
  206. else:
  207. timer = None
  208. try:
  209. while True:
  210. err = self.getsockopt(SOL_SOCKET, SO_ERROR)
  211. if err:
  212. raise error(err, strerror(err))
  213. result = _socket.socket.connect_ex(self._sock, address)
  214. if not result or result == EISCONN:
  215. break
  216. elif (result in (EWOULDBLOCK, EINPROGRESS, EALREADY)) or (result == EINVAL and is_windows):
  217. self._wait(self._write_event)
  218. else:
  219. > raise error(result, strerror(result))
  220. E OSError: [Errno 99] Address not available
  221.  
  222. /usr/local/lib/python3.6/site-packages/gevent/_socket3.py:307: OSError
  223.  
  224. During handling of the above exception, another exception occurred:
  225.  
  226. self = StrictRedis<ConnectionPool<Connection<host=localhost,port=6379,db=0>>>
  227. args = ('SETEX', 'token_WyJHb0NMUUcxd244SEtfTW9yYkZIcEh0IiwiMy8wOVgudEtnM2l4Rno3R3d0M1B3T2tpMDlDUC9rWlYzQ3dmSFBvYlBTTXJlZUI4T...x00rand_idq\x01J\x81\xd36}X\x06\x00\x00\x00app_idq\x02X\x06\x00\x00\x00app_idq\x03X\x07\x00\x00\x00persistq\x04\x89u.')
  228. options = {}, pool = ConnectionPool<Connection<host=localhost,port=6379,db=0>>
  229. command_name = 'SETEX', connection = Connection<host=localhost,port=6379,db=0>
  230.  
  231. def execute_command(self, *args, **options):
  232. "Execute a command and return a parsed response"
  233. pool = self.connection_pool
  234. command_name = args[0]
  235. connection = pool.get_connection(command_name, **options)
  236. try:
  237. > connection.send_command(*args)
  238.  
  239. /usr/local/lib/python3.6/site-packages/redis/client.py:667:
  240. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  241.  
  242. self = Connection<host=localhost,port=6379,db=0>
  243. args = ('SETEX', 'token_WyJHb0NMUUcxd244SEtfTW9yYkZIcEh0IiwiMy8wOVgudEtnM2l4Rno3R3d0M1B3T2tpMDlDUC9rWlYzQ3dmSFBvYlBTTXJlZUI4T...x00rand_idq\x01J\x81\xd36}X\x06\x00\x00\x00app_idq\x02X\x06\x00\x00\x00app_idq\x03X\x07\x00\x00\x00persistq\x04\x89u.')
  244.  
  245. def send_command(self, *args):
  246. "Pack and send a command to the Redis server"
  247. > self.send_packed_command(self.pack_command(*args))
  248.  
  249. /usr/local/lib/python3.6/site-packages/redis/connection.py:610:
  250. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  251.  
  252. self = Connection<host=localhost,port=6379,db=0>
  253. command = [b'*4\r\n$5\r\nSETEX\r\n$158\r\ntoken_WyJHb0NMUUcxd244SEtfTW9yYkZIcEh0IiwiMy8wOVgudEtnM2l4Rno3R3d0M1B3T2tpMDlDUC9rWlYz...and_idq\x01J\x81\xd36}X\x06\x00\x00\x00app_idq\x02X\x06\x00\x00\x00app_idq\x03X\x07\x00\x00\x00persistq\x04\x89u.\r\n']
  254.  
  255. def send_packed_command(self, command):
  256. "Send an already packed command to the Redis server"
  257. if not self._sock:
  258. > self.connect()
  259.  
  260. /usr/local/lib/python3.6/site-packages/redis/connection.py:585:
  261. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  262.  
  263. self = Connection<host=localhost,port=6379,db=0>
  264.  
  265. def connect(self):
  266. "Connects to the Redis server if not already connected"
  267. if self._sock:
  268. return
  269. try:
  270. sock = self._connect()
  271. except socket.timeout:
  272. raise TimeoutError("Timeout connecting to server")
  273. except socket.error:
  274. e = sys.exc_info()[1]
  275. > raise ConnectionError(self._error_message(e))
  276. E redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  277.  
  278. /usr/local/lib/python3.6/site-packages/redis/connection.py:489: ConnectionError
  279.  
  280. During handling of the above exception, another exception occurred:
  281.  
  282. self = Connection<host=localhost,port=6379,db=0>
  283.  
  284. def connect(self):
  285. "Connects to the Redis server if not already connected"
  286. if self._sock:
  287. return
  288. try:
  289. > sock = self._connect()
  290.  
  291. /usr/local/lib/python3.6/site-packages/redis/connection.py:484:
  292. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  293.  
  294. self = Connection<host=localhost,port=6379,db=0>
  295.  
  296. def _connect(self):
  297. "Create a TCP socket connection"
  298. # we want to mimic what socket.create_connection does to support
  299. # ipv4/ipv6, but we want to set options prior to calling
  300. # socket.connect()
  301. err = None
  302. for res in socket.getaddrinfo(self.host, self.port, 0,
  303. socket.SOCK_STREAM):
  304. family, socktype, proto, canonname, socket_address = res
  305. sock = None
  306. try:
  307. sock = socket.socket(family, socktype, proto)
  308. # TCP_NODELAY
  309. sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
  310.  
  311. # TCP_KEEPALIVE
  312. if self.socket_keepalive:
  313. sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
  314. for k, v in iteritems(self.socket_keepalive_options):
  315. sock.setsockopt(socket.SOL_TCP, k, v)
  316.  
  317. # set the socket_connect_timeout before we connect
  318. sock.settimeout(self.socket_connect_timeout)
  319.  
  320. # connect
  321. sock.connect(socket_address)
  322.  
  323. # set the socket_timeout now that we're connected
  324. sock.settimeout(self.socket_timeout)
  325. return sock
  326.  
  327. except socket.error as _:
  328. err = _
  329. if sock is not None:
  330. sock.close()
  331.  
  332. if err is not None:
  333. > raise err
  334.  
  335. /usr/local/lib/python3.6/site-packages/redis/connection.py:541:
  336. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  337.  
  338. self = Connection<host=localhost,port=6379,db=0>
  339.  
  340. def _connect(self):
  341. "Create a TCP socket connection"
  342. # we want to mimic what socket.create_connection does to support
  343. # ipv4/ipv6, but we want to set options prior to calling
  344. # socket.connect()
  345. err = None
  346. for res in socket.getaddrinfo(self.host, self.port, 0,
  347. socket.SOCK_STREAM):
  348. family, socktype, proto, canonname, socket_address = res
  349. sock = None
  350. try:
  351. sock = socket.socket(family, socktype, proto)
  352. # TCP_NODELAY
  353. sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
  354.  
  355. # TCP_KEEPALIVE
  356. if self.socket_keepalive:
  357. sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
  358. for k, v in iteritems(self.socket_keepalive_options):
  359. sock.setsockopt(socket.SOL_TCP, k, v)
  360.  
  361. # set the socket_connect_timeout before we connect
  362. sock.settimeout(self.socket_connect_timeout)
  363.  
  364. # connect
  365. > sock.connect(socket_address)
  366.  
  367. /usr/local/lib/python3.6/site-packages/redis/connection.py:529:
  368. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  369.  
  370. self = <gevent._socket3.socket [closed] object, fd=-1, family=10, type=1, proto=6>
  371. address = ('::1', 6379, 0, 0)
  372.  
  373. def connect(self, address):
  374. if self.timeout == 0.0:
  375. return _socket.socket.connect(self._sock, address)
  376. if isinstance(address, tuple):
  377. r = getaddrinfo(address[0], address[1], self.family)
  378. address = r[0][-1]
  379. if self.timeout is not None:
  380. timer = Timeout.start_new(self.timeout, timeout('timed out'))
  381. else:
  382. timer = None
  383. try:
  384. while True:
  385. err = self.getsockopt(SOL_SOCKET, SO_ERROR)
  386. if err:
  387. raise error(err, strerror(err))
  388. result = _socket.socket.connect_ex(self._sock, address)
  389. if not result or result == EISCONN:
  390. break
  391. elif (result in (EWOULDBLOCK, EINPROGRESS, EALREADY)) or (result == EINVAL and is_windows):
  392. self._wait(self._write_event)
  393. else:
  394. > raise error(result, strerror(result))
  395. E OSError: [Errno 99] Address not available
  396.  
  397. /usr/local/lib/python3.6/site-packages/gevent/_socket3.py:307: OSError
  398.  
  399. During handling of the above exception, another exception occurred:
  400.  
  401. self = <tests.test_chatbot.ChatbootGoogleCallbackTestCase testMethod=test_valid_code>
  402. mock_authorized_response = <MagicMock name='authorized_response' id='140158917826152'>
  403. mock_get = <MagicMock name='get' id='140158917686664'>
  404.  
  405. @patch("auth.oauth.providers.google.get")
  406. @patch("auth.oauth.providers.google.authorized_response")
  407. def test_valid_code(self, mock_authorized_response, mock_get):
  408. # token returned from google api
  409. mock_authorized_response.return_value = {
  410. "expires_in": 3600,
  411. "id_token": ("eyJhbGciOiJSUzI1NiIsImtpZCI6IjRiMTRiZWFkODZmZjBhZDRlZTAxZWFkYWUwNzBk" "YjM3YWE2YzY2Y2QifQ."),
  412. "token_type": "Bearer",
  413. "access_token": ("ya29.Ci9IA92ZqnIAgf3BUqMPkIW8X4NDB9JCu12ZsV5h902nGig5xj5Ix8WVzjy1ht3s2Q"),
  414. }
  415.  
  416. # user info returner from google api
  417. class UserInfo(object):
  418. data = {
  419. "locale": "en",
  420. "family_name": "Koci",
  421. "given_name": "Pavel",
  422. "name": "Pavel Koci",
  423. "id": "10974864908507278145",
  424. "email": "pavel.koci@vacuumapps.com",
  425. "verified_email": True,
  426. "picture": "https://lh3.googleusercontent.com/-rscbv5M/photo.jpg",
  427. "hd": "vacuumapps.com",
  428. }
  429.  
  430. mock_get.return_value = UserInfo()
  431.  
  432. url = "/v1/chatbot.google.authorized?state={}&" "code=4%2FVq84MGCyFcHuS-1tj7gpm9hbd81NhhW6eAfMN6TSb2o".format(
  433. "YXBwX2lkOjpodHRwOi8vd3d3Lmtpd2kuY29tOjpodHRwczovL2dyYXBoLmZhY2Vib29rLmNvbTo6bGlua190b2tlbg%3D%3D"
  434. )
  435.  
  436. > response = self.client.get(url)
  437.  
  438. tests/test_chatbot.py:99:
  439. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  440. /usr/local/lib/python3.6/site-packages/werkzeug/test.py:830: in get
  441. return self.open(*args, **kw)
  442. /usr/local/lib/python3.6/site-packages/flask/testing.py:127: in open
  443. follow_redirects=follow_redirects)
  444. /usr/local/lib/python3.6/site-packages/werkzeug/test.py:803: in open
  445. response = self.run_wsgi_app(environ, buffered=buffered)
  446. /usr/local/lib/python3.6/site-packages/werkzeug/test.py:716: in run_wsgi_app
  447. rv = run_wsgi_app(self.application, environ, buffered=buffered)
  448. /usr/local/lib/python3.6/site-packages/werkzeug/test.py:923: in run_wsgi_app
  449. app_rv = app(environ, start_response)
  450. /usr/local/lib/python3.6/site-packages/flask/app.py:1997: in __call__
  451. return self.wsgi_app(environ, start_response)
  452. auth/middleware.py:57: in __call__
  453. retval = self.app(environ, custom_start_response)
  454. /usr/local/lib/python3.6/site-packages/flask/app.py:1985: in wsgi_app
  455. response = self.handle_exception(e)
  456. /usr/local/lib/python3.6/site-packages/flask/app.py:1540: in handle_exception
  457. reraise(exc_type, exc_value, tb)
  458. /usr/local/lib/python3.6/site-packages/flask/_compat.py:33: in reraise
  459. raise value
  460. /usr/local/lib/python3.6/site-packages/flask/app.py:1982: in wsgi_app
  461. response = self.full_dispatch_request()
  462. /usr/local/lib/python3.6/site-packages/flask/app.py:1614: in full_dispatch_request
  463. rv = self.handle_user_exception(e)
  464. /usr/local/lib/python3.6/site-packages/flask/app.py:1517: in handle_user_exception
  465. reraise(exc_type, exc_value, tb)
  466. /usr/local/lib/python3.6/site-packages/flask/_compat.py:33: in reraise
  467. raise value
  468. /usr/local/lib/python3.6/site-packages/flask/app.py:1612: in full_dispatch_request
  469. rv = self.dispatch_request()
  470. /usr/local/lib/python3.6/site-packages/flask/app.py:1598: in dispatch_request
  471. return self.view_functions[rule.endpoint](**req.view_args)
  472. auth/chatbot/views.py:103: in google_authorized
  473. token, user_id = save_and_log_social_user(response, google)
  474. auth/oauth/utils.py:98: in save_and_log_social_user
  475. return create_token(db_user), db_user.user_id
  476. auth/token/utils.py:84: in create_token
  477. token_interface.save_token(kvtoken, user, g.app["persist"])
  478. auth/token/storage.py:88: in save_token
  479. store.put(token.tid, data, current_app.config["TOKEN_TTL"])
  480. /usr/local/lib/python3.6/site-packages/simplekv/decorator.py:73: in put
  481. self._dstore.put(self._map_key(key), *args, **kwargs))
  482. /usr/local/lib/python3.6/site-packages/simplekv/__init__.py:395: in put
  483. return self._put(key, data, self._valid_ttl(ttl_secs))
  484. /usr/local/lib/python3.6/site-packages/simplekv/memory/redisstore.py:58: in _put
  485. self.redis.setex(key, ittl, value)
  486. /usr/local/lib/python3.6/site-packages/redis/client.py:1192: in setex
  487. return self.execute_command('SETEX', name, time, value)
  488. /usr/local/lib/python3.6/site-packages/ddtrace/contrib/redis/patch.py:58: in traced_execute_command
  489. return func(*args, **kwargs)
  490. /usr/local/lib/python3.6/site-packages/redis/client.py:673: in execute_command
  491. connection.send_command(*args)
  492. /usr/local/lib/python3.6/site-packages/redis/connection.py:610: in send_command
  493. self.send_packed_command(self.pack_command(*args))
  494. /usr/local/lib/python3.6/site-packages/redis/connection.py:585: in send_packed_command
  495. self.connect()
  496. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  497.  
  498. self = Connection<host=localhost,port=6379,db=0>
  499.  
  500. def connect(self):
  501. "Connects to the Redis server if not already connected"
  502. if self._sock:
  503. return
  504. try:
  505. sock = self._connect()
  506. except socket.timeout:
  507. raise TimeoutError("Timeout connecting to server")
  508. except socket.error:
  509. e = sys.exc_info()[1]
  510. > raise ConnectionError(self._error_message(e))
  511. E redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  512.  
  513. /usr/local/lib/python3.6/site-packages/redis/connection.py:489: ConnectionError
  514. ----------------------------- Captured stdout call -----------------------------
  515. 2019-03-08T18:34:39.841110Z [info ] request  client_addr=127.0.0.1 forwarding= method=GET path=/v1/chatbot.google.authorized request_id=bf6a5af76a454f5d89fd013257c65c01
  516. 2019-03-08T18:34:39.860372Z [info ] oauth.redirect_url  is_invalid=False request_id=bf6a5af76a454f5d89fd013257c65c01 url=http://www.kiwi.com
  517. 2019-03-08T18:34:39.861125Z [info ] parse_google_data.start  data={"email": "pavel.koci@vacuumapps.com", "family_name": "Koci", "given_name": "Pavel", "hd": "vacuumapps.com", "id": "10974864908507278145", "locale": "en", "name": "Pavel Koci", "picture": "https://lh3.googleusercontent.com/-rscbv5M/photo.jpg", "verified_email": true} request_id=bf6a5af76a454f5d89fd013257c65c01
  518. 2019-03-08T18:34:39.861518Z [info ] parse_google_data.finish  data={"email": "pavel.koci@vacuumapps.com", "email_verified": true, "first_name": "Pavel", "last_name": "Koci"} request_id=bf6a5af76a454f5d89fd013257c65c01
  519. ----------------------------- Captured stderr call -----------------------------
  520. 2019-03-08T18:34:38.465677Z [debug ] stdlib_log  [ddtrace.encoding] message=using Msgpack encoder request_id=ffd4b194bd7f439da393bb9e36d3743a
  521. 2019-03-08T18:34:38.465991Z [info ] stdlib_log  [ddtrace.sampler] message=initialized RateSampler, sample 100.0% of traces request_id=ffd4b194bd7f439da393bb9e36d3743a
  522. 2019-03-08T18:34:38.470890Z [debug ] stdlib_log  [ddtrace.writer] message=resetting queues. pids(old:None new:68) request_id=ffd4b194bd7f439da393bb9e36d3743a
  523. 2019-03-08T18:34:38.471174Z [debug ] stdlib_log  [ddtrace.writer] message=starting flush thread request_id=ffd4b194bd7f439da393bb9e36d3743a
  524. 2019-03-08T18:34:38.969415Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  525. 2019-03-08T18:34:38.973208Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  526. 2019-03-08T18:34:39.477975Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  527. 2019-03-08T18:34:39.482077Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  528. 2019-03-08T18:34:40.488191Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  529. 2019-03-08T18:34:40.492958Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  530. _______________ ChatbotFacebookCallbackTestCase.test_valid_code ________________
  531.  
  532. self = Connection<host=localhost,port=6379,db=0>
  533.  
  534. def connect(self):
  535. "Connects to the Redis server if not already connected"
  536. if self._sock:
  537. return
  538. try:
  539. > sock = self._connect()
  540.  
  541. /usr/local/lib/python3.6/site-packages/redis/connection.py:484:
  542. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  543.  
  544. self = Connection<host=localhost,port=6379,db=0>
  545.  
  546. def _connect(self):
  547. "Create a TCP socket connection"
  548. # we want to mimic what socket.create_connection does to support
  549. # ipv4/ipv6, but we want to set options prior to calling
  550. # socket.connect()
  551. err = None
  552. for res in socket.getaddrinfo(self.host, self.port, 0,
  553. socket.SOCK_STREAM):
  554. family, socktype, proto, canonname, socket_address = res
  555. sock = None
  556. try:
  557. sock = socket.socket(family, socktype, proto)
  558. # TCP_NODELAY
  559. sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
  560.  
  561. # TCP_KEEPALIVE
  562. if self.socket_keepalive:
  563. sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
  564. for k, v in iteritems(self.socket_keepalive_options):
  565. sock.setsockopt(socket.SOL_TCP, k, v)
  566.  
  567. # set the socket_connect_timeout before we connect
  568. sock.settimeout(self.socket_connect_timeout)
  569.  
  570. # connect
  571. sock.connect(socket_address)
  572.  
  573. # set the socket_timeout now that we're connected
  574. sock.settimeout(self.socket_timeout)
  575. return sock
  576.  
  577. except socket.error as _:
  578. err = _
  579. if sock is not None:
  580. sock.close()
  581.  
  582. if err is not None:
  583. > raise err
  584.  
  585. /usr/local/lib/python3.6/site-packages/redis/connection.py:541:
  586. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  587.  
  588. self = Connection<host=localhost,port=6379,db=0>
  589.  
  590. def _connect(self):
  591. "Create a TCP socket connection"
  592. # we want to mimic what socket.create_connection does to support
  593. # ipv4/ipv6, but we want to set options prior to calling
  594. # socket.connect()
  595. err = None
  596. for res in socket.getaddrinfo(self.host, self.port, 0,
  597. socket.SOCK_STREAM):
  598. family, socktype, proto, canonname, socket_address = res
  599. sock = None
  600. try:
  601. sock = socket.socket(family, socktype, proto)
  602. # TCP_NODELAY
  603. sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
  604.  
  605. # TCP_KEEPALIVE
  606. if self.socket_keepalive:
  607. sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
  608. for k, v in iteritems(self.socket_keepalive_options):
  609. sock.setsockopt(socket.SOL_TCP, k, v)
  610.  
  611. # set the socket_connect_timeout before we connect
  612. sock.settimeout(self.socket_connect_timeout)
  613.  
  614. # connect
  615. > sock.connect(socket_address)
  616.  
  617. /usr/local/lib/python3.6/site-packages/redis/connection.py:529:
  618. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  619.  
  620. self = <gevent._socket3.socket [closed] object, fd=-1, family=10, type=1, proto=6>
  621. address = ('::1', 6379, 0, 0)
  622.  
  623. def connect(self, address):
  624. if self.timeout == 0.0:
  625. return _socket.socket.connect(self._sock, address)
  626. if isinstance(address, tuple):
  627. r = getaddrinfo(address[0], address[1], self.family)
  628. address = r[0][-1]
  629. if self.timeout is not None:
  630. timer = Timeout.start_new(self.timeout, timeout('timed out'))
  631. else:
  632. timer = None
  633. try:
  634. while True:
  635. err = self.getsockopt(SOL_SOCKET, SO_ERROR)
  636. if err:
  637. raise error(err, strerror(err))
  638. result = _socket.socket.connect_ex(self._sock, address)
  639. if not result or result == EISCONN:
  640. break
  641. elif (result in (EWOULDBLOCK, EINPROGRESS, EALREADY)) or (result == EINVAL and is_windows):
  642. self._wait(self._write_event)
  643. else:
  644. > raise error(result, strerror(result))
  645. E OSError: [Errno 99] Address not available
  646.  
  647. /usr/local/lib/python3.6/site-packages/gevent/_socket3.py:307: OSError
  648.  
  649. During handling of the above exception, another exception occurred:
  650.  
  651. self = StrictRedis<ConnectionPool<Connection<host=localhost,port=6379,db=0>>>
  652. args = ('SETEX', 'token_WyJkN2ZLWG1OZGVzY3dnY3RNTnlNQmdfIiwiWVA5RHBOd24yUFNPd2FpRldrLkRET2MwYU84MEx3YUguQ2NHTU5zTGFsTUQxdWd6Z...x00rand_idq\x01J\x076\xdccX\x06\x00\x00\x00app_idq\x02X\x06\x00\x00\x00app_idq\x03X\x07\x00\x00\x00persistq\x04\x89u.')
  653. options = {}, pool = ConnectionPool<Connection<host=localhost,port=6379,db=0>>
  654. command_name = 'SETEX', connection = Connection<host=localhost,port=6379,db=0>
  655.  
  656. def execute_command(self, *args, **options):
  657. "Execute a command and return a parsed response"
  658. pool = self.connection_pool
  659. command_name = args[0]
  660. connection = pool.get_connection(command_name, **options)
  661. try:
  662. > connection.send_command(*args)
  663.  
  664. /usr/local/lib/python3.6/site-packages/redis/client.py:667:
  665. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  666.  
  667. self = Connection<host=localhost,port=6379,db=0>
  668. args = ('SETEX', 'token_WyJkN2ZLWG1OZGVzY3dnY3RNTnlNQmdfIiwiWVA5RHBOd24yUFNPd2FpRldrLkRET2MwYU84MEx3YUguQ2NHTU5zTGFsTUQxdWd6Z...x00rand_idq\x01J\x076\xdccX\x06\x00\x00\x00app_idq\x02X\x06\x00\x00\x00app_idq\x03X\x07\x00\x00\x00persistq\x04\x89u.')
  669.  
  670. def send_command(self, *args):
  671. "Pack and send a command to the Redis server"
  672. > self.send_packed_command(self.pack_command(*args))
  673.  
  674. /usr/local/lib/python3.6/site-packages/redis/connection.py:610:
  675. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  676.  
  677. self = Connection<host=localhost,port=6379,db=0>
  678. command = [b'*4\r\n$5\r\nSETEX\r\n$158\r\ntoken_WyJkN2ZLWG1OZGVzY3dnY3RNTnlNQmdfIiwiWVA5RHBOd24yUFNPd2FpRldrLkRET2MwYU84MEx3YUgu...and_idq\x01J\x076\xdccX\x06\x00\x00\x00app_idq\x02X\x06\x00\x00\x00app_idq\x03X\x07\x00\x00\x00persistq\x04\x89u.\r\n']
  679.  
  680. def send_packed_command(self, command):
  681. "Send an already packed command to the Redis server"
  682. if not self._sock:
  683. > self.connect()
  684.  
  685. /usr/local/lib/python3.6/site-packages/redis/connection.py:585:
  686. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  687.  
  688. self = Connection<host=localhost,port=6379,db=0>
  689.  
  690. def connect(self):
  691. "Connects to the Redis server if not already connected"
  692. if self._sock:
  693. return
  694. try:
  695. sock = self._connect()
  696. except socket.timeout:
  697. raise TimeoutError("Timeout connecting to server")
  698. except socket.error:
  699. e = sys.exc_info()[1]
  700. > raise ConnectionError(self._error_message(e))
  701. E redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  702.  
  703. /usr/local/lib/python3.6/site-packages/redis/connection.py:489: ConnectionError
  704.  
  705. During handling of the above exception, another exception occurred:
  706.  
  707. self = Connection<host=localhost,port=6379,db=0>
  708.  
  709. def connect(self):
  710. "Connects to the Redis server if not already connected"
  711. if self._sock:
  712. return
  713. try:
  714. > sock = self._connect()
  715.  
  716. /usr/local/lib/python3.6/site-packages/redis/connection.py:484:
  717. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  718.  
  719. self = Connection<host=localhost,port=6379,db=0>
  720.  
  721. def _connect(self):
  722. "Create a TCP socket connection"
  723. # we want to mimic what socket.create_connection does to support
  724. # ipv4/ipv6, but we want to set options prior to calling
  725. # socket.connect()
  726. err = None
  727. for res in socket.getaddrinfo(self.host, self.port, 0,
  728. socket.SOCK_STREAM):
  729. family, socktype, proto, canonname, socket_address = res
  730. sock = None
  731. try:
  732. sock = socket.socket(family, socktype, proto)
  733. # TCP_NODELAY
  734. sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
  735.  
  736. # TCP_KEEPALIVE
  737. if self.socket_keepalive:
  738. sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
  739. for k, v in iteritems(self.socket_keepalive_options):
  740. sock.setsockopt(socket.SOL_TCP, k, v)
  741.  
  742. # set the socket_connect_timeout before we connect
  743. sock.settimeout(self.socket_connect_timeout)
  744.  
  745. # connect
  746. sock.connect(socket_address)
  747.  
  748. # set the socket_timeout now that we're connected
  749. sock.settimeout(self.socket_timeout)
  750. return sock
  751.  
  752. except socket.error as _:
  753. err = _
  754. if sock is not None:
  755. sock.close()
  756.  
  757. if err is not None:
  758. > raise err
  759.  
  760. /usr/local/lib/python3.6/site-packages/redis/connection.py:541:
  761. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  762.  
  763. self = Connection<host=localhost,port=6379,db=0>
  764.  
  765. def _connect(self):
  766. "Create a TCP socket connection"
  767. # we want to mimic what socket.create_connection does to support
  768. # ipv4/ipv6, but we want to set options prior to calling
  769. # socket.connect()
  770. err = None
  771. for res in socket.getaddrinfo(self.host, self.port, 0,
  772. socket.SOCK_STREAM):
  773. family, socktype, proto, canonname, socket_address = res
  774. sock = None
  775. try:
  776. sock = socket.socket(family, socktype, proto)
  777. # TCP_NODELAY
  778. sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
  779.  
  780. # TCP_KEEPALIVE
  781. if self.socket_keepalive:
  782. sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
  783. for k, v in iteritems(self.socket_keepalive_options):
  784. sock.setsockopt(socket.SOL_TCP, k, v)
  785.  
  786. # set the socket_connect_timeout before we connect
  787. sock.settimeout(self.socket_connect_timeout)
  788.  
  789. # connect
  790. > sock.connect(socket_address)
  791.  
  792. /usr/local/lib/python3.6/site-packages/redis/connection.py:529:
  793. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  794.  
  795. self = <gevent._socket3.socket [closed] object, fd=-1, family=10, type=1, proto=6>
  796. address = ('::1', 6379, 0, 0)
  797.  
  798. def connect(self, address):
  799. if self.timeout == 0.0:
  800. return _socket.socket.connect(self._sock, address)
  801. if isinstance(address, tuple):
  802. r = getaddrinfo(address[0], address[1], self.family)
  803. address = r[0][-1]
  804. if self.timeout is not None:
  805. timer = Timeout.start_new(self.timeout, timeout('timed out'))
  806. else:
  807. timer = None
  808. try:
  809. while True:
  810. err = self.getsockopt(SOL_SOCKET, SO_ERROR)
  811. if err:
  812. raise error(err, strerror(err))
  813. result = _socket.socket.connect_ex(self._sock, address)
  814. if not result or result == EISCONN:
  815. break
  816. elif (result in (EWOULDBLOCK, EINPROGRESS, EALREADY)) or (result == EINVAL and is_windows):
  817. self._wait(self._write_event)
  818. else:
  819. > raise error(result, strerror(result))
  820. E OSError: [Errno 99] Address not available
  821.  
  822. /usr/local/lib/python3.6/site-packages/gevent/_socket3.py:307: OSError
  823.  
  824. During handling of the above exception, another exception occurred:
  825.  
  826. self = <tests.test_chatbot.ChatbotFacebookCallbackTestCase testMethod=test_valid_code>
  827. mock_authorized_response = <MagicMock name='authorized_response' id='140158915752848'>
  828. mock_get = <MagicMock name='get' id='140158917324192'>
  829.  
  830. @patch("auth.oauth.providers.facebook.get")
  831. @patch("auth.oauth.providers.facebook.authorized_response")
  832. def test_valid_code(self, mock_authorized_response, mock_get):
  833. # token returned from google api
  834. mock_authorized_response.return_value = {
  835. "access_token": (
  836. "EAAOn6HZCqOwEBAN5W8ngQ7iZB7TyF9WvHT6GLjfeN7Bo8J92JZBG"
  837. "jFrFskU4UZApmP6EGhnbCZBJnBoI8kHcMR9tjoMATs4isbxcbgg2a"
  838. "3eu62vZBJyPDrsFKeCB6s4LA1aShnLjSazR8w3EkuST02QVP5tvbw"
  839. "CvAZD"
  840. ),
  841. "expires": "5102404",
  842. }
  843.  
  844. # user info returner from google api
  845. class UserInfo(object):
  846. data = {"last_name": "Pelikan", "email": "juraj.pelikan@gmail.com", "first_name": "Juraj"}
  847.  
  848. mock_get.return_value = UserInfo()
  849. url = (
  850. "/v1/chatbot.facebook.authorized?code=AQA_gYQhqs45SvcCexSvPN"
  851. "Lced0GQvPYf-lc0X0JCwdDlcgabynOsh78j-iJrS0canjF3q8dN4O81ir"
  852. "F5OLPagd8mAORKAu_qqcH57Ixz8Gl5BzAWkdLo0wh4cuBRSCtSCWNVCF2"
  853. "oUC2EDjWgjGsnDyzjBMDCkhn7hbJrbVEkGw4dtpyrAs8vv6a5m6XvJjgV"
  854. "WgnclfrDTh5s-iMNW3B0QOYpJL6ihpG0MpkemdeMWj3KafJWOGvZk65I9"
  855. "4Hfeh8vQw_teI2M-_J1HlqXZ0sE6ak_oLx-iiMp-dn2tpUYB5M6Zv-QGy"
  856. "eA1jKaD-4ht2H30&state={}"
  857. ).format("YXBwX2lkOjpodHRwOi8vd3d3Lmtpd2kuY29tOjpodHRwczovL2dyYXBoLmZhY2Vib29rLmNvbTo6bGlua190b2tlbg%3D%3D")
  858. > response = self.client.get(url)
  859.  
  860. tests/test_chatbot.py:215:
  861. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  862. /usr/local/lib/python3.6/site-packages/werkzeug/test.py:830: in get
  863. return self.open(*args, **kw)
  864. /usr/local/lib/python3.6/site-packages/flask/testing.py:127: in open
  865. follow_redirects=follow_redirects)
  866. /usr/local/lib/python3.6/site-packages/werkzeug/test.py:803: in open
  867. response = self.run_wsgi_app(environ, buffered=buffered)
  868. /usr/local/lib/python3.6/site-packages/werkzeug/test.py:716: in run_wsgi_app
  869. rv = run_wsgi_app(self.application, environ, buffered=buffered)
  870. /usr/local/lib/python3.6/site-packages/werkzeug/test.py:923: in run_wsgi_app
  871. app_rv = app(environ, start_response)
  872. /usr/local/lib/python3.6/site-packages/flask/app.py:1997: in __call__
  873. return self.wsgi_app(environ, start_response)
  874. auth/middleware.py:57: in __call__
  875. retval = self.app(environ, custom_start_response)
  876. /usr/local/lib/python3.6/site-packages/flask/app.py:1985: in wsgi_app
  877. response = self.handle_exception(e)
  878. /usr/local/lib/python3.6/site-packages/flask/app.py:1540: in handle_exception
  879. reraise(exc_type, exc_value, tb)
  880. /usr/local/lib/python3.6/site-packages/flask/_compat.py:33: in reraise
  881. raise value
  882. /usr/local/lib/python3.6/site-packages/flask/app.py:1982: in wsgi_app
  883. response = self.full_dispatch_request()
  884. /usr/local/lib/python3.6/site-packages/flask/app.py:1614: in full_dispatch_request
  885. rv = self.handle_user_exception(e)
  886. /usr/local/lib/python3.6/site-packages/flask/app.py:1517: in handle_user_exception
  887. reraise(exc_type, exc_value, tb)
  888. /usr/local/lib/python3.6/site-packages/flask/_compat.py:33: in reraise
  889. raise value
  890. /usr/local/lib/python3.6/site-packages/flask/app.py:1612: in full_dispatch_request
  891. rv = self.dispatch_request()
  892. /usr/local/lib/python3.6/site-packages/flask/app.py:1598: in dispatch_request
  893. return self.view_functions[rule.endpoint](**req.view_args)
  894. auth/chatbot/views.py:72: in facebook_authorized
  895. token, user_id = save_and_log_social_user(response, facebook)
  896. auth/oauth/utils.py:98: in save_and_log_social_user
  897. return create_token(db_user), db_user.user_id
  898. auth/token/utils.py:84: in create_token
  899. token_interface.save_token(kvtoken, user, g.app["persist"])
  900. auth/token/storage.py:88: in save_token
  901. store.put(token.tid, data, current_app.config["TOKEN_TTL"])
  902. /usr/local/lib/python3.6/site-packages/simplekv/decorator.py:73: in put
  903. self._dstore.put(self._map_key(key), *args, **kwargs))
  904. /usr/local/lib/python3.6/site-packages/simplekv/__init__.py:395: in put
  905. return self._put(key, data, self._valid_ttl(ttl_secs))
  906. /usr/local/lib/python3.6/site-packages/simplekv/memory/redisstore.py:58: in _put
  907. self.redis.setex(key, ittl, value)
  908. /usr/local/lib/python3.6/site-packages/redis/client.py:1192: in setex
  909. return self.execute_command('SETEX', name, time, value)
  910. /usr/local/lib/python3.6/site-packages/ddtrace/contrib/redis/patch.py:58: in traced_execute_command
  911. return func(*args, **kwargs)
  912. /usr/local/lib/python3.6/site-packages/redis/client.py:673: in execute_command
  913. connection.send_command(*args)
  914. /usr/local/lib/python3.6/site-packages/redis/connection.py:610: in send_command
  915. self.send_packed_command(self.pack_command(*args))
  916. /usr/local/lib/python3.6/site-packages/redis/connection.py:585: in send_packed_command
  917. self.connect()
  918. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  919.  
  920. self = Connection<host=localhost,port=6379,db=0>
  921.  
  922. def connect(self):
  923. "Connects to the Redis server if not already connected"
  924. if self._sock:
  925. return
  926. try:
  927. sock = self._connect()
  928. except socket.timeout:
  929. raise TimeoutError("Timeout connecting to server")
  930. except socket.error:
  931. e = sys.exc_info()[1]
  932. > raise ConnectionError(self._error_message(e))
  933. E redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  934.  
  935. /usr/local/lib/python3.6/site-packages/redis/connection.py:489: ConnectionError
  936. ----------------------------- Captured stdout call -----------------------------
  937. 2019-03-08T18:34:48.843926Z [info ] request  client_addr=127.0.0.1 forwarding= method=GET path=/v1/chatbot.facebook.authorized request_id=4f1247780ae844c3bf73a2c95af9174f
  938. 2019-03-08T18:34:48.849552Z [info ] oauth.redirect_url  is_invalid=False request_id=4f1247780ae844c3bf73a2c95af9174f url=http://www.kiwi.com
  939. 2019-03-08T18:34:48.850800Z [info ] parse_facebook_data.start data={"email": "juraj.pelikan@gmail.com", "first_name": "Juraj", "last_name": "Pelikan"} request_id=4f1247780ae844c3bf73a2c95af9174f
  940. 2019-03-08T18:34:48.851518Z [info ] parse_facebook_data.finish data={"email": "juraj.pelikan@gmail.com", "email_verified": true, "first_name": "Juraj", "last_name": "Pelikan"} request_id=4f1247780ae844c3bf73a2c95af9174f
  941. ----------------------------- Captured stderr call -----------------------------
  942. 2019-03-08T18:34:47.486993Z [debug ] stdlib_log  [ddtrace.encoding] message=using Msgpack encoder request_id=fb1403e044c64b9696b7e9bd4c9b87c5
  943. 2019-03-08T18:34:47.487592Z [info ] stdlib_log  [ddtrace.sampler] message=initialized RateSampler, sample 100.0% of traces request_id=fb1403e044c64b9696b7e9bd4c9b87c5
  944. 2019-03-08T18:34:47.495590Z [debug ] stdlib_log  [ddtrace.writer] message=resetting queues. pids(old:None new:68) request_id=fb1403e044c64b9696b7e9bd4c9b87c5
  945. 2019-03-08T18:34:47.496032Z [debug ] stdlib_log  [ddtrace.writer] message=starting flush thread request_id=fb1403e044c64b9696b7e9bd4c9b87c5
  946. 2019-03-08T18:34:47.980401Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  947. 2019-03-08T18:34:47.984477Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  948. 2019-03-08T18:34:48.502156Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  949. 2019-03-08T18:34:48.506210Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  950. 2019-03-08T18:34:49.512016Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  951. 2019-03-08T18:34:49.514355Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  952. ____________________ GoogleCallbackTestCase.test_valid_code ____________________
  953.  
  954. self = Connection<host=localhost,port=6379,db=0>
  955.  
  956. def connect(self):
  957. "Connects to the Redis server if not already connected"
  958. if self._sock:
  959. return
  960. try:
  961. > sock = self._connect()
  962.  
  963. /usr/local/lib/python3.6/site-packages/redis/connection.py:484:
  964. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  965.  
  966. self = Connection<host=localhost,port=6379,db=0>
  967.  
  968. def _connect(self):
  969. "Create a TCP socket connection"
  970. # we want to mimic what socket.create_connection does to support
  971. # ipv4/ipv6, but we want to set options prior to calling
  972. # socket.connect()
  973. err = None
  974. for res in socket.getaddrinfo(self.host, self.port, 0,
  975. socket.SOCK_STREAM):
  976. family, socktype, proto, canonname, socket_address = res
  977. sock = None
  978. try:
  979. sock = socket.socket(family, socktype, proto)
  980. # TCP_NODELAY
  981. sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
  982.  
  983. # TCP_KEEPALIVE
  984. if self.socket_keepalive:
  985. sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
  986. for k, v in iteritems(self.socket_keepalive_options):
  987. sock.setsockopt(socket.SOL_TCP, k, v)
  988.  
  989. # set the socket_connect_timeout before we connect
  990. sock.settimeout(self.socket_connect_timeout)
  991.  
  992. # connect
  993. sock.connect(socket_address)
  994.  
  995. # set the socket_timeout now that we're connected
  996. sock.settimeout(self.socket_timeout)
  997. return sock
  998.  
  999. except socket.error as _:
  1000. err = _
  1001. if sock is not None:
  1002. sock.close()
  1003.  
  1004. if err is not None:
  1005. > raise err
  1006.  
  1007. /usr/local/lib/python3.6/site-packages/redis/connection.py:541:
  1008. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1009.  
  1010. self = Connection<host=localhost,port=6379,db=0>
  1011.  
  1012. def _connect(self):
  1013. "Create a TCP socket connection"
  1014. # we want to mimic what socket.create_connection does to support
  1015. # ipv4/ipv6, but we want to set options prior to calling
  1016. # socket.connect()
  1017. err = None
  1018. for res in socket.getaddrinfo(self.host, self.port, 0,
  1019. socket.SOCK_STREAM):
  1020. family, socktype, proto, canonname, socket_address = res
  1021. sock = None
  1022. try:
  1023. sock = socket.socket(family, socktype, proto)
  1024. # TCP_NODELAY
  1025. sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
  1026.  
  1027. # TCP_KEEPALIVE
  1028. if self.socket_keepalive:
  1029. sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
  1030. for k, v in iteritems(self.socket_keepalive_options):
  1031. sock.setsockopt(socket.SOL_TCP, k, v)
  1032.  
  1033. # set the socket_connect_timeout before we connect
  1034. sock.settimeout(self.socket_connect_timeout)
  1035.  
  1036. # connect
  1037. > sock.connect(socket_address)
  1038.  
  1039. /usr/local/lib/python3.6/site-packages/redis/connection.py:529:
  1040. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1041.  
  1042. self = <gevent._socket3.socket [closed] object, fd=-1, family=10, type=1, proto=6>
  1043. address = ('::1', 6379, 0, 0)
  1044.  
  1045. def connect(self, address):
  1046. if self.timeout == 0.0:
  1047. return _socket.socket.connect(self._sock, address)
  1048. if isinstance(address, tuple):
  1049. r = getaddrinfo(address[0], address[1], self.family)
  1050. address = r[0][-1]
  1051. if self.timeout is not None:
  1052. timer = Timeout.start_new(self.timeout, timeout('timed out'))
  1053. else:
  1054. timer = None
  1055. try:
  1056. while True:
  1057. err = self.getsockopt(SOL_SOCKET, SO_ERROR)
  1058. if err:
  1059. raise error(err, strerror(err))
  1060. result = _socket.socket.connect_ex(self._sock, address)
  1061. if not result or result == EISCONN:
  1062. break
  1063. elif (result in (EWOULDBLOCK, EINPROGRESS, EALREADY)) or (result == EINVAL and is_windows):
  1064. self._wait(self._write_event)
  1065. else:
  1066. > raise error(result, strerror(result))
  1067. E OSError: [Errno 99] Address not available
  1068.  
  1069. /usr/local/lib/python3.6/site-packages/gevent/_socket3.py:307: OSError
  1070.  
  1071. During handling of the above exception, another exception occurred:
  1072.  
  1073. self = StrictRedis<ConnectionPool<Connection<host=localhost,port=6379,db=0>>>
  1074. args = ('SETEX', 'token_WyJNMmhWZXRpdi1RZnJ0dEtxWlJIYW5lIiwidGQvaGZlL0s4N2J2Z2xCdEI4Vko0ZXdMVjdaVXl6NzlDOC9NcU5iSUE1NnZQbm5uT...rand_idq\x01J\xea\xf3\x9c'X\x06\x00\x00\x00app_idq\x02X\x06\x00\x00\x00app_idq\x03X\x07\x00\x00\x00persistq\x04\x89u.")
  1075. options = {}, pool = ConnectionPool<Connection<host=localhost,port=6379,db=0>>
  1076. command_name = 'SETEX', connection = Connection<host=localhost,port=6379,db=0>
  1077.  
  1078. def execute_command(self, *args, **options):
  1079. "Execute a command and return a parsed response"
  1080. pool = self.connection_pool
  1081. command_name = args[0]
  1082. connection = pool.get_connection(command_name, **options)
  1083. try:
  1084. > connection.send_command(*args)
  1085.  
  1086. /usr/local/lib/python3.6/site-packages/redis/client.py:667:
  1087. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1088.  
  1089. self = Connection<host=localhost,port=6379,db=0>
  1090. args = ('SETEX', 'token_WyJNMmhWZXRpdi1RZnJ0dEtxWlJIYW5lIiwidGQvaGZlL0s4N2J2Z2xCdEI4Vko0ZXdMVjdaVXl6NzlDOC9NcU5iSUE1NnZQbm5uT...rand_idq\x01J\xea\xf3\x9c'X\x06\x00\x00\x00app_idq\x02X\x06\x00\x00\x00app_idq\x03X\x07\x00\x00\x00persistq\x04\x89u.")
  1091.  
  1092. def send_command(self, *args):
  1093. "Pack and send a command to the Redis server"
  1094. > self.send_packed_command(self.pack_command(*args))
  1095.  
  1096. /usr/local/lib/python3.6/site-packages/redis/connection.py:610:
  1097. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1098.  
  1099. self = Connection<host=localhost,port=6379,db=0>
  1100. command = [b"*4\r\n$5\r\nSETEX\r\n$157\r\ntoken_WyJNMmhWZXRpdi1RZnJ0dEtxWlJIYW5lIiwidGQvaGZlL0s4N2J2Z2xCdEI4Vko0ZXdMVjdaVXl6NzlD..._idq\x01J\xea\xf3\x9c'X\x06\x00\x00\x00app_idq\x02X\x06\x00\x00\x00app_idq\x03X\x07\x00\x00\x00persistq\x04\x89u.\r\n"]
  1101.  
  1102. def send_packed_command(self, command):
  1103. "Send an already packed command to the Redis server"
  1104. if not self._sock:
  1105. > self.connect()
  1106.  
  1107. /usr/local/lib/python3.6/site-packages/redis/connection.py:585:
  1108. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1109.  
  1110. self = Connection<host=localhost,port=6379,db=0>
  1111.  
  1112. def connect(self):
  1113. "Connects to the Redis server if not already connected"
  1114. if self._sock:
  1115. return
  1116. try:
  1117. sock = self._connect()
  1118. except socket.timeout:
  1119. raise TimeoutError("Timeout connecting to server")
  1120. except socket.error:
  1121. e = sys.exc_info()[1]
  1122. > raise ConnectionError(self._error_message(e))
  1123. E redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  1124.  
  1125. /usr/local/lib/python3.6/site-packages/redis/connection.py:489: ConnectionError
  1126.  
  1127. During handling of the above exception, another exception occurred:
  1128.  
  1129. self = Connection<host=localhost,port=6379,db=0>
  1130.  
  1131. def connect(self):
  1132. "Connects to the Redis server if not already connected"
  1133. if self._sock:
  1134. return
  1135. try:
  1136. > sock = self._connect()
  1137.  
  1138. /usr/local/lib/python3.6/site-packages/redis/connection.py:484:
  1139. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1140.  
  1141. self = Connection<host=localhost,port=6379,db=0>
  1142.  
  1143. def _connect(self):
  1144. "Create a TCP socket connection"
  1145. # we want to mimic what socket.create_connection does to support
  1146. # ipv4/ipv6, but we want to set options prior to calling
  1147. # socket.connect()
  1148. err = None
  1149. for res in socket.getaddrinfo(self.host, self.port, 0,
  1150. socket.SOCK_STREAM):
  1151. family, socktype, proto, canonname, socket_address = res
  1152. sock = None
  1153. try:
  1154. sock = socket.socket(family, socktype, proto)
  1155. # TCP_NODELAY
  1156. sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
  1157.  
  1158. # TCP_KEEPALIVE
  1159. if self.socket_keepalive:
  1160. sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
  1161. for k, v in iteritems(self.socket_keepalive_options):
  1162. sock.setsockopt(socket.SOL_TCP, k, v)
  1163.  
  1164. # set the socket_connect_timeout before we connect
  1165. sock.settimeout(self.socket_connect_timeout)
  1166.  
  1167. # connect
  1168. sock.connect(socket_address)
  1169.  
  1170. # set the socket_timeout now that we're connected
  1171. sock.settimeout(self.socket_timeout)
  1172. return sock
  1173.  
  1174. except socket.error as _:
  1175. err = _
  1176. if sock is not None:
  1177. sock.close()
  1178.  
  1179. if err is not None:
  1180. > raise err
  1181.  
  1182. /usr/local/lib/python3.6/site-packages/redis/connection.py:541:
  1183. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1184.  
  1185. self = Connection<host=localhost,port=6379,db=0>
  1186.  
  1187. def _connect(self):
  1188. "Create a TCP socket connection"
  1189. # we want to mimic what socket.create_connection does to support
  1190. # ipv4/ipv6, but we want to set options prior to calling
  1191. # socket.connect()
  1192. err = None
  1193. for res in socket.getaddrinfo(self.host, self.port, 0,
  1194. socket.SOCK_STREAM):
  1195. family, socktype, proto, canonname, socket_address = res
  1196. sock = None
  1197. try:
  1198. sock = socket.socket(family, socktype, proto)
  1199. # TCP_NODELAY
  1200. sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
  1201.  
  1202. # TCP_KEEPALIVE
  1203. if self.socket_keepalive:
  1204. sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
  1205. for k, v in iteritems(self.socket_keepalive_options):
  1206. sock.setsockopt(socket.SOL_TCP, k, v)
  1207.  
  1208. # set the socket_connect_timeout before we connect
  1209. sock.settimeout(self.socket_connect_timeout)
  1210.  
  1211. # connect
  1212. > sock.connect(socket_address)
  1213.  
  1214. /usr/local/lib/python3.6/site-packages/redis/connection.py:529:
  1215. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1216.  
  1217. self = <gevent._socket3.socket [closed] object, fd=-1, family=10, type=1, proto=6>
  1218. address = ('::1', 6379, 0, 0)
  1219.  
  1220. def connect(self, address):
  1221. if self.timeout == 0.0:
  1222. return _socket.socket.connect(self._sock, address)
  1223. if isinstance(address, tuple):
  1224. r = getaddrinfo(address[0], address[1], self.family)
  1225. address = r[0][-1]
  1226. if self.timeout is not None:
  1227. timer = Timeout.start_new(self.timeout, timeout('timed out'))
  1228. else:
  1229. timer = None
  1230. try:
  1231. while True:
  1232. err = self.getsockopt(SOL_SOCKET, SO_ERROR)
  1233. if err:
  1234. raise error(err, strerror(err))
  1235. result = _socket.socket.connect_ex(self._sock, address)
  1236. if not result or result == EISCONN:
  1237. break
  1238. elif (result in (EWOULDBLOCK, EINPROGRESS, EALREADY)) or (result == EINVAL and is_windows):
  1239. self._wait(self._write_event)
  1240. else:
  1241. > raise error(result, strerror(result))
  1242. E OSError: [Errno 99] Address not available
  1243.  
  1244. /usr/local/lib/python3.6/site-packages/gevent/_socket3.py:307: OSError
  1245.  
  1246. During handling of the above exception, another exception occurred:
  1247.  
  1248. self = <tests.test_oauth.GoogleCallbackTestCase testMethod=test_valid_code>
  1249. mock_authorized_response = <MagicMock name='authorized_response' id='140158912528168'>
  1250. mock_get = <MagicMock name='get' id='140158911794984'>
  1251.  
  1252. @patch("auth.oauth.providers.google.get")
  1253. @patch("auth.oauth.providers.google.authorized_response")
  1254. def test_valid_code(self, mock_authorized_response, mock_get):
  1255. # token returned from google api
  1256. mock_authorized_response.return_value = {
  1257. "expires_in": 3600,
  1258. "id_token": ("eyJhbGciOiJSUzI1NiIsImtpZCI6IjRiMTRiZWFkODZmZjBhZDRlZTAxZWFkYWUwNzBk" "YjM3YWE2YzY2Y2QifQ."),
  1259. "token_type": "Bearer",
  1260. "access_token": ("ya29.Ci9IA92ZqnIAgf3BUqMPkIW8X4NDB9JCu12ZsV5h902nGig5xj5Ix8WVzjy1ht3s2Q"),
  1261. }
  1262.  
  1263. # user info returner from google api
  1264. class UserInfo(object):
  1265. data = {
  1266. "locale": "en",
  1267. "family_name": "Koci",
  1268. "given_name": "Pavel",
  1269. "name": "Pavel Koci",
  1270. "id": "10974864908507278145",
  1271. "email": "pavel.koci@vacuumapps.com",
  1272. "verified_email": True,
  1273. "picture": "https://lh3.googleusercontent.com/-rscbv5M/photo.jpg",
  1274. "hd": "vacuumapps.com",
  1275. }
  1276.  
  1277. mock_get.return_value = UserInfo()
  1278.  
  1279. url = "/v1/oauth.google.authorized?state={}&" "code=4%2FVq84MGCyFcHuS-1tj7gpm9hbd81NhhW6eAfMN6TSb2o".format(
  1280. self.state
  1281. )
  1282.  
  1283. > response = self.client.get(url)
  1284.  
  1285. tests/test_oauth.py:104:
  1286. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1287. /usr/local/lib/python3.6/site-packages/werkzeug/test.py:830: in get
  1288. return self.open(*args, **kw)
  1289. /usr/local/lib/python3.6/site-packages/flask/testing.py:127: in open
  1290. follow_redirects=follow_redirects)
  1291. /usr/local/lib/python3.6/site-packages/werkzeug/test.py:803: in open
  1292. response = self.run_wsgi_app(environ, buffered=buffered)
  1293. /usr/local/lib/python3.6/site-packages/werkzeug/test.py:716: in run_wsgi_app
  1294. rv = run_wsgi_app(self.application, environ, buffered=buffered)
  1295. /usr/local/lib/python3.6/site-packages/werkzeug/test.py:923: in run_wsgi_app
  1296. app_rv = app(environ, start_response)
  1297. /usr/local/lib/python3.6/site-packages/flask/app.py:1997: in __call__
  1298. return self.wsgi_app(environ, start_response)
  1299. auth/middleware.py:57: in __call__
  1300. retval = self.app(environ, custom_start_response)
  1301. /usr/local/lib/python3.6/site-packages/flask/app.py:1985: in wsgi_app
  1302. response = self.handle_exception(e)
  1303. /usr/local/lib/python3.6/site-packages/flask/app.py:1540: in handle_exception
  1304. reraise(exc_type, exc_value, tb)
  1305. /usr/local/lib/python3.6/site-packages/flask/_compat.py:33: in reraise
  1306. raise value
  1307. /usr/local/lib/python3.6/site-packages/flask/app.py:1982: in wsgi_app
  1308. response = self.full_dispatch_request()
  1309. /usr/local/lib/python3.6/site-packages/flask/app.py:1614: in full_dispatch_request
  1310. rv = self.handle_user_exception(e)
  1311. /usr/local/lib/python3.6/site-packages/flask/app.py:1517: in handle_user_exception
  1312. reraise(exc_type, exc_value, tb)
  1313. /usr/local/lib/python3.6/site-packages/flask/_compat.py:33: in reraise
  1314. raise value
  1315. /usr/local/lib/python3.6/site-packages/flask/app.py:1612: in full_dispatch_request
  1316. rv = self.dispatch_request()
  1317. /usr/local/lib/python3.6/site-packages/flask/app.py:1598: in dispatch_request
  1318. return self.view_functions[rule.endpoint](**req.view_args)
  1319. auth/oauth/views.py:120: in google_authorized
  1320. token, user_id = save_and_log_social_user(response, google)
  1321. auth/oauth/utils.py:98: in save_and_log_social_user
  1322. return create_token(db_user), db_user.user_id
  1323. auth/token/utils.py:84: in create_token
  1324. token_interface.save_token(kvtoken, user, g.app["persist"])
  1325. auth/token/storage.py:88: in save_token
  1326. store.put(token.tid, data, current_app.config["TOKEN_TTL"])
  1327. /usr/local/lib/python3.6/site-packages/simplekv/decorator.py:73: in put
  1328. self._dstore.put(self._map_key(key), *args, **kwargs))
  1329. /usr/local/lib/python3.6/site-packages/simplekv/__init__.py:395: in put
  1330. return self._put(key, data, self._valid_ttl(ttl_secs))
  1331. /usr/local/lib/python3.6/site-packages/simplekv/memory/redisstore.py:58: in _put
  1332. self.redis.setex(key, ittl, value)
  1333. /usr/local/lib/python3.6/site-packages/redis/client.py:1192: in setex
  1334. return self.execute_command('SETEX', name, time, value)
  1335. /usr/local/lib/python3.6/site-packages/ddtrace/contrib/redis/patch.py:58: in traced_execute_command
  1336. return func(*args, **kwargs)
  1337. /usr/local/lib/python3.6/site-packages/redis/client.py:673: in execute_command
  1338. connection.send_command(*args)
  1339. /usr/local/lib/python3.6/site-packages/redis/connection.py:610: in send_command
  1340. self.send_packed_command(self.pack_command(*args))
  1341. /usr/local/lib/python3.6/site-packages/redis/connection.py:585: in send_packed_command
  1342. self.connect()
  1343. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1344.  
  1345. self = Connection<host=localhost,port=6379,db=0>
  1346.  
  1347. def connect(self):
  1348. "Connects to the Redis server if not already connected"
  1349. if self._sock:
  1350. return
  1351. try:
  1352. sock = self._connect()
  1353. except socket.timeout:
  1354. raise TimeoutError("Timeout connecting to server")
  1355. except socket.error:
  1356. e = sys.exc_info()[1]
  1357. > raise ConnectionError(self._error_message(e))
  1358. E redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  1359.  
  1360. /usr/local/lib/python3.6/site-packages/redis/connection.py:489: ConnectionError
  1361. ----------------------------- Captured stdout call -----------------------------
  1362. 2019-03-08T18:35:02.153707Z [info ] request  client_addr=127.0.0.1 forwarding= method=GET path=/v1/oauth.google.authorized request_id=5886a2c88d4847f6b02b0388ee39d7cd
  1363. 2019-03-08T18:35:02.159624Z [info ] oauth.redirect_url  is_invalid=False request_id=5886a2c88d4847f6b02b0388ee39d7cd url=http://localhost/next_uri
  1364. 2019-03-08T18:35:02.160562Z [info ] parse_google_data.start  data={"email": "pavel.koci@vacuumapps.com", "family_name": "Koci", "given_name": "Pavel", "hd": "vacuumapps.com", "id": "10974864908507278145", "locale": "en", "name": "Pavel Koci", "picture": "https://lh3.googleusercontent.com/-rscbv5M/photo.jpg", "verified_email": true} request_id=5886a2c88d4847f6b02b0388ee39d7cd
  1365. 2019-03-08T18:35:02.161163Z [info ] parse_google_data.finish  data={"email": "pavel.koci@vacuumapps.com", "email_verified": true, "first_name": "Pavel", "last_name": "Koci"} request_id=5886a2c88d4847f6b02b0388ee39d7cd
  1366. ----------------------------- Captured stderr call -----------------------------
  1367. 2019-03-08T18:35:00.827895Z [debug ] stdlib_log  [ddtrace.encoding] message=using Msgpack encoder request_id=7e0724c501364ae4be2eac7c3138eb83
  1368. 2019-03-08T18:35:00.828253Z [info ] stdlib_log  [ddtrace.sampler] message=initialized RateSampler, sample 100.0% of traces request_id=7e0724c501364ae4be2eac7c3138eb83
  1369. 2019-03-08T18:35:00.835305Z [debug ] stdlib_log  [ddtrace.writer] message=resetting queues. pids(old:None new:68) request_id=7e0724c501364ae4be2eac7c3138eb83
  1370. 2019-03-08T18:35:00.835713Z [debug ] stdlib_log  [ddtrace.writer] message=starting flush thread request_id=7e0724c501364ae4be2eac7c3138eb83
  1371. 2019-03-08T18:35:00.843494Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  1372. 2019-03-08T18:35:00.847346Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  1373. 2019-03-08T18:35:01.842880Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  1374. 2019-03-08T18:35:01.849290Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  1375. 2019-03-08T18:35:02.853720Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  1376. 2019-03-08T18:35:02.856095Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  1377. ___________________ FacebookCallbackTestCase.test_valid_code ___________________
  1378.  
  1379. self = Connection<host=localhost,port=6379,db=0>
  1380.  
  1381. def connect(self):
  1382. "Connects to the Redis server if not already connected"
  1383. if self._sock:
  1384. return
  1385. try:
  1386. > sock = self._connect()
  1387.  
  1388. /usr/local/lib/python3.6/site-packages/redis/connection.py:484:
  1389. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1390.  
  1391. self = Connection<host=localhost,port=6379,db=0>
  1392.  
  1393. def _connect(self):
  1394. "Create a TCP socket connection"
  1395. # we want to mimic what socket.create_connection does to support
  1396. # ipv4/ipv6, but we want to set options prior to calling
  1397. # socket.connect()
  1398. err = None
  1399. for res in socket.getaddrinfo(self.host, self.port, 0,
  1400. socket.SOCK_STREAM):
  1401. family, socktype, proto, canonname, socket_address = res
  1402. sock = None
  1403. try:
  1404. sock = socket.socket(family, socktype, proto)
  1405. # TCP_NODELAY
  1406. sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
  1407.  
  1408. # TCP_KEEPALIVE
  1409. if self.socket_keepalive:
  1410. sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
  1411. for k, v in iteritems(self.socket_keepalive_options):
  1412. sock.setsockopt(socket.SOL_TCP, k, v)
  1413.  
  1414. # set the socket_connect_timeout before we connect
  1415. sock.settimeout(self.socket_connect_timeout)
  1416.  
  1417. # connect
  1418. sock.connect(socket_address)
  1419.  
  1420. # set the socket_timeout now that we're connected
  1421. sock.settimeout(self.socket_timeout)
  1422. return sock
  1423.  
  1424. except socket.error as _:
  1425. err = _
  1426. if sock is not None:
  1427. sock.close()
  1428.  
  1429. if err is not None:
  1430. > raise err
  1431.  
  1432. /usr/local/lib/python3.6/site-packages/redis/connection.py:541:
  1433. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1434.  
  1435. self = Connection<host=localhost,port=6379,db=0>
  1436.  
  1437. def _connect(self):
  1438. "Create a TCP socket connection"
  1439. # we want to mimic what socket.create_connection does to support
  1440. # ipv4/ipv6, but we want to set options prior to calling
  1441. # socket.connect()
  1442. err = None
  1443. for res in socket.getaddrinfo(self.host, self.port, 0,
  1444. socket.SOCK_STREAM):
  1445. family, socktype, proto, canonname, socket_address = res
  1446. sock = None
  1447. try:
  1448. sock = socket.socket(family, socktype, proto)
  1449. # TCP_NODELAY
  1450. sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
  1451.  
  1452. # TCP_KEEPALIVE
  1453. if self.socket_keepalive:
  1454. sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
  1455. for k, v in iteritems(self.socket_keepalive_options):
  1456. sock.setsockopt(socket.SOL_TCP, k, v)
  1457.  
  1458. # set the socket_connect_timeout before we connect
  1459. sock.settimeout(self.socket_connect_timeout)
  1460.  
  1461. # connect
  1462. > sock.connect(socket_address)
  1463.  
  1464. /usr/local/lib/python3.6/site-packages/redis/connection.py:529:
  1465. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1466.  
  1467. self = <gevent._socket3.socket [closed] object, fd=-1, family=10, type=1, proto=6>
  1468. address = ('::1', 6379, 0, 0)
  1469.  
  1470. def connect(self, address):
  1471. if self.timeout == 0.0:
  1472. return _socket.socket.connect(self._sock, address)
  1473. if isinstance(address, tuple):
  1474. r = getaddrinfo(address[0], address[1], self.family)
  1475. address = r[0][-1]
  1476. if self.timeout is not None:
  1477. timer = Timeout.start_new(self.timeout, timeout('timed out'))
  1478. else:
  1479. timer = None
  1480. try:
  1481. while True:
  1482. err = self.getsockopt(SOL_SOCKET, SO_ERROR)
  1483. if err:
  1484. raise error(err, strerror(err))
  1485. result = _socket.socket.connect_ex(self._sock, address)
  1486. if not result or result == EISCONN:
  1487. break
  1488. elif (result in (EWOULDBLOCK, EINPROGRESS, EALREADY)) or (result == EINVAL and is_windows):
  1489. self._wait(self._write_event)
  1490. else:
  1491. > raise error(result, strerror(result))
  1492. E OSError: [Errno 99] Address not available
  1493.  
  1494. /usr/local/lib/python3.6/site-packages/gevent/_socket3.py:307: OSError
  1495.  
  1496. During handling of the above exception, another exception occurred:
  1497.  
  1498. self = StrictRedis<ConnectionPool<Connection<host=localhost,port=6379,db=0>>>
  1499. args = ('SETEX', 'token_WyI0MTczVnlxdlVaYmp1alBod3loc0x3IiwiR1NvMjFESDM4TDg5VnVqNXJPWFBrZVRyNlliQzNtUklLWmtTT0t6VHVTYVN0eEJrO...1\x8a\x05\xd0\xead\x8e\x00X\x06\x00\x00\x00app_idq\x02X\x06\x00\x00\x00app_idq\x03X\x07\x00\x00\x00persistq\x04\x89u.')
  1500. options = {}, pool = ConnectionPool<Connection<host=localhost,port=6379,db=0>>
  1501. command_name = 'SETEX', connection = Connection<host=localhost,port=6379,db=0>
  1502.  
  1503. def execute_command(self, *args, **options):
  1504. "Execute a command and return a parsed response"
  1505. pool = self.connection_pool
  1506. command_name = args[0]
  1507. connection = pool.get_connection(command_name, **options)
  1508. try:
  1509. > connection.send_command(*args)
  1510.  
  1511. /usr/local/lib/python3.6/site-packages/redis/client.py:667:
  1512. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1513.  
  1514. self = Connection<host=localhost,port=6379,db=0>
  1515. args = ('SETEX', 'token_WyI0MTczVnlxdlVaYmp1alBod3loc0x3IiwiR1NvMjFESDM4TDg5VnVqNXJPWFBrZVRyNlliQzNtUklLWmtTT0t6VHVTYVN0eEJrO...1\x8a\x05\xd0\xead\x8e\x00X\x06\x00\x00\x00app_idq\x02X\x06\x00\x00\x00app_idq\x03X\x07\x00\x00\x00persistq\x04\x89u.')
  1516.  
  1517. def send_command(self, *args):
  1518. "Pack and send a command to the Redis server"
  1519. > self.send_packed_command(self.pack_command(*args))
  1520.  
  1521. /usr/local/lib/python3.6/site-packages/redis/connection.py:610:
  1522. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1523.  
  1524. self = Connection<host=localhost,port=6379,db=0>
  1525. command = [b'*4\r\n$5\r\nSETEX\r\n$158\r\ntoken_WyI0MTczVnlxdlVaYmp1alBod3loc0x3IiwiR1NvMjFESDM4TDg5VnVqNXJPWFBrZVRyNlliQzNtUklL...a\x05\xd0\xead\x8e\x00X\x06\x00\x00\x00app_idq\x02X\x06\x00\x00\x00app_idq\x03X\x07\x00\x00\x00persistq\x04\x89u.\r\n']
  1526.  
  1527. def send_packed_command(self, command):
  1528. "Send an already packed command to the Redis server"
  1529. if not self._sock:
  1530. > self.connect()
  1531.  
  1532. /usr/local/lib/python3.6/site-packages/redis/connection.py:585:
  1533. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1534.  
  1535. self = Connection<host=localhost,port=6379,db=0>
  1536.  
  1537. def connect(self):
  1538. "Connects to the Redis server if not already connected"
  1539. if self._sock:
  1540. return
  1541. try:
  1542. sock = self._connect()
  1543. except socket.timeout:
  1544. raise TimeoutError("Timeout connecting to server")
  1545. except socket.error:
  1546. e = sys.exc_info()[1]
  1547. > raise ConnectionError(self._error_message(e))
  1548. E redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  1549.  
  1550. /usr/local/lib/python3.6/site-packages/redis/connection.py:489: ConnectionError
  1551.  
  1552. During handling of the above exception, another exception occurred:
  1553.  
  1554. self = Connection<host=localhost,port=6379,db=0>
  1555.  
  1556. def connect(self):
  1557. "Connects to the Redis server if not already connected"
  1558. if self._sock:
  1559. return
  1560. try:
  1561. > sock = self._connect()
  1562.  
  1563. /usr/local/lib/python3.6/site-packages/redis/connection.py:484:
  1564. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1565.  
  1566. self = Connection<host=localhost,port=6379,db=0>
  1567.  
  1568. def _connect(self):
  1569. "Create a TCP socket connection"
  1570. # we want to mimic what socket.create_connection does to support
  1571. # ipv4/ipv6, but we want to set options prior to calling
  1572. # socket.connect()
  1573. err = None
  1574. for res in socket.getaddrinfo(self.host, self.port, 0,
  1575. socket.SOCK_STREAM):
  1576. family, socktype, proto, canonname, socket_address = res
  1577. sock = None
  1578. try:
  1579. sock = socket.socket(family, socktype, proto)
  1580. # TCP_NODELAY
  1581. sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
  1582.  
  1583. # TCP_KEEPALIVE
  1584. if self.socket_keepalive:
  1585. sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
  1586. for k, v in iteritems(self.socket_keepalive_options):
  1587. sock.setsockopt(socket.SOL_TCP, k, v)
  1588.  
  1589. # set the socket_connect_timeout before we connect
  1590. sock.settimeout(self.socket_connect_timeout)
  1591.  
  1592. # connect
  1593. sock.connect(socket_address)
  1594.  
  1595. # set the socket_timeout now that we're connected
  1596. sock.settimeout(self.socket_timeout)
  1597. return sock
  1598.  
  1599. except socket.error as _:
  1600. err = _
  1601. if sock is not None:
  1602. sock.close()
  1603.  
  1604. if err is not None:
  1605. > raise err
  1606.  
  1607. /usr/local/lib/python3.6/site-packages/redis/connection.py:541:
  1608. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1609.  
  1610. self = Connection<host=localhost,port=6379,db=0>
  1611.  
  1612. def _connect(self):
  1613. "Create a TCP socket connection"
  1614. # we want to mimic what socket.create_connection does to support
  1615. # ipv4/ipv6, but we want to set options prior to calling
  1616. # socket.connect()
  1617. err = None
  1618. for res in socket.getaddrinfo(self.host, self.port, 0,
  1619. socket.SOCK_STREAM):
  1620. family, socktype, proto, canonname, socket_address = res
  1621. sock = None
  1622. try:
  1623. sock = socket.socket(family, socktype, proto)
  1624. # TCP_NODELAY
  1625. sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
  1626.  
  1627. # TCP_KEEPALIVE
  1628. if self.socket_keepalive:
  1629. sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
  1630. for k, v in iteritems(self.socket_keepalive_options):
  1631. sock.setsockopt(socket.SOL_TCP, k, v)
  1632.  
  1633. # set the socket_connect_timeout before we connect
  1634. sock.settimeout(self.socket_connect_timeout)
  1635.  
  1636. # connect
  1637. > sock.connect(socket_address)
  1638.  
  1639. /usr/local/lib/python3.6/site-packages/redis/connection.py:529:
  1640. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1641.  
  1642. self = <gevent._socket3.socket [closed] object, fd=-1, family=10, type=1, proto=6>
  1643. address = ('::1', 6379, 0, 0)
  1644.  
  1645. def connect(self, address):
  1646. if self.timeout == 0.0:
  1647. return _socket.socket.connect(self._sock, address)
  1648. if isinstance(address, tuple):
  1649. r = getaddrinfo(address[0], address[1], self.family)
  1650. address = r[0][-1]
  1651. if self.timeout is not None:
  1652. timer = Timeout.start_new(self.timeout, timeout('timed out'))
  1653. else:
  1654. timer = None
  1655. try:
  1656. while True:
  1657. err = self.getsockopt(SOL_SOCKET, SO_ERROR)
  1658. if err:
  1659. raise error(err, strerror(err))
  1660. result = _socket.socket.connect_ex(self._sock, address)
  1661. if not result or result == EISCONN:
  1662. break
  1663. elif (result in (EWOULDBLOCK, EINPROGRESS, EALREADY)) or (result == EINVAL and is_windows):
  1664. self._wait(self._write_event)
  1665. else:
  1666. > raise error(result, strerror(result))
  1667. E OSError: [Errno 99] Address not available
  1668.  
  1669. /usr/local/lib/python3.6/site-packages/gevent/_socket3.py:307: OSError
  1670.  
  1671. During handling of the above exception, another exception occurred:
  1672.  
  1673. self = <tests.test_oauth.FacebookCallbackTestCase testMethod=test_valid_code>
  1674. mock_authorized_response = <MagicMock name='authorized_response' id='140158912513920'>
  1675. mock_get = <MagicMock name='get' id='140158911227496'>
  1676.  
  1677. @patch("auth.oauth.providers.facebook.get")
  1678. @patch("auth.oauth.providers.facebook.authorized_response")
  1679. def test_valid_code(self, mock_authorized_response, mock_get):
  1680. # token returned from google api
  1681. mock_authorized_response.return_value = {
  1682. "access_token": (
  1683. "EAAOn6HZCqOwEBAN5W8ngQ7iZB7TyF9WvHT6GLjfeN7Bo8J92JZBG"
  1684. "jFrFskU4UZApmP6EGhnbCZBJnBoI8kHcMR9tjoMATs4isbxcbgg2a"
  1685. "3eu62vZBJyPDrsFKeCB6s4LA1aShnLjSazR8w3EkuST02QVP5tvbw"
  1686. "CvAZD"
  1687. ),
  1688. "expires": "5102404",
  1689. }
  1690.  
  1691. # user info returner from google api
  1692. class UserInfo(object):
  1693. data = {"last_name": "Pelikan", "email": "juraj.pelikan@gmail.com", "first_name": "Juraj"}
  1694.  
  1695. mock_get.return_value = UserInfo()
  1696. url = (
  1697. "/v1/oauth.facebook.authorized?code=AQA_gYQhqs45SvcCexSvPN"
  1698. "Lced0GQvPYf-lc0X0JCwdDlcgabynOsh78j-iJrS0canjF3q8dN4O81ir"
  1699. "F5OLPagd8mAORKAu_qqcH57Ixz8Gl5BzAWkdLo0wh4cuBRSCtSCWNVCF2"
  1700. "oUC2EDjWgjGsnDyzjBMDCkhn7hbJrbVEkGw4dtpyrAs8vv6a5m6XvJjgV"
  1701. "WgnclfrDTh5s-iMNW3B0QOYpJL6ihpG0MpkemdeMWj3KafJWOGvZk65I9"
  1702. "4Hfeh8vQw_teI2M-_J1HlqXZ0sE6ak_oLx-iiMp-dn2tpUYB5M6Zv-QGy"
  1703. "eA1jKaD-4ht2H30&state={}"
  1704. ).format(self.state)
  1705. > response = self.client.get(url)
  1706.  
  1707. tests/test_oauth.py:202:
  1708. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1709. /usr/local/lib/python3.6/site-packages/werkzeug/test.py:830: in get
  1710. return self.open(*args, **kw)
  1711. /usr/local/lib/python3.6/site-packages/flask/testing.py:127: in open
  1712. follow_redirects=follow_redirects)
  1713. /usr/local/lib/python3.6/site-packages/werkzeug/test.py:803: in open
  1714. response = self.run_wsgi_app(environ, buffered=buffered)
  1715. /usr/local/lib/python3.6/site-packages/werkzeug/test.py:716: in run_wsgi_app
  1716. rv = run_wsgi_app(self.application, environ, buffered=buffered)
  1717. /usr/local/lib/python3.6/site-packages/werkzeug/test.py:923: in run_wsgi_app
  1718. app_rv = app(environ, start_response)
  1719. /usr/local/lib/python3.6/site-packages/flask/app.py:1997: in __call__
  1720. return self.wsgi_app(environ, start_response)
  1721. auth/middleware.py:57: in __call__
  1722. retval = self.app(environ, custom_start_response)
  1723. /usr/local/lib/python3.6/site-packages/flask/app.py:1985: in wsgi_app
  1724. response = self.handle_exception(e)
  1725. /usr/local/lib/python3.6/site-packages/flask/app.py:1540: in handle_exception
  1726. reraise(exc_type, exc_value, tb)
  1727. /usr/local/lib/python3.6/site-packages/flask/_compat.py:33: in reraise
  1728. raise value
  1729. /usr/local/lib/python3.6/site-packages/flask/app.py:1982: in wsgi_app
  1730. response = self.full_dispatch_request()
  1731. /usr/local/lib/python3.6/site-packages/flask/app.py:1614: in full_dispatch_request
  1732. rv = self.handle_user_exception(e)
  1733. /usr/local/lib/python3.6/site-packages/flask/app.py:1517: in handle_user_exception
  1734. reraise(exc_type, exc_value, tb)
  1735. /usr/local/lib/python3.6/site-packages/flask/_compat.py:33: in reraise
  1736. raise value
  1737. /usr/local/lib/python3.6/site-packages/flask/app.py:1612: in full_dispatch_request
  1738. rv = self.dispatch_request()
  1739. /usr/local/lib/python3.6/site-packages/flask/app.py:1598: in dispatch_request
  1740. return self.view_functions[rule.endpoint](**req.view_args)
  1741. auth/oauth/views.py:98: in facebook_authorized
  1742. token, user_id = save_and_log_social_user(response, facebook)
  1743. auth/oauth/utils.py:98: in save_and_log_social_user
  1744. return create_token(db_user), db_user.user_id
  1745. auth/token/utils.py:84: in create_token
  1746. token_interface.save_token(kvtoken, user, g.app["persist"])
  1747. auth/token/storage.py:88: in save_token
  1748. store.put(token.tid, data, current_app.config["TOKEN_TTL"])
  1749. /usr/local/lib/python3.6/site-packages/simplekv/decorator.py:73: in put
  1750. self._dstore.put(self._map_key(key), *args, **kwargs))
  1751. /usr/local/lib/python3.6/site-packages/simplekv/__init__.py:395: in put
  1752. return self._put(key, data, self._valid_ttl(ttl_secs))
  1753. /usr/local/lib/python3.6/site-packages/simplekv/memory/redisstore.py:58: in _put
  1754. self.redis.setex(key, ittl, value)
  1755. /usr/local/lib/python3.6/site-packages/redis/client.py:1192: in setex
  1756. return self.execute_command('SETEX', name, time, value)
  1757. /usr/local/lib/python3.6/site-packages/ddtrace/contrib/redis/patch.py:58: in traced_execute_command
  1758. return func(*args, **kwargs)
  1759. /usr/local/lib/python3.6/site-packages/redis/client.py:673: in execute_command
  1760. connection.send_command(*args)
  1761. /usr/local/lib/python3.6/site-packages/redis/connection.py:610: in send_command
  1762. self.send_packed_command(self.pack_command(*args))
  1763. /usr/local/lib/python3.6/site-packages/redis/connection.py:585: in send_packed_command
  1764. self.connect()
  1765. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1766.  
  1767. self = Connection<host=localhost,port=6379,db=0>
  1768.  
  1769. def connect(self):
  1770. "Connects to the Redis server if not already connected"
  1771. if self._sock:
  1772. return
  1773. try:
  1774. sock = self._connect()
  1775. except socket.timeout:
  1776. raise TimeoutError("Timeout connecting to server")
  1777. except socket.error:
  1778. e = sys.exc_info()[1]
  1779. > raise ConnectionError(self._error_message(e))
  1780. E redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  1781.  
  1782. /usr/local/lib/python3.6/site-packages/redis/connection.py:489: ConnectionError
  1783. ----------------------------- Captured stdout call -----------------------------
  1784. 2019-03-08T18:35:11.045884Z [info ] request  client_addr=127.0.0.1 forwarding= method=GET path=/v1/oauth.facebook.authorized request_id=b87c080fb13944cbae7a648fa08b47d5
  1785. 2019-03-08T18:35:11.051289Z [info ] oauth.redirect_url  is_invalid=False request_id=b87c080fb13944cbae7a648fa08b47d5 url=http://localhost/next_uri
  1786. 2019-03-08T18:35:11.052212Z [info ] parse_facebook_data.start data={"email": "juraj.pelikan@gmail.com", "first_name": "Juraj", "last_name": "Pelikan"} request_id=b87c080fb13944cbae7a648fa08b47d5
  1787. 2019-03-08T18:35:11.052809Z [info ] parse_facebook_data.finish data={"email": "juraj.pelikan@gmail.com", "email_verified": true, "first_name": "Juraj", "last_name": "Pelikan"} request_id=b87c080fb13944cbae7a648fa08b47d5
  1788. ----------------------------- Captured stderr call -----------------------------
  1789. 2019-03-08T18:35:09.634388Z [debug ] stdlib_log  [ddtrace.encoding] message=using Msgpack encoder request_id=e15169f2ecd54c919142ae9748f29a91
  1790. 2019-03-08T18:35:09.635319Z [info ] stdlib_log  [ddtrace.sampler] message=initialized RateSampler, sample 100.0% of traces request_id=e15169f2ecd54c919142ae9748f29a91
  1791. 2019-03-08T18:35:09.646463Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  1792. 2019-03-08T18:35:09.648339Z [debug ] stdlib_log  [ddtrace.writer] message=resetting queues. pids(old:None new:68) request_id=e15169f2ecd54c919142ae9748f29a91
  1793. 2019-03-08T18:35:09.648753Z [debug ] stdlib_log  [ddtrace.writer] message=starting flush thread request_id=e15169f2ecd54c919142ae9748f29a91
  1794. 2019-03-08T18:35:09.650310Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  1795. 2019-03-08T18:35:10.658836Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  1796. 2019-03-08T18:35:10.663175Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  1797. 2019-03-08T18:35:11.672951Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  1798. 2019-03-08T18:35:11.677275Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  1799. ______________ FacebookMobileConnectTestCase.test_mobile_connect _______________
  1800.  
  1801. self = Connection<host=localhost,port=6379,db=0>
  1802.  
  1803. def connect(self):
  1804. "Connects to the Redis server if not already connected"
  1805. if self._sock:
  1806. return
  1807. try:
  1808. > sock = self._connect()
  1809.  
  1810. /usr/local/lib/python3.6/site-packages/redis/connection.py:484:
  1811. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1812.  
  1813. self = Connection<host=localhost,port=6379,db=0>
  1814.  
  1815. def _connect(self):
  1816. "Create a TCP socket connection"
  1817. # we want to mimic what socket.create_connection does to support
  1818. # ipv4/ipv6, but we want to set options prior to calling
  1819. # socket.connect()
  1820. err = None
  1821. for res in socket.getaddrinfo(self.host, self.port, 0,
  1822. socket.SOCK_STREAM):
  1823. family, socktype, proto, canonname, socket_address = res
  1824. sock = None
  1825. try:
  1826. sock = socket.socket(family, socktype, proto)
  1827. # TCP_NODELAY
  1828. sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
  1829.  
  1830. # TCP_KEEPALIVE
  1831. if self.socket_keepalive:
  1832. sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
  1833. for k, v in iteritems(self.socket_keepalive_options):
  1834. sock.setsockopt(socket.SOL_TCP, k, v)
  1835.  
  1836. # set the socket_connect_timeout before we connect
  1837. sock.settimeout(self.socket_connect_timeout)
  1838.  
  1839. # connect
  1840. sock.connect(socket_address)
  1841.  
  1842. # set the socket_timeout now that we're connected
  1843. sock.settimeout(self.socket_timeout)
  1844. return sock
  1845.  
  1846. except socket.error as _:
  1847. err = _
  1848. if sock is not None:
  1849. sock.close()
  1850.  
  1851. if err is not None:
  1852. > raise err
  1853.  
  1854. /usr/local/lib/python3.6/site-packages/redis/connection.py:541:
  1855. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1856.  
  1857. self = Connection<host=localhost,port=6379,db=0>
  1858.  
  1859. def _connect(self):
  1860. "Create a TCP socket connection"
  1861. # we want to mimic what socket.create_connection does to support
  1862. # ipv4/ipv6, but we want to set options prior to calling
  1863. # socket.connect()
  1864. err = None
  1865. for res in socket.getaddrinfo(self.host, self.port, 0,
  1866. socket.SOCK_STREAM):
  1867. family, socktype, proto, canonname, socket_address = res
  1868. sock = None
  1869. try:
  1870. sock = socket.socket(family, socktype, proto)
  1871. # TCP_NODELAY
  1872. sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
  1873.  
  1874. # TCP_KEEPALIVE
  1875. if self.socket_keepalive:
  1876. sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
  1877. for k, v in iteritems(self.socket_keepalive_options):
  1878. sock.setsockopt(socket.SOL_TCP, k, v)
  1879.  
  1880. # set the socket_connect_timeout before we connect
  1881. sock.settimeout(self.socket_connect_timeout)
  1882.  
  1883. # connect
  1884. > sock.connect(socket_address)
  1885.  
  1886. /usr/local/lib/python3.6/site-packages/redis/connection.py:529:
  1887. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1888.  
  1889. self = <gevent._socket3.socket [closed] object, fd=-1, family=10, type=1, proto=6>
  1890. address = ('::1', 6379, 0, 0)
  1891.  
  1892. def connect(self, address):
  1893. if self.timeout == 0.0:
  1894. return _socket.socket.connect(self._sock, address)
  1895. if isinstance(address, tuple):
  1896. r = getaddrinfo(address[0], address[1], self.family)
  1897. address = r[0][-1]
  1898. if self.timeout is not None:
  1899. timer = Timeout.start_new(self.timeout, timeout('timed out'))
  1900. else:
  1901. timer = None
  1902. try:
  1903. while True:
  1904. err = self.getsockopt(SOL_SOCKET, SO_ERROR)
  1905. if err:
  1906. raise error(err, strerror(err))
  1907. result = _socket.socket.connect_ex(self._sock, address)
  1908. if not result or result == EISCONN:
  1909. break
  1910. elif (result in (EWOULDBLOCK, EINPROGRESS, EALREADY)) or (result == EINVAL and is_windows):
  1911. self._wait(self._write_event)
  1912. else:
  1913. > raise error(result, strerror(result))
  1914. E OSError: [Errno 99] Address not available
  1915.  
  1916. /usr/local/lib/python3.6/site-packages/gevent/_socket3.py:307: OSError
  1917.  
  1918. During handling of the above exception, another exception occurred:
  1919.  
  1920. self = StrictRedis<ConnectionPool<Connection<host=localhost,port=6379,db=0>>>
  1921. args = ('SETEX', 'token_WyItclhCTjFISXpDd05NTU80aUhXMHpwIiwiZUwxdDBsNFZyakNBYXFHaGxOdVhFdTZSTmVsOEs1ZTFZUWtiZzV4eXV5WlNSQlFrd...idq\x01\x8a\x05:Kn\x82\x00X\x06\x00\x00\x00app_idq\x02X\x06\x00\x00\x00app_idq\x03X\x07\x00\x00\x00persistq\x04\x89u.')
  1922. options = {}, pool = ConnectionPool<Connection<host=localhost,port=6379,db=0>>
  1923. command_name = 'SETEX', connection = Connection<host=localhost,port=6379,db=0>
  1924.  
  1925. def execute_command(self, *args, **options):
  1926. "Execute a command and return a parsed response"
  1927. pool = self.connection_pool
  1928. command_name = args[0]
  1929. connection = pool.get_connection(command_name, **options)
  1930. try:
  1931. > connection.send_command(*args)
  1932.  
  1933. /usr/local/lib/python3.6/site-packages/redis/client.py:667:
  1934. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1935.  
  1936. self = Connection<host=localhost,port=6379,db=0>
  1937. args = ('SETEX', 'token_WyItclhCTjFISXpDd05NTU80aUhXMHpwIiwiZUwxdDBsNFZyakNBYXFHaGxOdVhFdTZSTmVsOEs1ZTFZUWtiZzV4eXV5WlNSQlFrd...idq\x01\x8a\x05:Kn\x82\x00X\x06\x00\x00\x00app_idq\x02X\x06\x00\x00\x00app_idq\x03X\x07\x00\x00\x00persistq\x04\x89u.')
  1938.  
  1939. def send_command(self, *args):
  1940. "Pack and send a command to the Redis server"
  1941. > self.send_packed_command(self.pack_command(*args))
  1942.  
  1943. /usr/local/lib/python3.6/site-packages/redis/connection.py:610:
  1944. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1945.  
  1946. self = Connection<host=localhost,port=6379,db=0>
  1947. command = [b'*4\r\n$5\r\nSETEX\r\n$158\r\ntoken_WyItclhCTjFISXpDd05NTU80aUhXMHpwIiwiZUwxdDBsNFZyakNBYXFHaGxOdVhFdTZSTmVsOEs1ZTFZ...x01\x8a\x05:Kn\x82\x00X\x06\x00\x00\x00app_idq\x02X\x06\x00\x00\x00app_idq\x03X\x07\x00\x00\x00persistq\x04\x89u.\r\n']
  1948.  
  1949. def send_packed_command(self, command):
  1950. "Send an already packed command to the Redis server"
  1951. if not self._sock:
  1952. > self.connect()
  1953.  
  1954. /usr/local/lib/python3.6/site-packages/redis/connection.py:585:
  1955. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1956.  
  1957. self = Connection<host=localhost,port=6379,db=0>
  1958.  
  1959. def connect(self):
  1960. "Connects to the Redis server if not already connected"
  1961. if self._sock:
  1962. return
  1963. try:
  1964. sock = self._connect()
  1965. except socket.timeout:
  1966. raise TimeoutError("Timeout connecting to server")
  1967. except socket.error:
  1968. e = sys.exc_info()[1]
  1969. > raise ConnectionError(self._error_message(e))
  1970. E redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  1971.  
  1972. /usr/local/lib/python3.6/site-packages/redis/connection.py:489: ConnectionError
  1973.  
  1974. During handling of the above exception, another exception occurred:
  1975.  
  1976. self = Connection<host=localhost,port=6379,db=0>
  1977.  
  1978. def connect(self):
  1979. "Connects to the Redis server if not already connected"
  1980. if self._sock:
  1981. return
  1982. try:
  1983. > sock = self._connect()
  1984.  
  1985. /usr/local/lib/python3.6/site-packages/redis/connection.py:484:
  1986. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1987.  
  1988. self = Connection<host=localhost,port=6379,db=0>
  1989.  
  1990. def _connect(self):
  1991. "Create a TCP socket connection"
  1992. # we want to mimic what socket.create_connection does to support
  1993. # ipv4/ipv6, but we want to set options prior to calling
  1994. # socket.connect()
  1995. err = None
  1996. for res in socket.getaddrinfo(self.host, self.port, 0,
  1997. socket.SOCK_STREAM):
  1998. family, socktype, proto, canonname, socket_address = res
  1999. sock = None
  2000. try:
  2001. sock = socket.socket(family, socktype, proto)
  2002. # TCP_NODELAY
  2003. sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
  2004.  
  2005. # TCP_KEEPALIVE
  2006. if self.socket_keepalive:
  2007. sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
  2008. for k, v in iteritems(self.socket_keepalive_options):
  2009. sock.setsockopt(socket.SOL_TCP, k, v)
  2010.  
  2011. # set the socket_connect_timeout before we connect
  2012. sock.settimeout(self.socket_connect_timeout)
  2013.  
  2014. # connect
  2015. sock.connect(socket_address)
  2016.  
  2017. # set the socket_timeout now that we're connected
  2018. sock.settimeout(self.socket_timeout)
  2019. return sock
  2020.  
  2021. except socket.error as _:
  2022. err = _
  2023. if sock is not None:
  2024. sock.close()
  2025.  
  2026. if err is not None:
  2027. > raise err
  2028.  
  2029. /usr/local/lib/python3.6/site-packages/redis/connection.py:541:
  2030. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  2031.  
  2032. self = Connection<host=localhost,port=6379,db=0>
  2033.  
  2034. def _connect(self):
  2035. "Create a TCP socket connection"
  2036. # we want to mimic what socket.create_connection does to support
  2037. # ipv4/ipv6, but we want to set options prior to calling
  2038. # socket.connect()
  2039. err = None
  2040. for res in socket.getaddrinfo(self.host, self.port, 0,
  2041. socket.SOCK_STREAM):
  2042. family, socktype, proto, canonname, socket_address = res
  2043. sock = None
  2044. try:
  2045. sock = socket.socket(family, socktype, proto)
  2046. # TCP_NODELAY
  2047. sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
  2048.  
  2049. # TCP_KEEPALIVE
  2050. if self.socket_keepalive:
  2051. sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
  2052. for k, v in iteritems(self.socket_keepalive_options):
  2053. sock.setsockopt(socket.SOL_TCP, k, v)
  2054.  
  2055. # set the socket_connect_timeout before we connect
  2056. sock.settimeout(self.socket_connect_timeout)
  2057.  
  2058. # connect
  2059. > sock.connect(socket_address)
  2060.  
  2061. /usr/local/lib/python3.6/site-packages/redis/connection.py:529:
  2062. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  2063.  
  2064. self = <gevent._socket3.socket [closed] object, fd=-1, family=10, type=1, proto=6>
  2065. address = ('::1', 6379, 0, 0)
  2066.  
  2067. def connect(self, address):
  2068. if self.timeout == 0.0:
  2069. return _socket.socket.connect(self._sock, address)
  2070. if isinstance(address, tuple):
  2071. r = getaddrinfo(address[0], address[1], self.family)
  2072. address = r[0][-1]
  2073. if self.timeout is not None:
  2074. timer = Timeout.start_new(self.timeout, timeout('timed out'))
  2075. else:
  2076. timer = None
  2077. try:
  2078. while True:
  2079. err = self.getsockopt(SOL_SOCKET, SO_ERROR)
  2080. if err:
  2081. raise error(err, strerror(err))
  2082. result = _socket.socket.connect_ex(self._sock, address)
  2083. if not result or result == EISCONN:
  2084. break
  2085. elif (result in (EWOULDBLOCK, EINPROGRESS, EALREADY)) or (result == EINVAL and is_windows):
  2086. self._wait(self._write_event)
  2087. else:
  2088. > raise error(result, strerror(result))
  2089. E OSError: [Errno 99] Address not available
  2090.  
  2091. /usr/local/lib/python3.6/site-packages/gevent/_socket3.py:307: OSError
  2092.  
  2093. During handling of the above exception, another exception occurred:
  2094.  
  2095. self = <tests.test_oauth.FacebookMobileConnectTestCase testMethod=test_mobile_connect>
  2096. mock_get = <MagicMock name='get' id='140158917827608'>
  2097. mock_verifier = <MagicMock name='verify_access_token' id='140158915753800'>
  2098.  
  2099. @patch("auth.oauth.views.verify_access_token")
  2100. @patch("auth.oauth.providers.facebook.get")
  2101. def test_mobile_connect(self, mock_get, mock_verifier):
  2102. self.assertEqual(User.query.count(), 0)
  2103.  
  2104. class UserInfo(object):
  2105. data = {"last_name": "Pelikan", "email": "juraj.pelikan@gmail.com", "first_name": "Juraj"}
  2106.  
  2107. mock_get.return_value = UserInfo()
  2108. oauth_payload = {
  2109. "access_token": (
  2110. "EAAOn6HZCqOwEBAN5W8ngQ7iZB7TyF9WvHT6GLjfeN7Bo8J92JZBG"
  2111. "jFrFskU4UZApmP6EGhnbCZBJnBoI8kHcMR9tjoMATs4isbxcbgg2a"
  2112. "3eu62vZBJyPDrsFKeCB6s4LA1aShnLjSazR8w3EkuST02QVP5tvbw"
  2113. "CvAZD"
  2114. ),
  2115. "expires": "5102404",
  2116. }
  2117. headers = {"Authorization": "Basic " + b64encode(b"app_id:").decode("utf8")}
  2118. resp = self.client.post(
  2119. "/v1/oauth.facebook.connect",
  2120. data=json.dumps(oauth_payload),
  2121. content_type="application/json",
  2122. > headers=headers,
  2123. )
  2124.  
  2125. tests/test_oauth.py:244:
  2126. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  2127. /usr/local/lib/python3.6/site-packages/werkzeug/test.py:840: in post
  2128. return self.open(*args, **kw)
  2129. /usr/local/lib/python3.6/site-packages/flask/testing.py:127: in open
  2130. follow_redirects=follow_redirects)
  2131. /usr/local/lib/python3.6/site-packages/werkzeug/test.py:803: in open
  2132. response = self.run_wsgi_app(environ, buffered=buffered)
  2133. /usr/local/lib/python3.6/site-packages/werkzeug/test.py:716: in run_wsgi_app
  2134. rv = run_wsgi_app(self.application, environ, buffered=buffered)
  2135. /usr/local/lib/python3.6/site-packages/werkzeug/test.py:923: in run_wsgi_app
  2136. app_rv = app(environ, start_response)
  2137. /usr/local/lib/python3.6/site-packages/flask/app.py:1997: in __call__
  2138. return self.wsgi_app(environ, start_response)
  2139. auth/middleware.py:57: in __call__
  2140. retval = self.app(environ, custom_start_response)
  2141. /usr/local/lib/python3.6/site-packages/flask/app.py:1985: in wsgi_app
  2142. response = self.handle_exception(e)
  2143. /usr/local/lib/python3.6/site-packages/flask/app.py:1540: in handle_exception
  2144. reraise(exc_type, exc_value, tb)
  2145. /usr/local/lib/python3.6/site-packages/flask/_compat.py:33: in reraise
  2146. raise value
  2147. /usr/local/lib/python3.6/site-packages/flask/app.py:1982: in wsgi_app
  2148. response = self.full_dispatch_request()
  2149. /usr/local/lib/python3.6/site-packages/flask/app.py:1614: in full_dispatch_request
  2150. rv = self.handle_user_exception(e)
  2151. /usr/local/lib/python3.6/site-packages/flask/app.py:1517: in handle_user_exception
  2152. reraise(exc_type, exc_value, tb)
  2153. /usr/local/lib/python3.6/site-packages/flask/_compat.py:33: in reraise
  2154. raise value
  2155. /usr/local/lib/python3.6/site-packages/flask/app.py:1612: in full_dispatch_request
  2156. rv = self.dispatch_request()
  2157. /usr/local/lib/python3.6/site-packages/flask/app.py:1598: in dispatch_request
  2158. return self.view_functions[rule.endpoint](**req.view_args)
  2159. ../packages/flask-jsonschemer/flask_jsonschemer.py:71: in decorated
  2160. return fn(*args, **kwargs)
  2161. auth/token/decorators.py:38: in decorated
  2162. return f(*args, **kwargs)
  2163. auth/oauth/views.py:139: in facebook_connect
  2164. token, user_id = save_and_log_social_user(oauth_json, facebook)
  2165. auth/oauth/utils.py:98: in save_and_log_social_user
  2166. return create_token(db_user), db_user.user_id
  2167. auth/token/utils.py:84: in create_token
  2168. token_interface.save_token(kvtoken, user, g.app["persist"])
  2169. auth/token/storage.py:88: in save_token
  2170. store.put(token.tid, data, current_app.config["TOKEN_TTL"])
  2171. /usr/local/lib/python3.6/site-packages/simplekv/decorator.py:73: in put
  2172. self._dstore.put(self._map_key(key), *args, **kwargs))
  2173. /usr/local/lib/python3.6/site-packages/simplekv/__init__.py:395: in put
  2174. return self._put(key, data, self._valid_ttl(ttl_secs))
  2175. /usr/local/lib/python3.6/site-packages/simplekv/memory/redisstore.py:58: in _put
  2176. self.redis.setex(key, ittl, value)
  2177. /usr/local/lib/python3.6/site-packages/redis/client.py:1192: in setex
  2178. return self.execute_command('SETEX', name, time, value)
  2179. /usr/local/lib/python3.6/site-packages/ddtrace/contrib/redis/patch.py:58: in traced_execute_command
  2180. return func(*args, **kwargs)
  2181. /usr/local/lib/python3.6/site-packages/redis/client.py:673: in execute_command
  2182. connection.send_command(*args)
  2183. /usr/local/lib/python3.6/site-packages/redis/connection.py:610: in send_command
  2184. self.send_packed_command(self.pack_command(*args))
  2185. /usr/local/lib/python3.6/site-packages/redis/connection.py:585: in send_packed_command
  2186. self.connect()
  2187. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  2188.  
  2189. self = Connection<host=localhost,port=6379,db=0>
  2190.  
  2191. def connect(self):
  2192. "Connects to the Redis server if not already connected"
  2193. if self._sock:
  2194. return
  2195. try:
  2196. sock = self._connect()
  2197. except socket.timeout:
  2198. raise TimeoutError("Timeout connecting to server")
  2199. except socket.error:
  2200. e = sys.exc_info()[1]
  2201. > raise ConnectionError(self._error_message(e))
  2202. E redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  2203.  
  2204. /usr/local/lib/python3.6/site-packages/redis/connection.py:489: ConnectionError
  2205. ----------------------------- Captured stdout call -----------------------------
  2206. 2019-03-08T18:35:16.179131Z [info ] request  client_addr=127.0.0.1 forwarding= json={'access_token': 'EAAOn6HZCqOwEBAN5W8ngQ7iZB7TyF9WvHT6GLjfeN7Bo8J92JZBGjFrFskU4UZApmP6EGhnbCZBJnBoI8kHcMR9tjoMATs4isbxcbgg2a3eu62vZBJyPDrsFKeCB6s4LA1aShnLjSazR8w3EkuST02QVP5tvbwCvAZD', 'expires': '5102404'} method=POST path=/v1/oauth.facebook.connect request_id=0a3f983412584826a21b80e6767a34c1
  2207. 2019-03-08T18:35:16.185229Z [info ] parse_facebook_data.start data={"email": "juraj.pelikan@gmail.com", "first_name": "Juraj", "last_name": "Pelikan"} request_id=0a3f983412584826a21b80e6767a34c1
  2208. 2019-03-08T18:35:16.185475Z [info ] parse_facebook_data.finish data={"email": "juraj.pelikan@gmail.com", "email_verified": true, "first_name": "Juraj", "last_name": "Pelikan"} request_id=0a3f983412584826a21b80e6767a34c1
  2209. ----------------------------- Captured stderr call -----------------------------
  2210. 2019-03-08T18:35:14.838680Z [debug ] stdlib_log  [ddtrace.encoding] message=using Msgpack encoder request_id=e8febf539fb34bde8299bc21a87d5661
  2211. 2019-03-08T18:35:14.839244Z [info ] stdlib_log  [ddtrace.sampler] message=initialized RateSampler, sample 100.0% of traces request_id=e8febf539fb34bde8299bc21a87d5661
  2212. 2019-03-08T18:35:14.846019Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  2213. 2019-03-08T18:35:14.847643Z [debug ] stdlib_log  [ddtrace.writer] message=resetting queues. pids(old:None new:68) request_id=e8febf539fb34bde8299bc21a87d5661
  2214. 2019-03-08T18:35:14.847980Z [debug ] stdlib_log  [ddtrace.writer] message=starting flush thread request_id=e8febf539fb34bde8299bc21a87d5661
  2215. 2019-03-08T18:35:14.849176Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  2216. 2019-03-08T18:35:15.857114Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  2217. 2019-03-08T18:35:15.861186Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  2218. 2019-03-08T18:35:16.869048Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  2219. 2019-03-08T18:35:16.873317Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  2220. ________________ GoogleMobileConectTestCase.test_mobile_connect ________________
  2221.  
  2222. self = Connection<host=localhost,port=6379,db=0>
  2223.  
  2224. def connect(self):
  2225. "Connects to the Redis server if not already connected"
  2226. if self._sock:
  2227. return
  2228. try:
  2229. > sock = self._connect()
  2230.  
  2231. /usr/local/lib/python3.6/site-packages/redis/connection.py:484:
  2232. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  2233.  
  2234. self = Connection<host=localhost,port=6379,db=0>
  2235.  
  2236. def _connect(self):
  2237. "Create a TCP socket connection"
  2238. # we want to mimic what socket.create_connection does to support
  2239. # ipv4/ipv6, but we want to set options prior to calling
  2240. # socket.connect()
  2241. err = None
  2242. for res in socket.getaddrinfo(self.host, self.port, 0,
  2243. socket.SOCK_STREAM):
  2244. family, socktype, proto, canonname, socket_address = res
  2245. sock = None
  2246. try:
  2247. sock = socket.socket(family, socktype, proto)
  2248. # TCP_NODELAY
  2249. sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
  2250.  
  2251. # TCP_KEEPALIVE
  2252. if self.socket_keepalive:
  2253. sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
  2254. for k, v in iteritems(self.socket_keepalive_options):
  2255. sock.setsockopt(socket.SOL_TCP, k, v)
  2256.  
  2257. # set the socket_connect_timeout before we connect
  2258. sock.settimeout(self.socket_connect_timeout)
  2259.  
  2260. # connect
  2261. sock.connect(socket_address)
  2262.  
  2263. # set the socket_timeout now that we're connected
  2264. sock.settimeout(self.socket_timeout)
  2265. return sock
  2266.  
  2267. except socket.error as _:
  2268. err = _
  2269. if sock is not None:
  2270. sock.close()
  2271.  
  2272. if err is not None:
  2273. > raise err
  2274.  
  2275. /usr/local/lib/python3.6/site-packages/redis/connection.py:541:
  2276. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  2277.  
  2278. self = Connection<host=localhost,port=6379,db=0>
  2279.  
  2280. def _connect(self):
  2281. "Create a TCP socket connection"
  2282. # we want to mimic what socket.create_connection does to support
  2283. # ipv4/ipv6, but we want to set options prior to calling
  2284. # socket.connect()
  2285. err = None
  2286. for res in socket.getaddrinfo(self.host, self.port, 0,
  2287. socket.SOCK_STREAM):
  2288. family, socktype, proto, canonname, socket_address = res
  2289. sock = None
  2290. try:
  2291. sock = socket.socket(family, socktype, proto)
  2292. # TCP_NODELAY
  2293. sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
  2294.  
  2295. # TCP_KEEPALIVE
  2296. if self.socket_keepalive:
  2297. sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
  2298. for k, v in iteritems(self.socket_keepalive_options):
  2299. sock.setsockopt(socket.SOL_TCP, k, v)
  2300.  
  2301. # set the socket_connect_timeout before we connect
  2302. sock.settimeout(self.socket_connect_timeout)
  2303.  
  2304. # connect
  2305. > sock.connect(socket_address)
  2306.  
  2307. /usr/local/lib/python3.6/site-packages/redis/connection.py:529:
  2308. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  2309.  
  2310. self = <gevent._socket3.socket [closed] object, fd=-1, family=10, type=1, proto=6>
  2311. address = ('::1', 6379, 0, 0)
  2312.  
  2313. def connect(self, address):
  2314. if self.timeout == 0.0:
  2315. return _socket.socket.connect(self._sock, address)
  2316. if isinstance(address, tuple):
  2317. r = getaddrinfo(address[0], address[1], self.family)
  2318. address = r[0][-1]
  2319. if self.timeout is not None:
  2320. timer = Timeout.start_new(self.timeout, timeout('timed out'))
  2321. else:
  2322. timer = None
  2323. try:
  2324. while True:
  2325. err = self.getsockopt(SOL_SOCKET, SO_ERROR)
  2326. if err:
  2327. raise error(err, strerror(err))
  2328. result = _socket.socket.connect_ex(self._sock, address)
  2329. if not result or result == EISCONN:
  2330. break
  2331. elif (result in (EWOULDBLOCK, EINPROGRESS, EALREADY)) or (result == EINVAL and is_windows):
  2332. self._wait(self._write_event)
  2333. else:
  2334. > raise error(result, strerror(result))
  2335. E OSError: [Errno 99] Address not available
  2336.  
  2337. /usr/local/lib/python3.6/site-packages/gevent/_socket3.py:307: OSError
  2338.  
  2339. During handling of the above exception, another exception occurred:
  2340.  
  2341. self = StrictRedis<ConnectionPool<Connection<host=localhost,port=6379,db=0>>>
  2342. args = ('SETEX', 'token_WyJMWTlwTXZRZ2xIdXVaWGFnWE8xTTRlIiwiRzI0NW5SaFd2NHZlY2E1NGJ3cFJxdU10bUx5ZkxYTndEQnEyL1RwbjVQVTQzT25Ma...rand_idq\x01J\x96\x03\xbf9X\x06\x00\x00\x00app_idq\x02X\x06\x00\x00\x00app_idq\x03X\x07\x00\x00\x00persistq\x04\x89u.')
  2343. options = {}, pool = ConnectionPool<Connection<host=localhost,port=6379,db=0>>
  2344. command_name = 'SETEX', connection = Connection<host=localhost,port=6379,db=0>
  2345.  
  2346. def execute_command(self, *args, **options):
  2347. "Execute a command and return a parsed response"
  2348. pool = self.connection_pool
  2349. command_name = args[0]
  2350. connection = pool.get_connection(command_name, **options)
  2351. try:
  2352. > connection.send_command(*args)
  2353.  
  2354. /usr/local/lib/python3.6/site-packages/redis/client.py:667:
  2355. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  2356.  
  2357. self = Connection<host=localhost,port=6379,db=0>
  2358. args = ('SETEX', 'token_WyJMWTlwTXZRZ2xIdXVaWGFnWE8xTTRlIiwiRzI0NW5SaFd2NHZlY2E1NGJ3cFJxdU10bUx5ZkxYTndEQnEyL1RwbjVQVTQzT25Ma...rand_idq\x01J\x96\x03\xbf9X\x06\x00\x00\x00app_idq\x02X\x06\x00\x00\x00app_idq\x03X\x07\x00\x00\x00persistq\x04\x89u.')
  2359.  
  2360. def send_command(self, *args):
  2361. "Pack and send a command to the Redis server"
  2362. > self.send_packed_command(self.pack_command(*args))
  2363.  
  2364. /usr/local/lib/python3.6/site-packages/redis/connection.py:610:
  2365. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  2366.  
  2367. self = Connection<host=localhost,port=6379,db=0>
  2368. command = [b'*4\r\n$5\r\nSETEX\r\n$157\r\ntoken_WyJMWTlwTXZRZ2xIdXVaWGFnWE8xTTRlIiwiRzI0NW5SaFd2NHZlY2E1NGJ3cFJxdU10bUx5ZkxYTndE..._idq\x01J\x96\x03\xbf9X\x06\x00\x00\x00app_idq\x02X\x06\x00\x00\x00app_idq\x03X\x07\x00\x00\x00persistq\x04\x89u.\r\n']
  2369.  
  2370. def send_packed_command(self, command):
  2371. "Send an already packed command to the Redis server"
  2372. if not self._sock:
  2373. > self.connect()
  2374.  
  2375. /usr/local/lib/python3.6/site-packages/redis/connection.py:585:
  2376. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  2377.  
  2378. self = Connection<host=localhost,port=6379,db=0>
  2379.  
  2380. def connect(self):
  2381. "Connects to the Redis server if not already connected"
  2382. if self._sock:
  2383. return
  2384. try:
  2385. sock = self._connect()
  2386. except socket.timeout:
  2387. raise TimeoutError("Timeout connecting to server")
  2388. except socket.error:
  2389. e = sys.exc_info()[1]
  2390. > raise ConnectionError(self._error_message(e))
  2391. E redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  2392.  
  2393. /usr/local/lib/python3.6/site-packages/redis/connection.py:489: ConnectionError
  2394.  
  2395. During handling of the above exception, another exception occurred:
  2396.  
  2397. self = Connection<host=localhost,port=6379,db=0>
  2398.  
  2399. def connect(self):
  2400. "Connects to the Redis server if not already connected"
  2401. if self._sock:
  2402. return
  2403. try:
  2404. > sock = self._connect()
  2405.  
  2406. /usr/local/lib/python3.6/site-packages/redis/connection.py:484:
  2407. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  2408.  
  2409. self = Connection<host=localhost,port=6379,db=0>
  2410.  
  2411. def _connect(self):
  2412. "Create a TCP socket connection"
  2413. # we want to mimic what socket.create_connection does to support
  2414. # ipv4/ipv6, but we want to set options prior to calling
  2415. # socket.connect()
  2416. err = None
  2417. for res in socket.getaddrinfo(self.host, self.port, 0,
  2418. socket.SOCK_STREAM):
  2419. family, socktype, proto, canonname, socket_address = res
  2420. sock = None
  2421. try:
  2422. sock = socket.socket(family, socktype, proto)
  2423. # TCP_NODELAY
  2424. sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
  2425.  
  2426. # TCP_KEEPALIVE
  2427. if self.socket_keepalive:
  2428. sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
  2429. for k, v in iteritems(self.socket_keepalive_options):
  2430. sock.setsockopt(socket.SOL_TCP, k, v)
  2431.  
  2432. # set the socket_connect_timeout before we connect
  2433. sock.settimeout(self.socket_connect_timeout)
  2434.  
  2435. # connect
  2436. sock.connect(socket_address)
  2437.  
  2438. # set the socket_timeout now that we're connected
  2439. sock.settimeout(self.socket_timeout)
  2440. return sock
  2441.  
  2442. except socket.error as _:
  2443. err = _
  2444. if sock is not None:
  2445. sock.close()
  2446.  
  2447. if err is not None:
  2448. > raise err
  2449.  
  2450. /usr/local/lib/python3.6/site-packages/redis/connection.py:541:
  2451. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  2452.  
  2453. self = Connection<host=localhost,port=6379,db=0>
  2454.  
  2455. def _connect(self):
  2456. "Create a TCP socket connection"
  2457. # we want to mimic what socket.create_connection does to support
  2458. # ipv4/ipv6, but we want to set options prior to calling
  2459. # socket.connect()
  2460. err = None
  2461. for res in socket.getaddrinfo(self.host, self.port, 0,
  2462. socket.SOCK_STREAM):
  2463. family, socktype, proto, canonname, socket_address = res
  2464. sock = None
  2465. try:
  2466. sock = socket.socket(family, socktype, proto)
  2467. # TCP_NODELAY
  2468. sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
  2469.  
  2470. # TCP_KEEPALIVE
  2471. if self.socket_keepalive:
  2472. sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
  2473. for k, v in iteritems(self.socket_keepalive_options):
  2474. sock.setsockopt(socket.SOL_TCP, k, v)
  2475.  
  2476. # set the socket_connect_timeout before we connect
  2477. sock.settimeout(self.socket_connect_timeout)
  2478.  
  2479. # connect
  2480. > sock.connect(socket_address)
  2481.  
  2482. /usr/local/lib/python3.6/site-packages/redis/connection.py:529:
  2483. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  2484.  
  2485. self = <gevent._socket3.socket [closed] object, fd=-1, family=10, type=1, proto=6>
  2486. address = ('::1', 6379, 0, 0)
  2487.  
  2488. def connect(self, address):
  2489. if self.timeout == 0.0:
  2490. return _socket.socket.connect(self._sock, address)
  2491. if isinstance(address, tuple):
  2492. r = getaddrinfo(address[0], address[1], self.family)
  2493. address = r[0][-1]
  2494. if self.timeout is not None:
  2495. timer = Timeout.start_new(self.timeout, timeout('timed out'))
  2496. else:
  2497. timer = None
  2498. try:
  2499. while True:
  2500. err = self.getsockopt(SOL_SOCKET, SO_ERROR)
  2501. if err:
  2502. raise error(err, strerror(err))
  2503. result = _socket.socket.connect_ex(self._sock, address)
  2504. if not result or result == EISCONN:
  2505. break
  2506. elif (result in (EWOULDBLOCK, EINPROGRESS, EALREADY)) or (result == EINVAL and is_windows):
  2507. self._wait(self._write_event)
  2508. else:
  2509. > raise error(result, strerror(result))
  2510. E OSError: [Errno 99] Address not available
  2511.  
  2512. /usr/local/lib/python3.6/site-packages/gevent/_socket3.py:307: OSError
  2513.  
  2514. During handling of the above exception, another exception occurred:
  2515.  
  2516. self = <tests.test_oauth.GoogleMobileConectTestCase testMethod=test_mobile_connect>
  2517. mock_get = <MagicMock name='get' id='140158912663680'>
  2518. mock_verifier = <MagicMock name='verify_access_token' id='140158911567576'>
  2519.  
  2520. @patch("auth.oauth.views.verify_access_token")
  2521. @patch("auth.oauth.providers.google.get")
  2522. def test_mobile_connect(self, mock_get, mock_verifier):
  2523. self.assertEqual(User.query.count(), 0)
  2524.  
  2525. class UserInfo(object):
  2526. data = {
  2527. "locale": "en",
  2528. "family_name": "Koci",
  2529. "given_name": "Pavel",
  2530. "name": "Pavel Koci",
  2531. "id": "10974864908507278145",
  2532. "email": "pavel.koci@vacuumapps.com",
  2533. "verified_email": True,
  2534. "picture": "https://lh3.googleusercontent.com/-rscbv5M/photo.jpg",
  2535. "hd": "vacuumapps.com",
  2536. }
  2537.  
  2538. mock_get.return_value = UserInfo()
  2539. oauth_payload = {
  2540. "access_token": (
  2541. "EAAOn6HZCqOwEBAN5W8ngQ7iZB7TyF9WvHT6GLjfeN7Bo8J92JZBG"
  2542. "jFrFskU4UZApmP6EGhnbCZBJnBoI8kHcMR9tjoMATs4isbxcbgg2a"
  2543. "3eu62vZBJyPDrsFKeCB6s4LA1aShnLjSazR8w3EkuST02QVP5tvbw"
  2544. "CvAZD"
  2545. ),
  2546. "expires": "5102404",
  2547. }
  2548. headers = {"Authorization": "Basic " + b64encode(b"app_id:").decode("utf8")}
  2549. resp = self.client.post(
  2550. > "/v1/oauth.google.connect", data=json.dumps(oauth_payload), content_type="application/json", headers=headers
  2551. )
  2552.  
  2553. tests/test_oauth.py:296:
  2554. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  2555. /usr/local/lib/python3.6/site-packages/werkzeug/test.py:840: in post
  2556. return self.open(*args, **kw)
  2557. /usr/local/lib/python3.6/site-packages/flask/testing.py:127: in open
  2558. follow_redirects=follow_redirects)
  2559. /usr/local/lib/python3.6/site-packages/werkzeug/test.py:803: in open
  2560. response = self.run_wsgi_app(environ, buffered=buffered)
  2561. /usr/local/lib/python3.6/site-packages/werkzeug/test.py:716: in run_wsgi_app
  2562. rv = run_wsgi_app(self.application, environ, buffered=buffered)
  2563. /usr/local/lib/python3.6/site-packages/werkzeug/test.py:923: in run_wsgi_app
  2564. app_rv = app(environ, start_response)
  2565. /usr/local/lib/python3.6/site-packages/flask/app.py:1997: in __call__
  2566. return self.wsgi_app(environ, start_response)
  2567. auth/middleware.py:57: in __call__
  2568. retval = self.app(environ, custom_start_response)
  2569. /usr/local/lib/python3.6/site-packages/flask/app.py:1985: in wsgi_app
  2570. response = self.handle_exception(e)
  2571. /usr/local/lib/python3.6/site-packages/flask/app.py:1540: in handle_exception
  2572. reraise(exc_type, exc_value, tb)
  2573. /usr/local/lib/python3.6/site-packages/flask/_compat.py:33: in reraise
  2574. raise value
  2575. /usr/local/lib/python3.6/site-packages/flask/app.py:1982: in wsgi_app
  2576. response = self.full_dispatch_request()
  2577. /usr/local/lib/python3.6/site-packages/flask/app.py:1614: in full_dispatch_request
  2578. rv = self.handle_user_exception(e)
  2579. /usr/local/lib/python3.6/site-packages/flask/app.py:1517: in handle_user_exception
  2580. reraise(exc_type, exc_value, tb)
  2581. /usr/local/lib/python3.6/site-packages/flask/_compat.py:33: in reraise
  2582. raise value
  2583. /usr/local/lib/python3.6/site-packages/flask/app.py:1612: in full_dispatch_request
  2584. rv = self.dispatch_request()
  2585. /usr/local/lib/python3.6/site-packages/flask/app.py:1598: in dispatch_request
  2586. return self.view_functions[rule.endpoint](**req.view_args)
  2587. ../packages/flask-jsonschemer/flask_jsonschemer.py:71: in decorated
  2588. return fn(*args, **kwargs)
  2589. auth/token/decorators.py:38: in decorated
  2590. return f(*args, **kwargs)
  2591. auth/oauth/views.py:158: in google_connect
  2592. token, user_id = save_and_log_social_user(oauth_json, google)
  2593. auth/oauth/utils.py:98: in save_and_log_social_user
  2594. return create_token(db_user), db_user.user_id
  2595. auth/token/utils.py:84: in create_token
  2596. token_interface.save_token(kvtoken, user, g.app["persist"])
  2597. auth/token/storage.py:88: in save_token
  2598. store.put(token.tid, data, current_app.config["TOKEN_TTL"])
  2599. /usr/local/lib/python3.6/site-packages/simplekv/decorator.py:73: in put
  2600. self._dstore.put(self._map_key(key), *args, **kwargs))
  2601. /usr/local/lib/python3.6/site-packages/simplekv/__init__.py:395: in put
  2602. return self._put(key, data, self._valid_ttl(ttl_secs))
  2603. /usr/local/lib/python3.6/site-packages/simplekv/memory/redisstore.py:58: in _put
  2604. self.redis.setex(key, ittl, value)
  2605. /usr/local/lib/python3.6/site-packages/redis/client.py:1192: in setex
  2606. return self.execute_command('SETEX', name, time, value)
  2607. /usr/local/lib/python3.6/site-packages/ddtrace/contrib/redis/patch.py:58: in traced_execute_command
  2608. return func(*args, **kwargs)
  2609. /usr/local/lib/python3.6/site-packages/redis/client.py:673: in execute_command
  2610. connection.send_command(*args)
  2611. /usr/local/lib/python3.6/site-packages/redis/connection.py:610: in send_command
  2612. self.send_packed_command(self.pack_command(*args))
  2613. /usr/local/lib/python3.6/site-packages/redis/connection.py:585: in send_packed_command
  2614. self.connect()
  2615. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  2616.  
  2617. self = Connection<host=localhost,port=6379,db=0>
  2618.  
  2619. def connect(self):
  2620. "Connects to the Redis server if not already connected"
  2621. if self._sock:
  2622. return
  2623. try:
  2624. sock = self._connect()
  2625. except socket.timeout:
  2626. raise TimeoutError("Timeout connecting to server")
  2627. except socket.error:
  2628. e = sys.exc_info()[1]
  2629. > raise ConnectionError(self._error_message(e))
  2630. E redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  2631.  
  2632. /usr/local/lib/python3.6/site-packages/redis/connection.py:489: ConnectionError
  2633. ----------------------------- Captured stdout call -----------------------------
  2634. 2019-03-08T18:35:19.521475Z [info ] request  client_addr=127.0.0.1 forwarding= json={'access_token': 'EAAOn6HZCqOwEBAN5W8ngQ7iZB7TyF9WvHT6GLjfeN7Bo8J92JZBGjFrFskU4UZApmP6EGhnbCZBJnBoI8kHcMR9tjoMATs4isbxcbgg2a3eu62vZBJyPDrsFKeCB6s4LA1aShnLjSazR8w3EkuST02QVP5tvbwCvAZD', 'expires': '5102404'} method=POST path=/v1/oauth.google.connect request_id=0239925bfd9c4558bce0aa5184d8717e
  2635. 2019-03-08T18:35:19.525835Z [info ] parse_google_data.start  data={"email": "pavel.koci@vacuumapps.com", "family_name": "Koci", "given_name": "Pavel", "hd": "vacuumapps.com", "id": "10974864908507278145", "locale": "en", "name": "Pavel Koci", "picture": "https://lh3.googleusercontent.com/-rscbv5M/photo.jpg", "verified_email": true} request_id=0239925bfd9c4558bce0aa5184d8717e
  2636. 2019-03-08T18:35:19.526107Z [info ] parse_google_data.finish  data={"email": "pavel.koci@vacuumapps.com", "email_verified": true, "first_name": "Pavel", "last_name": "Koci"} request_id=0239925bfd9c4558bce0aa5184d8717e
  2637. ----------------------------- Captured stderr call -----------------------------
  2638. 2019-03-08T18:35:17.910314Z [debug ] stdlib_log  [ddtrace.encoding] message=using Msgpack encoder request_id=0a3f983412584826a21b80e6767a34c1
  2639. 2019-03-08T18:35:17.910610Z [info ] stdlib_log  [ddtrace.sampler] message=initialized RateSampler, sample 100.0% of traces request_id=0a3f983412584826a21b80e6767a34c1
  2640. 2019-03-08T18:35:17.915812Z [debug ] stdlib_log  [ddtrace.writer] message=resetting queues. pids(old:None new:68) request_id=0a3f983412584826a21b80e6767a34c1
  2641. 2019-03-08T18:35:17.916069Z [debug ] stdlib_log  [ddtrace.writer] message=starting flush thread request_id=0a3f983412584826a21b80e6767a34c1
  2642. 2019-03-08T18:35:18.925224Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  2643. 2019-03-08T18:35:18.929408Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  2644. 2019-03-08T18:35:19.936504Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  2645. ________________ AuthTestCase.test_change_password_current_new _________________
  2646.  
  2647. self = <tests.test_user.AuthTestCase testMethod=test_change_password_current_new>
  2648.  
  2649. def test_change_password_current_new(self):
  2650. self.api.user.save(**self.USER_DATA)
  2651. > self.api.user.login(login=self.USER_DATA["login"], password=self.USER_DATA["password"])
  2652.  
  2653. tests/test_user.py:322:
  2654. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  2655. ../packages/userapp/userapp/__init__.py:325: in __call__
  2656. return self._client.call(self._version, self._parent._service_name, self._method_name, kwargs)
  2657. ../packages/userapp/userapp/__init__.py:245: in call
  2658. result = DictionaryUtility.to_object(response.json())
  2659. /usr/local/lib/python3.6/site-packages/requests/models.py:892: in json
  2660. return complexjson.loads(self.text, **kwargs)
  2661. /usr/local/lib/python3.6/site-packages/simplejson/__init__.py:518: in loads
  2662. return _default_decoder.decode(s)
  2663. /usr/local/lib/python3.6/site-packages/simplejson/decoder.py:370: in decode
  2664. obj, end = self.raw_decode(s)
  2665. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  2666.  
  2667. self = <simplejson.decoder.JSONDecoder object at 0x7f794e0da0b8>
  2668. s = 'A server error occurred. Please contact the administrator.', idx = 0
  2669. _w = <built-in method match of _sre.SRE_Pattern object at 0x7f79550f4e70>
  2670. _PY3 = True
  2671.  
  2672. def raw_decode(self, s, idx=0, _w=WHITESPACE.match, _PY3=PY3):
  2673. """Decode a JSON document from ``s`` (a ``str`` or ``unicode``
  2674. beginning with a JSON document) and return a 2-tuple of the Python
  2675. representation and the index in ``s`` where the document ended.
  2676. Optionally, ``idx`` can be used to specify an offset in ``s`` where
  2677. the JSON document begins.
  2678.  
  2679. This can be used to decode a JSON document from a string that may
  2680. have extraneous data at the end.
  2681.  
  2682. """
  2683. if idx < 0:
  2684. # Ensure that raw_decode bails on negative indexes, the regex
  2685. # would otherwise mask this behavior. #98
  2686. raise JSONDecodeError('Expecting value', s, idx)
  2687. if _PY3 and not isinstance(s, text_type):
  2688. raise TypeError("Input string must be text, not bytes")
  2689. # strip UTF-8 bom
  2690. if len(s) > idx:
  2691. ord0 = ord(s[idx])
  2692. if ord0 == 0xfeff:
  2693. idx += 1
  2694. elif ord0 == 0xef and s[idx:idx + 3] == '\xef\xbb\xbf':
  2695. idx += 3
  2696. > return self.scan_once(s, idx=_w(s, idx).end())
  2697. E simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
  2698.  
  2699. /usr/local/lib/python3.6/site-packages/simplejson/decoder.py:400: JSONDecodeError
  2700. ----------------------------- Captured stdout call -----------------------------
  2701. 2019-03-08T18:35:31.059671Z [info ] request  client_addr=127.0.0.1 forwarding= json={'first_name': 'Test', 'last_name': 'Testovac', 'email_verified': True, 'login': 'testuser@example.com', 'password': 'MadladPwd42', 'properties': {'currency': {'value': 'usd'}, 'language': {'value': 'en'}}} method=POST path=/v1/user.save request_id=c336edd2751541e685cb7f0becb10302
  2702. 2019-03-08T18:35:31.530330Z [info ] response  length=446 request_id=c336edd2751541e685cb7f0becb10302 status=200
  2703. 2019-03-08T18:35:31.546485Z [info ] request  client_addr=127.0.0.1 forwarding= json={'login': 'testuser@example.com', 'password': 'MadladPwd42'} method=POST path=/v1/user.login request_id=b7f6f00bf86b45d7b6198bce3d6e31a0
  2704. ----------------------------- Captured stderr call -----------------------------
  2705. 2019-03-08T18:35:29.785536Z [debug ] stdlib_log  [ddtrace.encoding] message=using Msgpack encoder request_id=0239925bfd9c4558bce0aa5184d8717e
  2706. 2019-03-08T18:35:29.786159Z [info ] stdlib_log  [ddtrace.sampler] message=initialized RateSampler, sample 100.0% of traces request_id=0239925bfd9c4558bce0aa5184d8717e
  2707. 2019-03-08T18:35:29.796299Z [debug ] stdlib_log  [ddtrace.writer] message=resetting queues. pids(old:None new:68) request_id=0239925bfd9c4558bce0aa5184d8717e
  2708. 2019-03-08T18:35:29.796880Z [debug ] stdlib_log  [ddtrace.writer] message=starting flush thread request_id=0239925bfd9c4558bce0aa5184d8717e
  2709. 2019-03-08T18:35:30.804696Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  2710. 2019-03-08T18:35:30.808821Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  2711. 2019-03-08T18:35:31.048624Z [debug ] stdlib_log  [userapp] message=Calling post http://localhost:8080/v1/user.save with headers {'Content-Type': 'application/json', 'Authorization': 'Basic QnFpTnJ4YVl3ZjdzVXl6RV8wcFEyUjo='} and body {"first_name": "Test", "last_name": "Testovac", "email_verified": true, "login": "testuser@example.com", "password": "MadladPwd42", "properties": {"currency": {"value": "usd"}, "language": {"value": "en"}}} request_id=0239925bfd9c4558bce0aa5184d8717e
  2712. 2019-03-08T18:35:31.054285Z [debug ] stdlib_log  [urllib3.connectionpool] message=Starting new HTTP connection (1): localhost request_id=0239925bfd9c4558bce0aa5184d8717e
  2713. 2019-03-08T18:35:31.533394Z [debug ] stdlib_log  [urllib3.connectionpool] message=http://localhost:8080 "POST /v1/user.save HTTP/1.1" 200 446 request_id=0239925bfd9c4558bce0aa5184d8717e
  2714. 2019-03-08T18:35:31.536695Z [debug ] stdlib_log  [userapp] message=Recieved response={
  2715. "brand": "kiwicom",
  2716. "created_at": 1552070131.089336,
  2717. "email": "testuser@example.com",
  2718. "email_verified": true,
  2719. "first_name": "Test",
  2720. "last_login_at": null,
  2721. "last_name": "Testovac",
  2722. "locks": [],
  2723. "login": "testuser@example.com",
  2724. "properties": {
  2725. "currency": {
  2726. "value": "usd"
  2727. },
  2728. "language": {
  2729. "value": "en"
  2730. }
  2731. },
  2732. "updated_at": 1552070131.089341,
  2733. "user_id": "Hbcru6VH9_ufEtxRuy6rrH"
  2734. }
  2735.  request_id=0239925bfd9c4558bce0aa5184d8717e
  2736. 2019-03-08T18:35:31.538125Z [debug ] stdlib_log  [userapp] message=Calling post http://localhost:8080/v1/user.login with headers {'Content-Type': 'application/json', 'Authorization': 'Basic QnFpTnJ4YVl3ZjdzVXl6RV8wcFEyUjo='} and body {"login": "testuser@example.com", "password": "MadladPwd42"} request_id=0239925bfd9c4558bce0aa5184d8717e
  2737. 2019-03-08T18:35:31.543016Z [debug ] stdlib_log  [urllib3.connectionpool] message=Starting new HTTP connection (1): localhost request_id=0239925bfd9c4558bce0aa5184d8717e
  2738. Traceback (most recent call last):
  2739. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 484, in connect
  2740. sock = self._connect()
  2741. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 541, in _connect
  2742. raise err
  2743. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 529, in _connect
  2744. sock.connect(socket_address)
  2745. File "/usr/local/lib/python3.6/site-packages/gevent/_socket3.py", line 307, in connect
  2746. raise error(result, strerror(result))
  2747. OSError: [Errno 99] Address not available
  2748.  
  2749. During handling of the above exception, another exception occurred:
  2750.  
  2751. Traceback (most recent call last):
  2752. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 667, in execute_command
  2753. connection.send_command(*args)
  2754. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 610, in send_command
  2755. self.send_packed_command(self.pack_command(*args))
  2756. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 585, in send_packed_command
  2757. self.connect()
  2758. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 489, in connect
  2759. raise ConnectionError(self._error_message(e))
  2760. redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  2761.  
  2762. During handling of the above exception, another exception occurred:
  2763.  
  2764. Traceback (most recent call last):
  2765. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 484, in connect
  2766. sock = self._connect()
  2767. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 541, in _connect
  2768. raise err
  2769. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 529, in _connect
  2770. sock.connect(socket_address)
  2771. File "/usr/local/lib/python3.6/site-packages/gevent/_socket3.py", line 307, in connect
  2772. raise error(result, strerror(result))
  2773. OSError: [Errno 99] Address not available
  2774.  
  2775. During handling of the above exception, another exception occurred:
  2776.  
  2777. Traceback (most recent call last):
  2778. File "/usr/local/lib/python3.6/wsgiref/handlers.py", line 137, in run
  2779. self.result = application(self.environ, self.start_response)
  2780. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1997, in __call__
  2781. return self.wsgi_app(environ, start_response)
  2782. File "/usr/src/app/auth/middleware.py", line 57, in __call__
  2783. retval = self.app(environ, custom_start_response)
  2784. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1985, in wsgi_app
  2785. response = self.handle_exception(e)
  2786. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1540, in handle_exception
  2787. reraise(exc_type, exc_value, tb)
  2788. File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
  2789. raise value
  2790. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
  2791. response = self.full_dispatch_request()
  2792. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
  2793. rv = self.handle_user_exception(e)
  2794. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
  2795. reraise(exc_type, exc_value, tb)
  2796. File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
  2797. raise value
  2798. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request
  2799. rv = self.dispatch_request()
  2800. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request
  2801. return self.view_functions[rule.endpoint](**req.view_args)
  2802. File "/usr/src/packages/flask-jsonschemer/flask_jsonschemer.py", line 71, in decorated
  2803. return fn(*args, **kwargs)
  2804. File "/usr/src/app/auth/token/decorators.py", line 38, in decorated
  2805. return f(*args, **kwargs)
  2806. File "/usr/src/app/auth/views.py", line 139, in login
  2807. check_block(user_json["login"])
  2808. File "/usr/src/app/auth/utils.py", line 26, in check_block
  2809. if int(kvstore.get(key)) >= current_app.config["INVALID_LOGIN_ATTEMPTS"]:
  2810. File "/usr/local/lib/python3.6/site-packages/simplekv/decorator.py", line 52, in get
  2811. return self._dstore.get(self._map_key(key), *args, **kwargs)
  2812. File "/usr/local/lib/python3.6/site-packages/simplekv/__init__.py", line 75, in get
  2813. return self._get(key)
  2814. File "/usr/local/lib/python3.6/site-packages/simplekv/memory/redisstore.py", line 31, in _get
  2815. val = self.redis.get(key)
  2816. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 976, in get
  2817. return self.execute_command('GET', name)
  2818. File "/usr/local/lib/python3.6/site-packages/ddtrace/contrib/redis/patch.py", line 58, in traced_execute_command
  2819. return func(*args, **kwargs)
  2820. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 673, in execute_command
  2821. connection.send_command(*args)
  2822. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 610, in send_command
  2823. self.send_packed_command(self.pack_command(*args))
  2824. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 585, in send_packed_command
  2825. self.connect()
  2826. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 489, in connect
  2827. raise ConnectionError(self._error_message(e))
  2828. redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  2829. 2019-03-08T18:35:31.559161Z [debug ] stdlib_log  [urllib3.connectionpool] message=http://localhost:8080 "POST /v1/user.login HTTP/1.1" 500 59 request_id=0239925bfd9c4558bce0aa5184d8717e
  2830. 2019-03-08T18:35:31.560172Z [debug ] stdlib_log  [userapp] message=Recieved response=A server error occurred. Please contact the administrator. request_id=0239925bfd9c4558bce0aa5184d8717e
  2831. 2019-03-08T18:35:31.815758Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  2832. 2019-03-08T18:35:31.819487Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  2833. ____________ AuthTestCase.test_change_password_current_new_invalid _____________
  2834.  
  2835. self = <tests.test_user.AuthTestCase testMethod=test_change_password_current_new_invalid>
  2836.  
  2837. def test_change_password_current_new_invalid(self):
  2838. self.api.user.save(**self.USER_DATA)
  2839. > self.api.user.login(login=self.USER_DATA["login"], password=self.USER_DATA["password"])
  2840.  
  2841. tests/test_user.py:354:
  2842. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  2843. ../packages/userapp/userapp/__init__.py:325: in __call__
  2844. return self._client.call(self._version, self._parent._service_name, self._method_name, kwargs)
  2845. ../packages/userapp/userapp/__init__.py:245: in call
  2846. result = DictionaryUtility.to_object(response.json())
  2847. /usr/local/lib/python3.6/site-packages/requests/models.py:892: in json
  2848. return complexjson.loads(self.text, **kwargs)
  2849. /usr/local/lib/python3.6/site-packages/simplejson/__init__.py:518: in loads
  2850. return _default_decoder.decode(s)
  2851. /usr/local/lib/python3.6/site-packages/simplejson/decoder.py:370: in decode
  2852. obj, end = self.raw_decode(s)
  2853. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  2854.  
  2855. self = <simplejson.decoder.JSONDecoder object at 0x7f794e0da0b8>
  2856. s = 'A server error occurred. Please contact the administrator.', idx = 0
  2857. _w = <built-in method match of _sre.SRE_Pattern object at 0x7f79550f4e70>
  2858. _PY3 = True
  2859.  
  2860. def raw_decode(self, s, idx=0, _w=WHITESPACE.match, _PY3=PY3):
  2861. """Decode a JSON document from ``s`` (a ``str`` or ``unicode``
  2862. beginning with a JSON document) and return a 2-tuple of the Python
  2863. representation and the index in ``s`` where the document ended.
  2864. Optionally, ``idx`` can be used to specify an offset in ``s`` where
  2865. the JSON document begins.
  2866.  
  2867. This can be used to decode a JSON document from a string that may
  2868. have extraneous data at the end.
  2869.  
  2870. """
  2871. if idx < 0:
  2872. # Ensure that raw_decode bails on negative indexes, the regex
  2873. # would otherwise mask this behavior. #98
  2874. raise JSONDecodeError('Expecting value', s, idx)
  2875. if _PY3 and not isinstance(s, text_type):
  2876. raise TypeError("Input string must be text, not bytes")
  2877. # strip UTF-8 bom
  2878. if len(s) > idx:
  2879. ord0 = ord(s[idx])
  2880. if ord0 == 0xfeff:
  2881. idx += 1
  2882. elif ord0 == 0xef and s[idx:idx + 3] == '\xef\xbb\xbf':
  2883. idx += 3
  2884. > return self.scan_once(s, idx=_w(s, idx).end())
  2885. E simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
  2886.  
  2887. /usr/local/lib/python3.6/site-packages/simplejson/decoder.py:400: JSONDecodeError
  2888. ----------------------------- Captured stdout call -----------------------------
  2889. 2019-03-08T18:35:33.714797Z [info ] request  client_addr=127.0.0.1 forwarding= json={'first_name': 'Test', 'last_name': 'Testovac', 'email_verified': True, 'login': 'testuser@example.com', 'password': 'MadladPwd42', 'properties': {'currency': {'value': 'usd'}, 'language': {'value': 'en'}}} method=POST path=/v1/user.save request_id=86ce73b9e2024015b8e85c26ab467989
  2890. 2019-03-08T18:35:34.056431Z [info ] response  length=446 request_id=86ce73b9e2024015b8e85c26ab467989 status=200
  2891. 2019-03-08T18:35:34.061595Z [info ] request  client_addr=127.0.0.1 forwarding= json={'login': 'testuser@example.com', 'password': 'MadladPwd42'} method=POST path=/v1/user.login request_id=c178f1a423334a1890aa8028e0f8c63a
  2892. ----------------------------- Captured stderr call -----------------------------
  2893. 2019-03-08T18:35:32.250067Z [debug ] stdlib_log  [ddtrace.encoding] message=using Msgpack encoder request_id=0239925bfd9c4558bce0aa5184d8717e
  2894. 2019-03-08T18:35:32.250334Z [info ] stdlib_log  [ddtrace.sampler] message=initialized RateSampler, sample 100.0% of traces request_id=0239925bfd9c4558bce0aa5184d8717e
  2895. 2019-03-08T18:35:32.255399Z [debug ] stdlib_log  [ddtrace.writer] message=resetting queues. pids(old:None new:68) request_id=0239925bfd9c4558bce0aa5184d8717e
  2896. 2019-03-08T18:35:32.255667Z [debug ] stdlib_log  [ddtrace.writer] message=starting flush thread request_id=0239925bfd9c4558bce0aa5184d8717e
  2897. 2019-03-08T18:35:33.261587Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  2898. 2019-03-08T18:35:33.265792Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  2899. 2019-03-08T18:35:33.704274Z [debug ] stdlib_log  [userapp] message=Calling post http://localhost:8080/v1/user.save with headers {'Content-Type': 'application/json', 'Authorization': 'Basic WERzZVNtY01jaXFqM1p0NHJ0YUREdDo='} and body {"first_name": "Test", "last_name": "Testovac", "email_verified": true, "login": "testuser@example.com", "password": "MadladPwd42", "properties": {"currency": {"value": "usd"}, "language": {"value": "en"}}} request_id=0239925bfd9c4558bce0aa5184d8717e
  2900. 2019-03-08T18:35:33.709813Z [debug ] stdlib_log  [urllib3.connectionpool] message=Starting new HTTP connection (1): localhost request_id=0239925bfd9c4558bce0aa5184d8717e
  2901. 2019-03-08T18:35:34.057264Z [debug ] stdlib_log  [urllib3.connectionpool] message=http://localhost:8080 "POST /v1/user.save HTTP/1.1" 200 446 request_id=0239925bfd9c4558bce0aa5184d8717e
  2902. 2019-03-08T18:35:34.058184Z [debug ] stdlib_log  [userapp] message=Recieved response={
  2903. "brand": "kiwicom",
  2904. "created_at": 1552070133.745377,
  2905. "email": "testuser@example.com",
  2906. "email_verified": true,
  2907. "first_name": "Test",
  2908. "last_login_at": null,
  2909. "last_name": "Testovac",
  2910. "locks": [],
  2911. "login": "testuser@example.com",
  2912. "properties": {
  2913. "currency": {
  2914. "value": "usd"
  2915. },
  2916. "language": {
  2917. "value": "en"
  2918. }
  2919. },
  2920. "updated_at": 1552070133.745383,
  2921. "user_id": "PLBpvPLFP9zNNEPbTr4aOR"
  2922. }
  2923.  request_id=0239925bfd9c4558bce0aa5184d8717e
  2924. 2019-03-08T18:35:34.058579Z [debug ] stdlib_log  [userapp] message=Calling post http://localhost:8080/v1/user.login with headers {'Content-Type': 'application/json', 'Authorization': 'Basic WERzZVNtY01jaXFqM1p0NHJ0YUREdDo='} and body {"login": "testuser@example.com", "password": "MadladPwd42"} request_id=0239925bfd9c4558bce0aa5184d8717e
  2925. 2019-03-08T18:35:34.060091Z [debug ] stdlib_log  [urllib3.connectionpool] message=Starting new HTTP connection (1): localhost request_id=0239925bfd9c4558bce0aa5184d8717e
  2926. Traceback (most recent call last):
  2927. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 484, in connect
  2928. sock = self._connect()
  2929. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 541, in _connect
  2930. raise err
  2931. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 529, in _connect
  2932. sock.connect(socket_address)
  2933. File "/usr/local/lib/python3.6/site-packages/gevent/_socket3.py", line 307, in connect
  2934. raise error(result, strerror(result))
  2935. OSError: [Errno 99] Address not available
  2936.  
  2937. During handling of the above exception, another exception occurred:
  2938.  
  2939. Traceback (most recent call last):
  2940. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 667, in execute_command
  2941. connection.send_command(*args)
  2942. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 610, in send_command
  2943. self.send_packed_command(self.pack_command(*args))
  2944. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 585, in send_packed_command
  2945. self.connect()
  2946. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 489, in connect
  2947. raise ConnectionError(self._error_message(e))
  2948. redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  2949.  
  2950. During handling of the above exception, another exception occurred:
  2951.  
  2952. Traceback (most recent call last):
  2953. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 484, in connect
  2954. sock = self._connect()
  2955. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 541, in _connect
  2956. raise err
  2957. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 529, in _connect
  2958. sock.connect(socket_address)
  2959. File "/usr/local/lib/python3.6/site-packages/gevent/_socket3.py", line 307, in connect
  2960. raise error(result, strerror(result))
  2961. OSError: [Errno 99] Address not available
  2962.  
  2963. During handling of the above exception, another exception occurred:
  2964.  
  2965. Traceback (most recent call last):
  2966. File "/usr/local/lib/python3.6/wsgiref/handlers.py", line 137, in run
  2967. self.result = application(self.environ, self.start_response)
  2968. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1997, in __call__
  2969. return self.wsgi_app(environ, start_response)
  2970. File "/usr/src/app/auth/middleware.py", line 57, in __call__
  2971. retval = self.app(environ, custom_start_response)
  2972. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1985, in wsgi_app
  2973. response = self.handle_exception(e)
  2974. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1540, in handle_exception
  2975. reraise(exc_type, exc_value, tb)
  2976. File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
  2977. raise value
  2978. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
  2979. response = self.full_dispatch_request()
  2980. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
  2981. rv = self.handle_user_exception(e)
  2982. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
  2983. reraise(exc_type, exc_value, tb)
  2984. File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
  2985. raise value
  2986. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request
  2987. rv = self.dispatch_request()
  2988. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request
  2989. return self.view_functions[rule.endpoint](**req.view_args)
  2990. File "/usr/src/packages/flask-jsonschemer/flask_jsonschemer.py", line 71, in decorated
  2991. return fn(*args, **kwargs)
  2992. File "/usr/src/app/auth/token/decorators.py", line 38, in decorated
  2993. return f(*args, **kwargs)
  2994. File "/usr/src/app/auth/views.py", line 139, in login
  2995. check_block(user_json["login"])
  2996. File "/usr/src/app/auth/utils.py", line 26, in check_block
  2997. if int(kvstore.get(key)) >= current_app.config["INVALID_LOGIN_ATTEMPTS"]:
  2998. File "/usr/local/lib/python3.6/site-packages/simplekv/decorator.py", line 52, in get
  2999. return self._dstore.get(self._map_key(key), *args, **kwargs)
  3000. File "/usr/local/lib/python3.6/site-packages/simplekv/__init__.py", line 75, in get
  3001. return self._get(key)
  3002. File "/usr/local/lib/python3.6/site-packages/simplekv/memory/redisstore.py", line 31, in _get
  3003. val = self.redis.get(key)
  3004. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 976, in get
  3005. return self.execute_command('GET', name)
  3006. File "/usr/local/lib/python3.6/site-packages/ddtrace/contrib/redis/patch.py", line 58, in traced_execute_command
  3007. return func(*args, **kwargs)
  3008. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 673, in execute_command
  3009. connection.send_command(*args)
  3010. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 610, in send_command
  3011. self.send_packed_command(self.pack_command(*args))
  3012. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 585, in send_packed_command
  3013. self.connect()
  3014. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 489, in connect
  3015. raise ConnectionError(self._error_message(e))
  3016. redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  3017. 2019-03-08T18:35:34.069564Z [debug ] stdlib_log  [urllib3.connectionpool] message=http://localhost:8080 "POST /v1/user.login HTTP/1.1" 500 59 request_id=0239925bfd9c4558bce0aa5184d8717e
  3018. 2019-03-08T18:35:34.070373Z [debug ] stdlib_log  [userapp] message=Recieved response=A server error occurred. Please contact the administrator. request_id=0239925bfd9c4558bce0aa5184d8717e
  3019. 2019-03-08T18:35:34.272550Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  3020. 2019-03-08T18:35:34.276768Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  3021. ___________ AuthTestCase.test_change_password_current_new_nonsecure ____________
  3022.  
  3023. self = <tests.test_user.AuthTestCase testMethod=test_change_password_current_new_nonsecure>
  3024.  
  3025. def test_change_password_current_new_nonsecure(self):
  3026. self.api.user.save(**self.USER_DATA)
  3027. > self.api.user.login(login=self.USER_DATA["login"], password=self.USER_DATA["password"])
  3028.  
  3029. tests/test_user.py:333:
  3030. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  3031. ../packages/userapp/userapp/__init__.py:325: in __call__
  3032. return self._client.call(self._version, self._parent._service_name, self._method_name, kwargs)
  3033. ../packages/userapp/userapp/__init__.py:245: in call
  3034. result = DictionaryUtility.to_object(response.json())
  3035. /usr/local/lib/python3.6/site-packages/requests/models.py:892: in json
  3036. return complexjson.loads(self.text, **kwargs)
  3037. /usr/local/lib/python3.6/site-packages/simplejson/__init__.py:518: in loads
  3038. return _default_decoder.decode(s)
  3039. /usr/local/lib/python3.6/site-packages/simplejson/decoder.py:370: in decode
  3040. obj, end = self.raw_decode(s)
  3041. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  3042.  
  3043. self = <simplejson.decoder.JSONDecoder object at 0x7f794e0da0b8>
  3044. s = 'A server error occurred. Please contact the administrator.', idx = 0
  3045. _w = <built-in method match of _sre.SRE_Pattern object at 0x7f79550f4e70>
  3046. _PY3 = True
  3047.  
  3048. def raw_decode(self, s, idx=0, _w=WHITESPACE.match, _PY3=PY3):
  3049. """Decode a JSON document from ``s`` (a ``str`` or ``unicode``
  3050. beginning with a JSON document) and return a 2-tuple of the Python
  3051. representation and the index in ``s`` where the document ended.
  3052. Optionally, ``idx`` can be used to specify an offset in ``s`` where
  3053. the JSON document begins.
  3054.  
  3055. This can be used to decode a JSON document from a string that may
  3056. have extraneous data at the end.
  3057.  
  3058. """
  3059. if idx < 0:
  3060. # Ensure that raw_decode bails on negative indexes, the regex
  3061. # would otherwise mask this behavior. #98
  3062. raise JSONDecodeError('Expecting value', s, idx)
  3063. if _PY3 and not isinstance(s, text_type):
  3064. raise TypeError("Input string must be text, not bytes")
  3065. # strip UTF-8 bom
  3066. if len(s) > idx:
  3067. ord0 = ord(s[idx])
  3068. if ord0 == 0xfeff:
  3069. idx += 1
  3070. elif ord0 == 0xef and s[idx:idx + 3] == '\xef\xbb\xbf':
  3071. idx += 3
  3072. > return self.scan_once(s, idx=_w(s, idx).end())
  3073. E simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
  3074.  
  3075. /usr/local/lib/python3.6/site-packages/simplejson/decoder.py:400: JSONDecodeError
  3076. ----------------------------- Captured stdout call -----------------------------
  3077. 2019-03-08T18:35:36.005602Z [info ] request  client_addr=127.0.0.1 forwarding= json={'first_name': 'Test', 'last_name': 'Testovac', 'email_verified': True, 'login': 'testuser@example.com', 'password': 'MadladPwd42', 'properties': {'currency': {'value': 'usd'}, 'language': {'value': 'en'}}} method=POST path=/v1/user.save request_id=f5c2793bb69246eeac602297c7058475
  3078. 2019-03-08T18:35:36.345488Z [info ] response  length=446 request_id=f5c2793bb69246eeac602297c7058475 status=200
  3079. 2019-03-08T18:35:36.350702Z [info ] request  client_addr=127.0.0.1 forwarding= json={'login': 'testuser@example.com', 'password': 'MadladPwd42'} method=POST path=/v1/user.login request_id=c47d4754a8af452589c8136d4cd74762
  3080. ----------------------------- Captured stderr call -----------------------------
  3081. 2019-03-08T18:35:34.719056Z [debug ] stdlib_log  [ddtrace.encoding] message=using Msgpack encoder request_id=0239925bfd9c4558bce0aa5184d8717e
  3082. 2019-03-08T18:35:34.719310Z [info ] stdlib_log  [ddtrace.sampler] message=initialized RateSampler, sample 100.0% of traces request_id=0239925bfd9c4558bce0aa5184d8717e
  3083. 2019-03-08T18:35:34.724328Z [debug ] stdlib_log  [ddtrace.writer] message=resetting queues. pids(old:None new:68) request_id=0239925bfd9c4558bce0aa5184d8717e
  3084. 2019-03-08T18:35:34.724563Z [debug ] stdlib_log  [ddtrace.writer] message=starting flush thread request_id=0239925bfd9c4558bce0aa5184d8717e
  3085. 2019-03-08T18:35:35.731131Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  3086. 2019-03-08T18:35:35.734917Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  3087. 2019-03-08T18:35:35.998406Z [debug ] stdlib_log  [userapp] message=Calling post http://localhost:8080/v1/user.save with headers {'Content-Type': 'application/json', 'Authorization': 'Basic V281NzMwWmFGYVZVbkxXTE1oQk5hUTo='} and body {"first_name": "Test", "last_name": "Testovac", "email_verified": true, "login": "testuser@example.com", "password": "MadladPwd42", "properties": {"currency": {"value": "usd"}, "language": {"value": "en"}}} request_id=0239925bfd9c4558bce0aa5184d8717e
  3088. 2019-03-08T18:35:36.001206Z [debug ] stdlib_log  [urllib3.connectionpool] message=Starting new HTTP connection (1): localhost request_id=0239925bfd9c4558bce0aa5184d8717e
  3089. 2019-03-08T18:35:36.346332Z [debug ] stdlib_log  [urllib3.connectionpool] message=http://localhost:8080 "POST /v1/user.save HTTP/1.1" 200 446 request_id=0239925bfd9c4558bce0aa5184d8717e
  3090. 2019-03-08T18:35:36.347271Z [debug ] stdlib_log  [userapp] message=Recieved response={
  3091. "brand": "kiwicom",
  3092. "created_at": 1552070136.037593,
  3093. "email": "testuser@example.com",
  3094. "email_verified": true,
  3095. "first_name": "Test",
  3096. "last_login_at": null,
  3097. "last_name": "Testovac",
  3098. "locks": [],
  3099. "login": "testuser@example.com",
  3100. "properties": {
  3101. "currency": {
  3102. "value": "usd"
  3103. },
  3104. "language": {
  3105. "value": "en"
  3106. }
  3107. },
  3108. "updated_at": 1552070136.037601,
  3109. "user_id": "Go2PIYz3-hTno1v-AAuyqc"
  3110. }
  3111.  request_id=0239925bfd9c4558bce0aa5184d8717e
  3112. 2019-03-08T18:35:36.347667Z [debug ] stdlib_log  [userapp] message=Calling post http://localhost:8080/v1/user.login with headers {'Content-Type': 'application/json', 'Authorization': 'Basic V281NzMwWmFGYVZVbkxXTE1oQk5hUTo='} and body {"login": "testuser@example.com", "password": "MadladPwd42"} request_id=0239925bfd9c4558bce0aa5184d8717e
  3113. 2019-03-08T18:35:36.349168Z [debug ] stdlib_log  [urllib3.connectionpool] message=Starting new HTTP connection (1): localhost request_id=0239925bfd9c4558bce0aa5184d8717e
  3114. Traceback (most recent call last):
  3115. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 484, in connect
  3116. sock = self._connect()
  3117. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 541, in _connect
  3118. raise err
  3119. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 529, in _connect
  3120. sock.connect(socket_address)
  3121. File "/usr/local/lib/python3.6/site-packages/gevent/_socket3.py", line 307, in connect
  3122. raise error(result, strerror(result))
  3123. OSError: [Errno 99] Address not available
  3124.  
  3125. During handling of the above exception, another exception occurred:
  3126.  
  3127. Traceback (most recent call last):
  3128. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 667, in execute_command
  3129. connection.send_command(*args)
  3130. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 610, in send_command
  3131. self.send_packed_command(self.pack_command(*args))
  3132. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 585, in send_packed_command
  3133. self.connect()
  3134. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 489, in connect
  3135. raise ConnectionError(self._error_message(e))
  3136. redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  3137.  
  3138. During handling of the above exception, another exception occurred:
  3139.  
  3140. Traceback (most recent call last):
  3141. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 484, in connect
  3142. sock = self._connect()
  3143. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 541, in _connect
  3144. raise err
  3145. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 529, in _connect
  3146. sock.connect(socket_address)
  3147. File "/usr/local/lib/python3.6/site-packages/gevent/_socket3.py", line 307, in connect
  3148. raise error(result, strerror(result))
  3149. OSError: [Errno 99] Address not available
  3150.  
  3151. During handling of the above exception, another exception occurred:
  3152.  
  3153. Traceback (most recent call last):
  3154. File "/usr/local/lib/python3.6/wsgiref/handlers.py", line 137, in run
  3155. self.result = application(self.environ, self.start_response)
  3156. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1997, in __call__
  3157. return self.wsgi_app(environ, start_response)
  3158. File "/usr/src/app/auth/middleware.py", line 57, in __call__
  3159. retval = self.app(environ, custom_start_response)
  3160. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1985, in wsgi_app
  3161. response = self.handle_exception(e)
  3162. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1540, in handle_exception
  3163. reraise(exc_type, exc_value, tb)
  3164. File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
  3165. raise value
  3166. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
  3167. response = self.full_dispatch_request()
  3168. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
  3169. rv = self.handle_user_exception(e)
  3170. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
  3171. reraise(exc_type, exc_value, tb)
  3172. File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
  3173. raise value
  3174. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request
  3175. rv = self.dispatch_request()
  3176. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request
  3177. return self.view_functions[rule.endpoint](**req.view_args)
  3178. File "/usr/src/packages/flask-jsonschemer/flask_jsonschemer.py", line 71, in decorated
  3179. return fn(*args, **kwargs)
  3180. File "/usr/src/app/auth/token/decorators.py", line 38, in decorated
  3181. return f(*args, **kwargs)
  3182. File "/usr/src/app/auth/views.py", line 139, in login
  3183. check_block(user_json["login"])
  3184. File "/usr/src/app/auth/utils.py", line 26, in check_block
  3185. if int(kvstore.get(key)) >= current_app.config["INVALID_LOGIN_ATTEMPTS"]:
  3186. File "/usr/local/lib/python3.6/site-packages/simplekv/decorator.py", line 52, in get
  3187. return self._dstore.get(self._map_key(key), *args, **kwargs)
  3188. File "/usr/local/lib/python3.6/site-packages/simplekv/__init__.py", line 75, in get
  3189. return self._get(key)
  3190. File "/usr/local/lib/python3.6/site-packages/simplekv/memory/redisstore.py", line 31, in _get
  3191. val = self.redis.get(key)
  3192. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 976, in get
  3193. return self.execute_command('GET', name)
  3194. File "/usr/local/lib/python3.6/site-packages/ddtrace/contrib/redis/patch.py", line 58, in traced_execute_command
  3195. return func(*args, **kwargs)
  3196. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 673, in execute_command
  3197. connection.send_command(*args)
  3198. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 610, in send_command
  3199. self.send_packed_command(self.pack_command(*args))
  3200. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 585, in send_packed_command
  3201. self.connect()
  3202. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 489, in connect
  3203. raise ConnectionError(self._error_message(e))
  3204. redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  3205. 2019-03-08T18:35:36.358665Z [debug ] stdlib_log  [urllib3.connectionpool] message=http://localhost:8080 "POST /v1/user.login HTTP/1.1" 500 59 request_id=0239925bfd9c4558bce0aa5184d8717e
  3206. 2019-03-08T18:35:36.359477Z [debug ] stdlib_log  [userapp] message=Recieved response=A server error occurred. Please contact the administrator. request_id=0239925bfd9c4558bce0aa5184d8717e
  3207. 2019-03-08T18:35:36.742088Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  3208. 2019-03-08T18:35:36.746186Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  3209. ___________ AuthTestCase.test_change_password_current_new_only_once ____________
  3210.  
  3211. self = <tests.test_user.AuthTestCase testMethod=test_change_password_current_new_only_once>
  3212.  
  3213. def test_change_password_current_new_only_once(self):
  3214. self.api.user.save(**self.USER_DATA)
  3215. > self.api.user.login(login=self.USER_DATA["login"], password=self.USER_DATA["password"])
  3216.  
  3217. tests/test_user.py:342:
  3218. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  3219. ../packages/userapp/userapp/__init__.py:325: in __call__
  3220. return self._client.call(self._version, self._parent._service_name, self._method_name, kwargs)
  3221. ../packages/userapp/userapp/__init__.py:245: in call
  3222. result = DictionaryUtility.to_object(response.json())
  3223. /usr/local/lib/python3.6/site-packages/requests/models.py:892: in json
  3224. return complexjson.loads(self.text, **kwargs)
  3225. /usr/local/lib/python3.6/site-packages/simplejson/__init__.py:518: in loads
  3226. return _default_decoder.decode(s)
  3227. /usr/local/lib/python3.6/site-packages/simplejson/decoder.py:370: in decode
  3228. obj, end = self.raw_decode(s)
  3229. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  3230.  
  3231. self = <simplejson.decoder.JSONDecoder object at 0x7f794e0da0b8>
  3232. s = 'A server error occurred. Please contact the administrator.', idx = 0
  3233. _w = <built-in method match of _sre.SRE_Pattern object at 0x7f79550f4e70>
  3234. _PY3 = True
  3235.  
  3236. def raw_decode(self, s, idx=0, _w=WHITESPACE.match, _PY3=PY3):
  3237. """Decode a JSON document from ``s`` (a ``str`` or ``unicode``
  3238. beginning with a JSON document) and return a 2-tuple of the Python
  3239. representation and the index in ``s`` where the document ended.
  3240. Optionally, ``idx`` can be used to specify an offset in ``s`` where
  3241. the JSON document begins.
  3242.  
  3243. This can be used to decode a JSON document from a string that may
  3244. have extraneous data at the end.
  3245.  
  3246. """
  3247. if idx < 0:
  3248. # Ensure that raw_decode bails on negative indexes, the regex
  3249. # would otherwise mask this behavior. #98
  3250. raise JSONDecodeError('Expecting value', s, idx)
  3251. if _PY3 and not isinstance(s, text_type):
  3252. raise TypeError("Input string must be text, not bytes")
  3253. # strip UTF-8 bom
  3254. if len(s) > idx:
  3255. ord0 = ord(s[idx])
  3256. if ord0 == 0xfeff:
  3257. idx += 1
  3258. elif ord0 == 0xef and s[idx:idx + 3] == '\xef\xbb\xbf':
  3259. idx += 3
  3260. > return self.scan_once(s, idx=_w(s, idx).end())
  3261. E simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
  3262.  
  3263. /usr/local/lib/python3.6/site-packages/simplejson/decoder.py:400: JSONDecodeError
  3264. ----------------------------- Captured stdout call -----------------------------
  3265. 2019-03-08T18:35:38.270602Z [info ] request  client_addr=127.0.0.1 forwarding= json={'first_name': 'Test', 'last_name': 'Testovac', 'email_verified': True, 'login': 'testuser@example.com', 'password': 'MadladPwd42', 'properties': {'currency': {'value': 'usd'}, 'language': {'value': 'en'}}} method=POST path=/v1/user.save request_id=98d89399813f499da3d377999eab428a
  3266. 2019-03-08T18:35:38.603333Z [info ] response  length=446 request_id=98d89399813f499da3d377999eab428a status=200
  3267. 2019-03-08T18:35:38.608670Z [info ] request  client_addr=127.0.0.1 forwarding= json={'login': 'testuser@example.com', 'password': 'MadladPwd42'} method=POST path=/v1/user.login request_id=0ea6f51d6b6547d0846657c1f3b8b799
  3268. ----------------------------- Captured stderr call -----------------------------
  3269. 2019-03-08T18:35:36.983226Z [debug ] stdlib_log  [ddtrace.encoding] message=using Msgpack encoder request_id=0239925bfd9c4558bce0aa5184d8717e
  3270. 2019-03-08T18:35:36.983483Z [info ] stdlib_log  [ddtrace.sampler] message=initialized RateSampler, sample 100.0% of traces request_id=0239925bfd9c4558bce0aa5184d8717e
  3271. 2019-03-08T18:35:36.988400Z [debug ] stdlib_log  [ddtrace.writer] message=resetting queues. pids(old:None new:68) request_id=0239925bfd9c4558bce0aa5184d8717e
  3272. 2019-03-08T18:35:36.988637Z [debug ] stdlib_log  [ddtrace.writer] message=starting flush thread request_id=0239925bfd9c4558bce0aa5184d8717e
  3273. 2019-03-08T18:35:37.991959Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  3274. 2019-03-08T18:35:37.994684Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  3275. 2019-03-08T18:35:38.260118Z [debug ] stdlib_log  [userapp] message=Calling post http://localhost:8080/v1/user.save with headers {'Content-Type': 'application/json', 'Authorization': 'Basic Tm9YMDg4STVmSl8yN3NEb2tHbTNMZTo='} and body {"first_name": "Test", "last_name": "Testovac", "email_verified": true, "login": "testuser@example.com", "password": "MadladPwd42", "properties": {"currency": {"value": "usd"}, "language": {"value": "en"}}} request_id=0239925bfd9c4558bce0aa5184d8717e
  3276. 2019-03-08T18:35:38.265103Z [debug ] stdlib_log  [urllib3.connectionpool] message=Starting new HTTP connection (1): localhost request_id=0239925bfd9c4558bce0aa5184d8717e
  3277. 2019-03-08T18:35:38.604178Z [debug ] stdlib_log  [urllib3.connectionpool] message=http://localhost:8080 "POST /v1/user.save HTTP/1.1" 200 446 request_id=0239925bfd9c4558bce0aa5184d8717e
  3278. 2019-03-08T18:35:38.605174Z [debug ] stdlib_log  [userapp] message=Recieved response={
  3279. "brand": "kiwicom",
  3280. "created_at": 1552070138.294828,
  3281. "email": "testuser@example.com",
  3282. "email_verified": true,
  3283. "first_name": "Test",
  3284. "last_login_at": null,
  3285. "last_name": "Testovac",
  3286. "locks": [],
  3287. "login": "testuser@example.com",
  3288. "properties": {
  3289. "currency": {
  3290. "value": "usd"
  3291. },
  3292. "language": {
  3293. "value": "en"
  3294. }
  3295. },
  3296. "updated_at": 1552070138.294833,
  3297. "user_id": "Tn06w7K53A9MblnpfWOZVe"
  3298. }
  3299.  request_id=0239925bfd9c4558bce0aa5184d8717e
  3300. 2019-03-08T18:35:38.605578Z [debug ] stdlib_log  [userapp] message=Calling post http://localhost:8080/v1/user.login with headers {'Content-Type': 'application/json', 'Authorization': 'Basic Tm9YMDg4STVmSl8yN3NEb2tHbTNMZTo='} and body {"login": "testuser@example.com", "password": "MadladPwd42"} request_id=0239925bfd9c4558bce0aa5184d8717e
  3301. 2019-03-08T18:35:38.607156Z [debug ] stdlib_log  [urllib3.connectionpool] message=Starting new HTTP connection (1): localhost request_id=0239925bfd9c4558bce0aa5184d8717e
  3302. Traceback (most recent call last):
  3303. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 484, in connect
  3304. sock = self._connect()
  3305. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 541, in _connect
  3306. raise err
  3307. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 529, in _connect
  3308. sock.connect(socket_address)
  3309. File "/usr/local/lib/python3.6/site-packages/gevent/_socket3.py", line 307, in connect
  3310. raise error(result, strerror(result))
  3311. OSError: [Errno 99] Address not available
  3312.  
  3313. During handling of the above exception, another exception occurred:
  3314.  
  3315. Traceback (most recent call last):
  3316. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 667, in execute_command
  3317. connection.send_command(*args)
  3318. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 610, in send_command
  3319. self.send_packed_command(self.pack_command(*args))
  3320. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 585, in send_packed_command
  3321. self.connect()
  3322. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 489, in connect
  3323. raise ConnectionError(self._error_message(e))
  3324. redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  3325.  
  3326. During handling of the above exception, another exception occurred:
  3327.  
  3328. Traceback (most recent call last):
  3329. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 484, in connect
  3330. sock = self._connect()
  3331. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 541, in _connect
  3332. raise err
  3333. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 529, in _connect
  3334. sock.connect(socket_address)
  3335. File "/usr/local/lib/python3.6/site-packages/gevent/_socket3.py", line 307, in connect
  3336. raise error(result, strerror(result))
  3337. OSError: [Errno 99] Address not available
  3338.  
  3339. During handling of the above exception, another exception occurred:
  3340.  
  3341. Traceback (most recent call last):
  3342. File "/usr/local/lib/python3.6/wsgiref/handlers.py", line 137, in run
  3343. self.result = application(self.environ, self.start_response)
  3344. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1997, in __call__
  3345. return self.wsgi_app(environ, start_response)
  3346. File "/usr/src/app/auth/middleware.py", line 57, in __call__
  3347. retval = self.app(environ, custom_start_response)
  3348. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1985, in wsgi_app
  3349. response = self.handle_exception(e)
  3350. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1540, in handle_exception
  3351. reraise(exc_type, exc_value, tb)
  3352. File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
  3353. raise value
  3354. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
  3355. response = self.full_dispatch_request()
  3356. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
  3357. rv = self.handle_user_exception(e)
  3358. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
  3359. reraise(exc_type, exc_value, tb)
  3360. File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
  3361. raise value
  3362. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request
  3363. rv = self.dispatch_request()
  3364. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request
  3365. return self.view_functions[rule.endpoint](**req.view_args)
  3366. File "/usr/src/packages/flask-jsonschemer/flask_jsonschemer.py", line 71, in decorated
  3367. return fn(*args, **kwargs)
  3368. File "/usr/src/app/auth/token/decorators.py", line 38, in decorated
  3369. return f(*args, **kwargs)
  3370. File "/usr/src/app/auth/views.py", line 139, in login
  3371. check_block(user_json["login"])
  3372. File "/usr/src/app/auth/utils.py", line 26, in check_block
  3373. if int(kvstore.get(key)) >= current_app.config["INVALID_LOGIN_ATTEMPTS"]:
  3374. File "/usr/local/lib/python3.6/site-packages/simplekv/decorator.py", line 52, in get
  3375. return self._dstore.get(self._map_key(key), *args, **kwargs)
  3376. File "/usr/local/lib/python3.6/site-packages/simplekv/__init__.py", line 75, in get
  3377. return self._get(key)
  3378. File "/usr/local/lib/python3.6/site-packages/simplekv/memory/redisstore.py", line 31, in _get
  3379. val = self.redis.get(key)
  3380. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 976, in get
  3381. return self.execute_command('GET', name)
  3382. File "/usr/local/lib/python3.6/site-packages/ddtrace/contrib/redis/patch.py", line 58, in traced_execute_command
  3383. return func(*args, **kwargs)
  3384. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 673, in execute_command
  3385. connection.send_command(*args)
  3386. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 610, in send_command
  3387. self.send_packed_command(self.pack_command(*args))
  3388. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 585, in send_packed_command
  3389. self.connect()
  3390. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 489, in connect
  3391. raise ConnectionError(self._error_message(e))
  3392. redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  3393. 2019-03-08T18:35:38.617408Z [debug ] stdlib_log  [urllib3.connectionpool] message=http://localhost:8080 "POST /v1/user.login HTTP/1.1" 500 59 request_id=0239925bfd9c4558bce0aa5184d8717e
  3394. 2019-03-08T18:35:38.618281Z [debug ] stdlib_log  [userapp] message=Recieved response=A server error occurred. Please contact the administrator. request_id=0239925bfd9c4558bce0aa5184d8717e
  3395. 2019-03-08T18:35:38.997900Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  3396. 2019-03-08T18:35:38.999294Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  3397. ___________________ AuthTestCase.test_change_password_token ____________________
  3398.  
  3399. self = <tests.test_user.AuthTestCase testMethod=test_change_password_token>
  3400.  
  3401. def test_change_password_token(self):
  3402. new_user = self.api.user.save(**self.USER_DATA)
  3403. new_password = "CompletelyNewMadlad24"
  3404. self.api.user.reset_password(login=new_user["login"])
  3405. self.assertTrue(self.mock_req.post.called)
  3406. token = self.mock_req.post.call_args[1]["data"]["token"]
  3407. self.api.user.change_password(new_password=new_password, password_token=token)
  3408. > resp = self.api.user.login(login=self.USER_DATA["login"], password=new_password)
  3409.  
  3410. tests/test_user.py:311:
  3411. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  3412. ../packages/userapp/userapp/__init__.py:325: in __call__
  3413. return self._client.call(self._version, self._parent._service_name, self._method_name, kwargs)
  3414. ../packages/userapp/userapp/__init__.py:245: in call
  3415. result = DictionaryUtility.to_object(response.json())
  3416. /usr/local/lib/python3.6/site-packages/requests/models.py:892: in json
  3417. return complexjson.loads(self.text, **kwargs)
  3418. /usr/local/lib/python3.6/site-packages/simplejson/__init__.py:518: in loads
  3419. return _default_decoder.decode(s)
  3420. /usr/local/lib/python3.6/site-packages/simplejson/decoder.py:370: in decode
  3421. obj, end = self.raw_decode(s)
  3422. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  3423.  
  3424. self = <simplejson.decoder.JSONDecoder object at 0x7f794e0da0b8>
  3425. s = 'A server error occurred. Please contact the administrator.', idx = 0
  3426. _w = <built-in method match of _sre.SRE_Pattern object at 0x7f79550f4e70>
  3427. _PY3 = True
  3428.  
  3429. def raw_decode(self, s, idx=0, _w=WHITESPACE.match, _PY3=PY3):
  3430. """Decode a JSON document from ``s`` (a ``str`` or ``unicode``
  3431. beginning with a JSON document) and return a 2-tuple of the Python
  3432. representation and the index in ``s`` where the document ended.
  3433. Optionally, ``idx`` can be used to specify an offset in ``s`` where
  3434. the JSON document begins.
  3435.  
  3436. This can be used to decode a JSON document from a string that may
  3437. have extraneous data at the end.
  3438.  
  3439. """
  3440. if idx < 0:
  3441. # Ensure that raw_decode bails on negative indexes, the regex
  3442. # would otherwise mask this behavior. #98
  3443. raise JSONDecodeError('Expecting value', s, idx)
  3444. if _PY3 and not isinstance(s, text_type):
  3445. raise TypeError("Input string must be text, not bytes")
  3446. # strip UTF-8 bom
  3447. if len(s) > idx:
  3448. ord0 = ord(s[idx])
  3449. if ord0 == 0xfeff:
  3450. idx += 1
  3451. elif ord0 == 0xef and s[idx:idx + 3] == '\xef\xbb\xbf':
  3452. idx += 3
  3453. > return self.scan_once(s, idx=_w(s, idx).end())
  3454. E simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
  3455.  
  3456. /usr/local/lib/python3.6/site-packages/simplejson/decoder.py:400: JSONDecodeError
  3457. ----------------------------- Captured stdout call -----------------------------
  3458. 2019-03-08T18:35:44.544821Z [info ] request  client_addr=127.0.0.1 forwarding= json={'first_name': 'Test', 'last_name': 'Testovac', 'email_verified': True, 'login': 'testuser@example.com', 'password': 'MadladPwd42', 'properties': {'currency': {'value': 'usd'}, 'language': {'value': 'en'}}} method=POST path=/v1/user.save request_id=35702b2816e84ce08ae764e6207853a1
  3459. 2019-03-08T18:35:44.941950Z [info ] response  length=446 request_id=35702b2816e84ce08ae764e6207853a1 status=200
  3460. 2019-03-08T18:35:44.949797Z [info ] request  client_addr=127.0.0.1 forwarding= json={'login': 'testuser@example.com'} method=POST path=/v1/user.resetPassword request_id=e88f2be0e1c14ed78f06b47c0e7ec12b
  3461. 2019-03-08T18:35:44.984494Z [info ] response  length=3 request_id=e88f2be0e1c14ed78f06b47c0e7ec12b status=200
  3462. 2019-03-08T18:35:44.990113Z [info ] request  client_addr=127.0.0.1 forwarding= json={'new_password': 'CompletelyNewMadlad24', 'password_token': 'InRlc3R1c2VyQGV4YW1wbGUuY29tZXRZX3FST05ORSI.D2RHgA.p0yO3Iwhkizs3tAJ3oo8sC4i9Sc'} method=POST path=/v1/user.changePassword request_id=d87d13cbe3c948048d5cc99bef4ecb45
  3463. 2019-03-08T18:35:45.394431Z [info ] response  length=3 request_id=d87d13cbe3c948048d5cc99bef4ecb45 status=200
  3464. 2019-03-08T18:35:45.414014Z [info ] request  client_addr=127.0.0.1 forwarding= json={'login': 'testuser@example.com', 'password': 'CompletelyNewMadlad24'} method=POST path=/v1/user.login request_id=751f24fb02214edcbc6fac83711cdefe
  3465. ----------------------------- Captured stderr call -----------------------------
  3466. 2019-03-08T18:35:43.148623Z [debug ] stdlib_log  [ddtrace.encoding] message=using Msgpack encoder request_id=0239925bfd9c4558bce0aa5184d8717e
  3467. 2019-03-08T18:35:43.149190Z [info ] stdlib_log  [ddtrace.sampler] message=initialized RateSampler, sample 100.0% of traces request_id=0239925bfd9c4558bce0aa5184d8717e
  3468. 2019-03-08T18:35:43.157766Z [debug ] stdlib_log  [ddtrace.writer] message=resetting queues. pids(old:None new:68) request_id=0239925bfd9c4558bce0aa5184d8717e
  3469. 2019-03-08T18:35:43.158423Z [debug ] stdlib_log  [ddtrace.writer] message=starting flush thread request_id=0239925bfd9c4558bce0aa5184d8717e
  3470. 2019-03-08T18:35:43.273990Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  3471. 2019-03-08T18:35:43.278375Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  3472. 2019-03-08T18:35:44.162854Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  3473. 2019-03-08T18:35:44.164002Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  3474. 2019-03-08T18:35:44.539505Z [debug ] stdlib_log  [userapp] message=Calling post http://localhost:8080/v1/user.save with headers {'Content-Type': 'application/json', 'Authorization': 'Basic X2VmeGJlaVBWUFl4LTRCTFRDcEtFYjo='} and body {"first_name": "Test", "last_name": "Testovac", "email_verified": true, "login": "testuser@example.com", "password": "MadladPwd42", "properties": {"currency": {"value": "usd"}, "language": {"value": "en"}}} request_id=0239925bfd9c4558bce0aa5184d8717e
  3475. 2019-03-08T18:35:44.542631Z [debug ] stdlib_log  [urllib3.connectionpool] message=Starting new HTTP connection (1): localhost request_id=0239925bfd9c4558bce0aa5184d8717e
  3476. 2019-03-08T18:35:44.943499Z [debug ] stdlib_log  [urllib3.connectionpool] message=http://localhost:8080 "POST /v1/user.save HTTP/1.1" 200 446 request_id=0239925bfd9c4558bce0aa5184d8717e
  3477. 2019-03-08T18:35:44.945243Z [debug ] stdlib_log  [userapp] message=Recieved response={
  3478. "brand": "kiwicom",
  3479. "created_at": 1552070144.575799,
  3480. "email": "testuser@example.com",
  3481. "email_verified": true,
  3482. "first_name": "Test",
  3483. "last_login_at": null,
  3484. "last_name": "Testovac",
  3485. "locks": [],
  3486. "login": "testuser@example.com",
  3487. "properties": {
  3488. "currency": {
  3489. "value": "usd"
  3490. },
  3491. "language": {
  3492. "value": "en"
  3493. }
  3494. },
  3495. "updated_at": 1552070144.575805,
  3496. "user_id": "z6G371o4kqqLbNuXvwTKZ3"
  3497. }
  3498.  request_id=0239925bfd9c4558bce0aa5184d8717e
  3499. 2019-03-08T18:35:44.945761Z [debug ] stdlib_log  [userapp] message=Calling post http://localhost:8080/v1/user.resetPassword with headers {'Content-Type': 'application/json', 'Authorization': 'Basic X2VmeGJlaVBWUFl4LTRCTFRDcEtFYjo='} and body {"login": "testuser@example.com"} request_id=0239925bfd9c4558bce0aa5184d8717e
  3500. 2019-03-08T18:35:44.947656Z [debug ] stdlib_log  [urllib3.connectionpool] message=Starting new HTTP connection (1): localhost request_id=0239925bfd9c4558bce0aa5184d8717e
  3501. 2019-03-08T18:35:44.982828Z [info ] stdlib_log  [datadog.dogstatsd] message=Error submitting packet, dropping the packet and closing the socket request_id=e88f2be0e1c14ed78f06b47c0e7ec12b
  3502. 2019-03-08T18:35:44.985353Z [debug ] stdlib_log  [urllib3.connectionpool] message=http://localhost:8080 "POST /v1/user.resetPassword HTTP/1.1" 200 3 request_id=0239925bfd9c4558bce0aa5184d8717e
  3503. 2019-03-08T18:35:44.986416Z [debug ] stdlib_log  [userapp] message=Recieved response={}
  3504.  request_id=0239925bfd9c4558bce0aa5184d8717e
  3505. 2019-03-08T18:35:44.986839Z [debug ] stdlib_log  [userapp] message=Calling post http://localhost:8080/v1/user.changePassword with headers {'Content-Type': 'application/json', 'Authorization': 'Basic X2VmeGJlaVBWUFl4LTRCTFRDcEtFYjo='} and body {"new_password": "CompletelyNewMadlad24", "password_token": "InRlc3R1c2VyQGV4YW1wbGUuY29tZXRZX3FST05ORSI.D2RHgA.p0yO3Iwhkizs3tAJ3oo8sC4i9Sc"} request_id=0239925bfd9c4558bce0aa5184d8717e
  3506. 2019-03-08T18:35:44.988510Z [debug ] stdlib_log  [urllib3.connectionpool] message=Starting new HTTP connection (1): localhost request_id=0239925bfd9c4558bce0aa5184d8717e
  3507. 2019-03-08T18:35:45.312692Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  3508. 2019-03-08T18:35:45.314890Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  3509. 2019-03-08T18:35:45.391633Z [info ] stdlib_log  [datadog.dogstatsd] message=Error submitting packet, dropping the packet and closing the socket request_id=d87d13cbe3c948048d5cc99bef4ecb45
  3510. 2019-03-08T18:35:45.396877Z [debug ] stdlib_log  [urllib3.connectionpool] message=http://localhost:8080 "POST /v1/user.changePassword HTTP/1.1" 200 3 request_id=0239925bfd9c4558bce0aa5184d8717e
  3511. 2019-03-08T18:35:45.399712Z [debug ] stdlib_log  [userapp] message=Recieved response={}
  3512.  request_id=0239925bfd9c4558bce0aa5184d8717e
  3513. 2019-03-08T18:35:45.400941Z [debug ] stdlib_log  [userapp] message=Calling post http://localhost:8080/v1/user.login with headers {'Content-Type': 'application/json', 'Authorization': 'Basic X2VmeGJlaVBWUFl4LTRCTFRDcEtFYjo='} and body {"login": "testuser@example.com", "password": "CompletelyNewMadlad24"} request_id=0239925bfd9c4558bce0aa5184d8717e
  3514. 2019-03-08T18:35:45.407978Z [debug ] stdlib_log  [urllib3.connectionpool] message=Starting new HTTP connection (1): localhost request_id=0239925bfd9c4558bce0aa5184d8717e
  3515. Traceback (most recent call last):
  3516. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 484, in connect
  3517. sock = self._connect()
  3518. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 541, in _connect
  3519. raise err
  3520. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 529, in _connect
  3521. sock.connect(socket_address)
  3522. File "/usr/local/lib/python3.6/site-packages/gevent/_socket3.py", line 307, in connect
  3523. raise error(result, strerror(result))
  3524. OSError: [Errno 99] Address not available
  3525.  
  3526. During handling of the above exception, another exception occurred:
  3527.  
  3528. Traceback (most recent call last):
  3529. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 667, in execute_command
  3530. connection.send_command(*args)
  3531. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 610, in send_command
  3532. self.send_packed_command(self.pack_command(*args))
  3533. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 585, in send_packed_command
  3534. self.connect()
  3535. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 489, in connect
  3536. raise ConnectionError(self._error_message(e))
  3537. redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  3538.  
  3539. During handling of the above exception, another exception occurred:
  3540.  
  3541. Traceback (most recent call last):
  3542. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 484, in connect
  3543. sock = self._connect()
  3544. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 541, in _connect
  3545. raise err
  3546. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 529, in _connect
  3547. sock.connect(socket_address)
  3548. File "/usr/local/lib/python3.6/site-packages/gevent/_socket3.py", line 307, in connect
  3549. raise error(result, strerror(result))
  3550. OSError: [Errno 99] Address not available
  3551.  
  3552. During handling of the above exception, another exception occurred:
  3553.  
  3554. Traceback (most recent call last):
  3555. File "/usr/local/lib/python3.6/wsgiref/handlers.py", line 137, in run
  3556. self.result = application(self.environ, self.start_response)
  3557. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1997, in __call__
  3558. return self.wsgi_app(environ, start_response)
  3559. File "/usr/src/app/auth/middleware.py", line 57, in __call__
  3560. retval = self.app(environ, custom_start_response)
  3561. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1985, in wsgi_app
  3562. response = self.handle_exception(e)
  3563. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1540, in handle_exception
  3564. reraise(exc_type, exc_value, tb)
  3565. File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
  3566. raise value
  3567. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
  3568. response = self.full_dispatch_request()
  3569. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
  3570. rv = self.handle_user_exception(e)
  3571. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
  3572. reraise(exc_type, exc_value, tb)
  3573. File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
  3574. raise value
  3575. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request
  3576. rv = self.dispatch_request()
  3577. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request
  3578. return self.view_functions[rule.endpoint](**req.view_args)
  3579. File "/usr/src/packages/flask-jsonschemer/flask_jsonschemer.py", line 71, in decorated
  3580. return fn(*args, **kwargs)
  3581. File "/usr/src/app/auth/token/decorators.py", line 38, in decorated
  3582. return f(*args, **kwargs)
  3583. File "/usr/src/app/auth/views.py", line 139, in login
  3584. check_block(user_json["login"])
  3585. File "/usr/src/app/auth/utils.py", line 26, in check_block
  3586. if int(kvstore.get(key)) >= current_app.config["INVALID_LOGIN_ATTEMPTS"]:
  3587. File "/usr/local/lib/python3.6/site-packages/simplekv/decorator.py", line 52, in get
  3588. return self._dstore.get(self._map_key(key), *args, **kwargs)
  3589. File "/usr/local/lib/python3.6/site-packages/simplekv/__init__.py", line 75, in get
  3590. return self._get(key)
  3591. File "/usr/local/lib/python3.6/site-packages/simplekv/memory/redisstore.py", line 31, in _get
  3592. val = self.redis.get(key)
  3593. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 976, in get
  3594. return self.execute_command('GET', name)
  3595. File "/usr/local/lib/python3.6/site-packages/ddtrace/contrib/redis/patch.py", line 58, in traced_execute_command
  3596. return func(*args, **kwargs)
  3597. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 673, in execute_command
  3598. connection.send_command(*args)
  3599. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 610, in send_command
  3600. self.send_packed_command(self.pack_command(*args))
  3601. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 585, in send_packed_command
  3602. self.connect()
  3603. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 489, in connect
  3604. raise ConnectionError(self._error_message(e))
  3605. redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  3606. 2019-03-08T18:35:45.443228Z [debug ] stdlib_log  [urllib3.connectionpool] message=http://localhost:8080 "POST /v1/user.login HTTP/1.1" 500 59 request_id=0239925bfd9c4558bce0aa5184d8717e
  3607. 2019-03-08T18:35:45.446687Z [debug ] stdlib_log  [userapp] message=Recieved response=A server error occurred. Please contact the administrator. request_id=0239925bfd9c4558bce0aa5184d8717e
  3608. _______________________ AuthTestCase.test_get_user_empty _______________________
  3609.  
  3610. self = <tests.test_user.AuthTestCase testMethod=test_get_user_empty>
  3611.  
  3612. def test_get_user_empty(self):
  3613. new_user = self.api.user.save(**self.USER_DATA)
  3614. > self.api.user.login(login=self.USER_DATA["login"], password=self.USER_DATA["password"])
  3615.  
  3616. tests/test_user.py:237:
  3617. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  3618. ../packages/userapp/userapp/__init__.py:325: in __call__
  3619. return self._client.call(self._version, self._parent._service_name, self._method_name, kwargs)
  3620. ../packages/userapp/userapp/__init__.py:245: in call
  3621. result = DictionaryUtility.to_object(response.json())
  3622. /usr/local/lib/python3.6/site-packages/requests/models.py:892: in json
  3623. return complexjson.loads(self.text, **kwargs)
  3624. /usr/local/lib/python3.6/site-packages/simplejson/__init__.py:518: in loads
  3625. return _default_decoder.decode(s)
  3626. /usr/local/lib/python3.6/site-packages/simplejson/decoder.py:370: in decode
  3627. obj, end = self.raw_decode(s)
  3628. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  3629.  
  3630. self = <simplejson.decoder.JSONDecoder object at 0x7f794e0da0b8>
  3631. s = 'A server error occurred. Please contact the administrator.', idx = 0
  3632. _w = <built-in method match of _sre.SRE_Pattern object at 0x7f79550f4e70>
  3633. _PY3 = True
  3634.  
  3635. def raw_decode(self, s, idx=0, _w=WHITESPACE.match, _PY3=PY3):
  3636. """Decode a JSON document from ``s`` (a ``str`` or ``unicode``
  3637. beginning with a JSON document) and return a 2-tuple of the Python
  3638. representation and the index in ``s`` where the document ended.
  3639. Optionally, ``idx`` can be used to specify an offset in ``s`` where
  3640. the JSON document begins.
  3641.  
  3642. This can be used to decode a JSON document from a string that may
  3643. have extraneous data at the end.
  3644.  
  3645. """
  3646. if idx < 0:
  3647. # Ensure that raw_decode bails on negative indexes, the regex
  3648. # would otherwise mask this behavior. #98
  3649. raise JSONDecodeError('Expecting value', s, idx)
  3650. if _PY3 and not isinstance(s, text_type):
  3651. raise TypeError("Input string must be text, not bytes")
  3652. # strip UTF-8 bom
  3653. if len(s) > idx:
  3654. ord0 = ord(s[idx])
  3655. if ord0 == 0xfeff:
  3656. idx += 1
  3657. elif ord0 == 0xef and s[idx:idx + 3] == '\xef\xbb\xbf':
  3658. idx += 3
  3659. > return self.scan_once(s, idx=_w(s, idx).end())
  3660. E simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
  3661.  
  3662. /usr/local/lib/python3.6/site-packages/simplejson/decoder.py:400: JSONDecodeError
  3663. ----------------------------- Captured stdout call -----------------------------
  3664. 2019-03-08T18:36:08.308128Z [info ] request  client_addr=127.0.0.1 forwarding= json={'first_name': 'Test', 'last_name': 'Testovac', 'email_verified': True, 'login': 'testuser@example.com', 'password': 'MadladPwd42', 'properties': {'currency': {'value': 'usd'}, 'language': {'value': 'en'}}} method=POST path=/v1/user.save request_id=e370fe126c244ac3a51b2942bb81d600
  3665. 2019-03-08T18:36:08.730815Z [info ] response  length=446 request_id=e370fe126c244ac3a51b2942bb81d600 status=200
  3666. 2019-03-08T18:36:08.746429Z [info ] request  client_addr=127.0.0.1 forwarding= json={'login': 'testuser@example.com', 'password': 'MadladPwd42'} method=POST path=/v1/user.login request_id=3d233df2e44c4f8eb3c60477a40a39a4
  3667. ----------------------------- Captured stderr call -----------------------------
  3668. 2019-03-08T18:36:06.993534Z [debug ] stdlib_log  [ddtrace.encoding] message=using Msgpack encoder request_id=0239925bfd9c4558bce0aa5184d8717e
  3669. 2019-03-08T18:36:06.993792Z [info ] stdlib_log  [ddtrace.sampler] message=initialized RateSampler, sample 100.0% of traces request_id=0239925bfd9c4558bce0aa5184d8717e
  3670. 2019-03-08T18:36:06.998938Z [debug ] stdlib_log  [ddtrace.writer] message=resetting queues. pids(old:None new:68) request_id=0239925bfd9c4558bce0aa5184d8717e
  3671. 2019-03-08T18:36:06.999175Z [debug ] stdlib_log  [ddtrace.writer] message=starting flush thread request_id=0239925bfd9c4558bce0aa5184d8717e
  3672. 2019-03-08T18:36:08.008738Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  3673. 2019-03-08T18:36:08.013243Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  3674. 2019-03-08T18:36:08.297176Z [debug ] stdlib_log  [userapp] message=Calling post http://localhost:8080/v1/user.save with headers {'Content-Type': 'application/json', 'Authorization': 'Basic TFhINl9ZR0ZwVHY0a290NW9RWFVKazo='} and body {"first_name": "Test", "last_name": "Testovac", "email_verified": true, "login": "testuser@example.com", "password": "MadladPwd42", "properties": {"currency": {"value": "usd"}, "language": {"value": "en"}}} request_id=0239925bfd9c4558bce0aa5184d8717e
  3675. 2019-03-08T18:36:08.302783Z [debug ] stdlib_log  [urllib3.connectionpool] message=Starting new HTTP connection (1): localhost request_id=0239925bfd9c4558bce0aa5184d8717e
  3676. 2019-03-08T18:36:08.733785Z [debug ] stdlib_log  [urllib3.connectionpool] message=http://localhost:8080 "POST /v1/user.save HTTP/1.1" 200 446 request_id=0239925bfd9c4558bce0aa5184d8717e
  3677. 2019-03-08T18:36:08.737092Z [debug ] stdlib_log  [userapp] message=Recieved response={
  3678. "brand": "kiwicom",
  3679. "created_at": 1552070168.337621,
  3680. "email": "testuser@example.com",
  3681. "email_verified": true,
  3682. "first_name": "Test",
  3683. "last_login_at": null,
  3684. "last_name": "Testovac",
  3685. "locks": [],
  3686. "login": "testuser@example.com",
  3687. "properties": {
  3688. "currency": {
  3689. "value": "usd"
  3690. },
  3691. "language": {
  3692. "value": "en"
  3693. }
  3694. },
  3695. "updated_at": 1552070168.337627,
  3696. "user_id": "sofkfqMSycUP4FlPoOXqBP"
  3697. }
  3698.  request_id=0239925bfd9c4558bce0aa5184d8717e
  3699. 2019-03-08T18:36:08.738508Z [debug ] stdlib_log  [userapp] message=Calling post http://localhost:8080/v1/user.login with headers {'Content-Type': 'application/json', 'Authorization': 'Basic TFhINl9ZR0ZwVHY0a290NW9RWFVKazo='} and body {"login": "testuser@example.com", "password": "MadladPwd42"} request_id=0239925bfd9c4558bce0aa5184d8717e
  3700. 2019-03-08T18:36:08.743111Z [debug ] stdlib_log  [urllib3.connectionpool] message=Starting new HTTP connection (1): localhost request_id=0239925bfd9c4558bce0aa5184d8717e
  3701. Traceback (most recent call last):
  3702. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 484, in connect
  3703. sock = self._connect()
  3704. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 541, in _connect
  3705. raise err
  3706. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 529, in _connect
  3707. sock.connect(socket_address)
  3708. File "/usr/local/lib/python3.6/site-packages/gevent/_socket3.py", line 307, in connect
  3709. raise error(result, strerror(result))
  3710. OSError: [Errno 99] Address not available
  3711.  
  3712. During handling of the above exception, another exception occurred:
  3713.  
  3714. Traceback (most recent call last):
  3715. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 667, in execute_command
  3716. connection.send_command(*args)
  3717. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 610, in send_command
  3718. self.send_packed_command(self.pack_command(*args))
  3719. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 585, in send_packed_command
  3720. self.connect()
  3721. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 489, in connect
  3722. raise ConnectionError(self._error_message(e))
  3723. redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  3724.  
  3725. During handling of the above exception, another exception occurred:
  3726.  
  3727. Traceback (most recent call last):
  3728. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 484, in connect
  3729. sock = self._connect()
  3730. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 541, in _connect
  3731. raise err
  3732. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 529, in _connect
  3733. sock.connect(socket_address)
  3734. File "/usr/local/lib/python3.6/site-packages/gevent/_socket3.py", line 307, in connect
  3735. raise error(result, strerror(result))
  3736. OSError: [Errno 99] Address not available
  3737.  
  3738. During handling of the above exception, another exception occurred:
  3739.  
  3740. Traceback (most recent call last):
  3741. File "/usr/local/lib/python3.6/wsgiref/handlers.py", line 137, in run
  3742. self.result = application(self.environ, self.start_response)
  3743. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1997, in __call__
  3744. return self.wsgi_app(environ, start_response)
  3745. File "/usr/src/app/auth/middleware.py", line 57, in __call__
  3746. retval = self.app(environ, custom_start_response)
  3747. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1985, in wsgi_app
  3748. response = self.handle_exception(e)
  3749. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1540, in handle_exception
  3750. reraise(exc_type, exc_value, tb)
  3751. File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
  3752. raise value
  3753. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
  3754. response = self.full_dispatch_request()
  3755. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
  3756. rv = self.handle_user_exception(e)
  3757. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
  3758. reraise(exc_type, exc_value, tb)
  3759. File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
  3760. raise value
  3761. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request
  3762. rv = self.dispatch_request()
  3763. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request
  3764. return self.view_functions[rule.endpoint](**req.view_args)
  3765. File "/usr/src/packages/flask-jsonschemer/flask_jsonschemer.py", line 71, in decorated
  3766. return fn(*args, **kwargs)
  3767. File "/usr/src/app/auth/token/decorators.py", line 38, in decorated
  3768. return f(*args, **kwargs)
  3769. File "/usr/src/app/auth/views.py", line 139, in login
  3770. check_block(user_json["login"])
  3771. File "/usr/src/app/auth/utils.py", line 26, in check_block
  3772. if int(kvstore.get(key)) >= current_app.config["INVALID_LOGIN_ATTEMPTS"]:
  3773. File "/usr/local/lib/python3.6/site-packages/simplekv/decorator.py", line 52, in get
  3774. return self._dstore.get(self._map_key(key), *args, **kwargs)
  3775. File "/usr/local/lib/python3.6/site-packages/simplekv/__init__.py", line 75, in get
  3776. return self._get(key)
  3777. File "/usr/local/lib/python3.6/site-packages/simplekv/memory/redisstore.py", line 31, in _get
  3778. val = self.redis.get(key)
  3779. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 976, in get
  3780. return self.execute_command('GET', name)
  3781. File "/usr/local/lib/python3.6/site-packages/ddtrace/contrib/redis/patch.py", line 58, in traced_execute_command
  3782. return func(*args, **kwargs)
  3783. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 673, in execute_command
  3784. connection.send_command(*args)
  3785. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 610, in send_command
  3786. self.send_packed_command(self.pack_command(*args))
  3787. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 585, in send_packed_command
  3788. self.connect()
  3789. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 489, in connect
  3790. raise ConnectionError(self._error_message(e))
  3791. redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  3792. 2019-03-08T18:36:08.758243Z [debug ] stdlib_log  [urllib3.connectionpool] message=http://localhost:8080 "POST /v1/user.login HTTP/1.1" 500 59 request_id=0239925bfd9c4558bce0aa5184d8717e
  3793. 2019-03-08T18:36:08.759174Z [debug ] stdlib_log  [userapp] message=Recieved response=A server error occurred. Please contact the administrator. request_id=0239925bfd9c4558bce0aa5184d8717e
  3794. 2019-03-08T18:36:09.020673Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  3795. 2019-03-08T18:36:09.024774Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  3796. _______________________ AuthTestCase.test_get_user_self ________________________
  3797.  
  3798. self = <tests.test_user.AuthTestCase testMethod=test_get_user_self>
  3799.  
  3800. def test_get_user_self(self):
  3801. self.api.user.save(**self.USER_DATA)
  3802. > self.api.user.login(login=self.USER_DATA["login"], password=self.USER_DATA["password"])
  3803.  
  3804. tests/test_user.py:229:
  3805. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  3806. ../packages/userapp/userapp/__init__.py:325: in __call__
  3807. return self._client.call(self._version, self._parent._service_name, self._method_name, kwargs)
  3808. ../packages/userapp/userapp/__init__.py:245: in call
  3809. result = DictionaryUtility.to_object(response.json())
  3810. /usr/local/lib/python3.6/site-packages/requests/models.py:892: in json
  3811. return complexjson.loads(self.text, **kwargs)
  3812. /usr/local/lib/python3.6/site-packages/simplejson/__init__.py:518: in loads
  3813. return _default_decoder.decode(s)
  3814. /usr/local/lib/python3.6/site-packages/simplejson/decoder.py:370: in decode
  3815. obj, end = self.raw_decode(s)
  3816. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  3817.  
  3818. self = <simplejson.decoder.JSONDecoder object at 0x7f794e0da0b8>
  3819. s = 'A server error occurred. Please contact the administrator.', idx = 0
  3820. _w = <built-in method match of _sre.SRE_Pattern object at 0x7f79550f4e70>
  3821. _PY3 = True
  3822.  
  3823. def raw_decode(self, s, idx=0, _w=WHITESPACE.match, _PY3=PY3):
  3824. """Decode a JSON document from ``s`` (a ``str`` or ``unicode``
  3825. beginning with a JSON document) and return a 2-tuple of the Python
  3826. representation and the index in ``s`` where the document ended.
  3827. Optionally, ``idx`` can be used to specify an offset in ``s`` where
  3828. the JSON document begins.
  3829.  
  3830. This can be used to decode a JSON document from a string that may
  3831. have extraneous data at the end.
  3832.  
  3833. """
  3834. if idx < 0:
  3835. # Ensure that raw_decode bails on negative indexes, the regex
  3836. # would otherwise mask this behavior. #98
  3837. raise JSONDecodeError('Expecting value', s, idx)
  3838. if _PY3 and not isinstance(s, text_type):
  3839. raise TypeError("Input string must be text, not bytes")
  3840. # strip UTF-8 bom
  3841. if len(s) > idx:
  3842. ord0 = ord(s[idx])
  3843. if ord0 == 0xfeff:
  3844. idx += 1
  3845. elif ord0 == 0xef and s[idx:idx + 3] == '\xef\xbb\xbf':
  3846. idx += 3
  3847. > return self.scan_once(s, idx=_w(s, idx).end())
  3848. E simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
  3849.  
  3850. /usr/local/lib/python3.6/site-packages/simplejson/decoder.py:400: JSONDecodeError
  3851. ----------------------------- Captured stdout call -----------------------------
  3852. 2019-03-08T18:36:13.225202Z [info ] request  client_addr=127.0.0.1 forwarding= json={'first_name': 'Test', 'last_name': 'Testovac', 'email_verified': True, 'login': 'testuser@example.com', 'password': 'MadladPwd42', 'properties': {'currency': {'value': 'usd'}, 'language': {'value': 'en'}}} method=POST path=/v1/user.save request_id=53a825b4d5c74956910b2f5fb897a2de
  3853. 2019-03-08T18:36:13.588590Z [info ] response  length=445 request_id=53a825b4d5c74956910b2f5fb897a2de status=200
  3854. 2019-03-08T18:36:13.594291Z [info ] request  client_addr=127.0.0.1 forwarding= json={'login': 'testuser@example.com', 'password': 'MadladPwd42'} method=POST path=/v1/user.login request_id=2773da0578234fac8fdeab9e5cbca5e7
  3855. ----------------------------- Captured stderr call -----------------------------
  3856. 2019-03-08T18:36:11.788419Z [debug ] stdlib_log  [ddtrace.encoding] message=using Msgpack encoder request_id=0239925bfd9c4558bce0aa5184d8717e
  3857. 2019-03-08T18:36:11.789324Z [info ] stdlib_log  [ddtrace.sampler] message=initialized RateSampler, sample 100.0% of traces request_id=0239925bfd9c4558bce0aa5184d8717e
  3858. 2019-03-08T18:36:11.804298Z [debug ] stdlib_log  [ddtrace.writer] message=resetting queues. pids(old:None new:68) request_id=0239925bfd9c4558bce0aa5184d8717e
  3859. 2019-03-08T18:36:11.804782Z [debug ] stdlib_log  [ddtrace.writer] message=starting flush thread request_id=0239925bfd9c4558bce0aa5184d8717e
  3860. 2019-03-08T18:36:12.808118Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  3861. 2019-03-08T18:36:12.809848Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  3862. 2019-03-08T18:36:13.213224Z [debug ] stdlib_log  [userapp] message=Calling post http://localhost:8080/v1/user.save with headers {'Content-Type': 'application/json', 'Authorization': 'Basic SFg5V0Y3MFNZdUllNThBeGEzNG40Vzo='} and body {"first_name": "Test", "last_name": "Testovac", "email_verified": true, "login": "testuser@example.com", "password": "MadladPwd42", "properties": {"currency": {"value": "usd"}, "language": {"value": "en"}}} request_id=0239925bfd9c4558bce0aa5184d8717e
  3863. 2019-03-08T18:36:13.219296Z [debug ] stdlib_log  [urllib3.connectionpool] message=Starting new HTTP connection (1): localhost request_id=0239925bfd9c4558bce0aa5184d8717e
  3864. 2019-03-08T18:36:13.589528Z [debug ] stdlib_log  [urllib3.connectionpool] message=http://localhost:8080 "POST /v1/user.save HTTP/1.1" 200 445 request_id=0239925bfd9c4558bce0aa5184d8717e
  3865. 2019-03-08T18:36:13.590566Z [debug ] stdlib_log  [userapp] message=Recieved response={
  3866. "brand": "kiwicom",
  3867. "created_at": 1552070173.25418,
  3868. "email": "testuser@example.com",
  3869. "email_verified": true,
  3870. "first_name": "Test",
  3871. "last_login_at": null,
  3872. "last_name": "Testovac",
  3873. "locks": [],
  3874. "login": "testuser@example.com",
  3875. "properties": {
  3876. "currency": {
  3877. "value": "usd"
  3878. },
  3879. "language": {
  3880. "value": "en"
  3881. }
  3882. },
  3883. "updated_at": 1552070173.254186,
  3884. "user_id": "a0XrmpDWBCaqpzUoMopiUn"
  3885. }
  3886.  request_id=0239925bfd9c4558bce0aa5184d8717e
  3887. 2019-03-08T18:36:13.591011Z [debug ] stdlib_log  [userapp] message=Calling post http://localhost:8080/v1/user.login with headers {'Content-Type': 'application/json', 'Authorization': 'Basic SFg5V0Y3MFNZdUllNThBeGEzNG40Vzo='} and body {"login": "testuser@example.com", "password": "MadladPwd42"} request_id=0239925bfd9c4558bce0aa5184d8717e
  3888. 2019-03-08T18:36:13.592686Z [debug ] stdlib_log  [urllib3.connectionpool] message=Starting new HTTP connection (1): localhost request_id=0239925bfd9c4558bce0aa5184d8717e
  3889. Traceback (most recent call last):
  3890. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 484, in connect
  3891. sock = self._connect()
  3892. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 541, in _connect
  3893. raise err
  3894. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 529, in _connect
  3895. sock.connect(socket_address)
  3896. File "/usr/local/lib/python3.6/site-packages/gevent/_socket3.py", line 307, in connect
  3897. raise error(result, strerror(result))
  3898. OSError: [Errno 99] Address not available
  3899.  
  3900. During handling of the above exception, another exception occurred:
  3901.  
  3902. Traceback (most recent call last):
  3903. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 667, in execute_command
  3904. connection.send_command(*args)
  3905. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 610, in send_command
  3906. self.send_packed_command(self.pack_command(*args))
  3907. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 585, in send_packed_command
  3908. self.connect()
  3909. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 489, in connect
  3910. raise ConnectionError(self._error_message(e))
  3911. redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  3912.  
  3913. During handling of the above exception, another exception occurred:
  3914.  
  3915. Traceback (most recent call last):
  3916. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 484, in connect
  3917. sock = self._connect()
  3918. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 541, in _connect
  3919. raise err
  3920. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 529, in _connect
  3921. sock.connect(socket_address)
  3922. File "/usr/local/lib/python3.6/site-packages/gevent/_socket3.py", line 307, in connect
  3923. raise error(result, strerror(result))
  3924. OSError: [Errno 99] Address not available
  3925.  
  3926. During handling of the above exception, another exception occurred:
  3927.  
  3928. Traceback (most recent call last):
  3929. File "/usr/local/lib/python3.6/wsgiref/handlers.py", line 137, in run
  3930. self.result = application(self.environ, self.start_response)
  3931. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1997, in __call__
  3932. return self.wsgi_app(environ, start_response)
  3933. File "/usr/src/app/auth/middleware.py", line 57, in __call__
  3934. retval = self.app(environ, custom_start_response)
  3935. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1985, in wsgi_app
  3936. response = self.handle_exception(e)
  3937. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1540, in handle_exception
  3938. reraise(exc_type, exc_value, tb)
  3939. File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
  3940. raise value
  3941. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
  3942. response = self.full_dispatch_request()
  3943. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
  3944. rv = self.handle_user_exception(e)
  3945. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
  3946. reraise(exc_type, exc_value, tb)
  3947. File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
  3948. raise value
  3949. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request
  3950. rv = self.dispatch_request()
  3951. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request
  3952. return self.view_functions[rule.endpoint](**req.view_args)
  3953. File "/usr/src/packages/flask-jsonschemer/flask_jsonschemer.py", line 71, in decorated
  3954. return fn(*args, **kwargs)
  3955. File "/usr/src/app/auth/token/decorators.py", line 38, in decorated
  3956. return f(*args, **kwargs)
  3957. File "/usr/src/app/auth/views.py", line 139, in login
  3958. check_block(user_json["login"])
  3959. File "/usr/src/app/auth/utils.py", line 26, in check_block
  3960. if int(kvstore.get(key)) >= current_app.config["INVALID_LOGIN_ATTEMPTS"]:
  3961. File "/usr/local/lib/python3.6/site-packages/simplekv/decorator.py", line 52, in get
  3962. return self._dstore.get(self._map_key(key), *args, **kwargs)
  3963. File "/usr/local/lib/python3.6/site-packages/simplekv/__init__.py", line 75, in get
  3964. return self._get(key)
  3965. File "/usr/local/lib/python3.6/site-packages/simplekv/memory/redisstore.py", line 31, in _get
  3966. val = self.redis.get(key)
  3967. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 976, in get
  3968. return self.execute_command('GET', name)
  3969. File "/usr/local/lib/python3.6/site-packages/ddtrace/contrib/redis/patch.py", line 58, in traced_execute_command
  3970. return func(*args, **kwargs)
  3971. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 673, in execute_command
  3972. connection.send_command(*args)
  3973. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 610, in send_command
  3974. self.send_packed_command(self.pack_command(*args))
  3975. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 585, in send_packed_command
  3976. self.connect()
  3977. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 489, in connect
  3978. raise ConnectionError(self._error_message(e))
  3979. redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  3980. 2019-03-08T18:36:13.603591Z [debug ] stdlib_log  [urllib3.connectionpool] message=http://localhost:8080 "POST /v1/user.login HTTP/1.1" 500 59 request_id=0239925bfd9c4558bce0aa5184d8717e
  3981. 2019-03-08T18:36:13.604520Z [debug ] stdlib_log  [userapp] message=Recieved response=A server error occurred. Please contact the administrator. request_id=0239925bfd9c4558bce0aa5184d8717e
  3982. 2019-03-08T18:36:13.816708Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  3983. 2019-03-08T18:36:13.821561Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  3984. __________________ AuthTestCase.test_login_user_invalid_login __________________
  3985.  
  3986. self = <tests.test_user.AuthTestCase testMethod=test_login_user_invalid_login>
  3987.  
  3988. def test_login_user_invalid_login(self):
  3989. with self.assertRaises(userapp.UserAppServiceException):
  3990. > self.api.user.login(login=self.USER_DATA["login"], password=self.USER_DATA["password"])
  3991.  
  3992. tests/test_user.py:193:
  3993. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  3994. ../packages/userapp/userapp/__init__.py:325: in __call__
  3995. return self._client.call(self._version, self._parent._service_name, self._method_name, kwargs)
  3996. ../packages/userapp/userapp/__init__.py:245: in call
  3997. result = DictionaryUtility.to_object(response.json())
  3998. /usr/local/lib/python3.6/site-packages/requests/models.py:892: in json
  3999. return complexjson.loads(self.text, **kwargs)
  4000. /usr/local/lib/python3.6/site-packages/simplejson/__init__.py:518: in loads
  4001. return _default_decoder.decode(s)
  4002. /usr/local/lib/python3.6/site-packages/simplejson/decoder.py:370: in decode
  4003. obj, end = self.raw_decode(s)
  4004. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  4005.  
  4006. def raw_decode(self, s, idx=0, _w=WHITESPACE.match, _PY3=PY3):
  4007. """Decode a JSON document from ``s`` (a ``str`` or ``unicode``
  4008. beginning with a JSON document) and return a 2-tuple of the Python
  4009. representation and the index in ``s`` where the document ended.
  4010. Optionally, ``idx`` can be used to specify an offset in ``s`` where
  4011. the JSON document begins.
  4012.  
  4013. This can be used to decode a JSON document from a string that may
  4014. have extraneous data at the end.
  4015.  
  4016. """
  4017. if idx < 0:
  4018. # Ensure that raw_decode bails on negative indexes, the regex
  4019. # would otherwise mask this behavior. #98
  4020. raise JSONDecodeError('Expecting value', s, idx)
  4021. if _PY3 and not isinstance(s, text_type):
  4022. raise TypeError("Input string must be text, not bytes")
  4023. # strip UTF-8 bom
  4024. if len(s) > idx:
  4025. ord0 = ord(s[idx])
  4026. if ord0 == 0xfeff:
  4027. idx += 1
  4028. elif ord0 == 0xef and s[idx:idx + 3] == '\xef\xbb\xbf':
  4029. idx += 3
  4030. > return self.scan_once(s, idx=_w(s, idx).end())
  4031. E simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
  4032.  
  4033. /usr/local/lib/python3.6/site-packages/simplejson/decoder.py:400: JSONDecodeError
  4034. ----------------------------- Captured stdout call -----------------------------
  4035. 2019-03-08T18:36:24.263855Z [info ] request  client_addr=127.0.0.1 forwarding= json={'login': 'testuser@example.com', 'password': 'MadladPwd42'} method=POST path=/v1/user.login request_id=07fa52b9e8bc4c96949a272f8fc3259b
  4036. ----------------------------- Captured stderr call -----------------------------
  4037. 2019-03-08T18:36:22.954629Z [debug ] stdlib_log  [ddtrace.encoding] message=using Msgpack encoder request_id=0239925bfd9c4558bce0aa5184d8717e
  4038. 2019-03-08T18:36:22.955552Z [info ] stdlib_log  [ddtrace.sampler] message=initialized RateSampler, sample 100.0% of traces request_id=0239925bfd9c4558bce0aa5184d8717e
  4039. 2019-03-08T18:36:22.967355Z [debug ] stdlib_log  [ddtrace.writer] message=resetting queues. pids(old:None new:68) request_id=0239925bfd9c4558bce0aa5184d8717e
  4040. 2019-03-08T18:36:22.967790Z [debug ] stdlib_log  [ddtrace.writer] message=starting flush thread request_id=0239925bfd9c4558bce0aa5184d8717e
  4041. 2019-03-08T18:36:23.974885Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  4042. 2019-03-08T18:36:23.976257Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  4043. 2019-03-08T18:36:24.254269Z [debug ] stdlib_log  [userapp] message=Calling post http://localhost:8080/v1/user.login with headers {'Content-Type': 'application/json', 'Authorization': 'Basic SEtRbDdWbWhyMmhQLUhUSndUTndISDo='} and body {"login": "testuser@example.com", "password": "MadladPwd42"} request_id=0239925bfd9c4558bce0aa5184d8717e
  4044. 2019-03-08T18:36:24.259873Z [debug ] stdlib_log  [urllib3.connectionpool] message=Starting new HTTP connection (1): localhost request_id=0239925bfd9c4558bce0aa5184d8717e
  4045. Traceback (most recent call last):
  4046. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 484, in connect
  4047. sock = self._connect()
  4048. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 541, in _connect
  4049. raise err
  4050. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 529, in _connect
  4051. sock.connect(socket_address)
  4052. File "/usr/local/lib/python3.6/site-packages/gevent/_socket3.py", line 307, in connect
  4053. raise error(result, strerror(result))
  4054. OSError: [Errno 99] Address not available
  4055.  
  4056. During handling of the above exception, another exception occurred:
  4057.  
  4058. Traceback (most recent call last):
  4059. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 667, in execute_command
  4060. connection.send_command(*args)
  4061. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 610, in send_command
  4062. self.send_packed_command(self.pack_command(*args))
  4063. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 585, in send_packed_command
  4064. self.connect()
  4065. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 489, in connect
  4066. raise ConnectionError(self._error_message(e))
  4067. redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  4068.  
  4069. During handling of the above exception, another exception occurred:
  4070.  
  4071. Traceback (most recent call last):
  4072. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 484, in connect
  4073. sock = self._connect()
  4074. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 541, in _connect
  4075. raise err
  4076. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 529, in _connect
  4077. sock.connect(socket_address)
  4078. File "/usr/local/lib/python3.6/site-packages/gevent/_socket3.py", line 307, in connect
  4079. raise error(result, strerror(result))
  4080. OSError: [Errno 99] Address not available
  4081.  
  4082. During handling of the above exception, another exception occurred:
  4083.  
  4084. Traceback (most recent call last):
  4085. File "/usr/local/lib/python3.6/wsgiref/handlers.py", line 137, in run
  4086. self.result = application(self.environ, self.start_response)
  4087. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1997, in __call__
  4088. return self.wsgi_app(environ, start_response)
  4089. File "/usr/src/app/auth/middleware.py", line 57, in __call__
  4090. retval = self.app(environ, custom_start_response)
  4091. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1985, in wsgi_app
  4092. response = self.handle_exception(e)
  4093. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1540, in handle_exception
  4094. reraise(exc_type, exc_value, tb)
  4095. File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
  4096. raise value
  4097. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
  4098. response = self.full_dispatch_request()
  4099. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
  4100. rv = self.handle_user_exception(e)
  4101. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
  4102. reraise(exc_type, exc_value, tb)
  4103. File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
  4104. raise value
  4105. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request
  4106. rv = self.dispatch_request()
  4107. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request
  4108. return self.view_functions[rule.endpoint](**req.view_args)
  4109. File "/usr/src/packages/flask-jsonschemer/flask_jsonschemer.py", line 71, in decorated
  4110. return fn(*args, **kwargs)
  4111. File "/usr/src/app/auth/token/decorators.py", line 38, in decorated
  4112. return f(*args, **kwargs)
  4113. File "/usr/src/app/auth/views.py", line 139, in login
  4114. check_block(user_json["login"])
  4115. File "/usr/src/app/auth/utils.py", line 26, in check_block
  4116. if int(kvstore.get(key)) >= current_app.config["INVALID_LOGIN_ATTEMPTS"]:
  4117. File "/usr/local/lib/python3.6/site-packages/simplekv/decorator.py", line 52, in get
  4118. return self._dstore.get(self._map_key(key), *args, **kwargs)
  4119. File "/usr/local/lib/python3.6/site-packages/simplekv/__init__.py", line 75, in get
  4120. return self._get(key)
  4121. File "/usr/local/lib/python3.6/site-packages/simplekv/memory/redisstore.py", line 31, in _get
  4122. val = self.redis.get(key)
  4123. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 976, in get
  4124. return self.execute_command('GET', name)
  4125. File "/usr/local/lib/python3.6/site-packages/ddtrace/contrib/redis/patch.py", line 58, in traced_execute_command
  4126. return func(*args, **kwargs)
  4127. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 673, in execute_command
  4128. connection.send_command(*args)
  4129. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 610, in send_command
  4130. self.send_packed_command(self.pack_command(*args))
  4131. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 585, in send_packed_command
  4132. self.connect()
  4133. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 489, in connect
  4134. raise ConnectionError(self._error_message(e))
  4135. redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  4136. 2019-03-08T18:36:24.286959Z [debug ] stdlib_log  [urllib3.connectionpool] message=http://localhost:8080 "POST /v1/user.login HTTP/1.1" 500 59 request_id=0239925bfd9c4558bce0aa5184d8717e
  4137. 2019-03-08T18:36:24.287983Z [debug ] stdlib_log  [userapp] message=Recieved response=A server error occurred. Please contact the administrator. request_id=0239925bfd9c4558bce0aa5184d8717e
  4138. _______________ AuthTestCase.test_login_user_login_not_verified ________________
  4139.  
  4140. self = <tests.test_user.AuthTestCase testMethod=test_login_user_login_not_verified>
  4141.  
  4142. def test_login_user_login_not_verified(self):
  4143. data = self.USER_DATA.copy()
  4144. data["email_verified"] = False
  4145. self.api.user.save(**data)
  4146. with self.assertRaises(userapp.UserAppServiceException):
  4147. > self.api.user.login(login=self.USER_DATA["login"], password=self.USER_DATA["password"])
  4148.  
  4149. tests/test_user.py:189:
  4150. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  4151. ../packages/userapp/userapp/__init__.py:325: in __call__
  4152. return self._client.call(self._version, self._parent._service_name, self._method_name, kwargs)
  4153. ../packages/userapp/userapp/__init__.py:245: in call
  4154. result = DictionaryUtility.to_object(response.json())
  4155. /usr/local/lib/python3.6/site-packages/requests/models.py:892: in json
  4156. return complexjson.loads(self.text, **kwargs)
  4157. /usr/local/lib/python3.6/site-packages/simplejson/__init__.py:518: in loads
  4158. return _default_decoder.decode(s)
  4159. /usr/local/lib/python3.6/site-packages/simplejson/decoder.py:370: in decode
  4160. obj, end = self.raw_decode(s)
  4161. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  4162.  
  4163. def raw_decode(self, s, idx=0, _w=WHITESPACE.match, _PY3=PY3):
  4164. """Decode a JSON document from ``s`` (a ``str`` or ``unicode``
  4165. beginning with a JSON document) and return a 2-tuple of the Python
  4166. representation and the index in ``s`` where the document ended.
  4167. Optionally, ``idx`` can be used to specify an offset in ``s`` where
  4168. the JSON document begins.
  4169.  
  4170. This can be used to decode a JSON document from a string that may
  4171. have extraneous data at the end.
  4172.  
  4173. """
  4174. if idx < 0:
  4175. # Ensure that raw_decode bails on negative indexes, the regex
  4176. # would otherwise mask this behavior. #98
  4177. raise JSONDecodeError('Expecting value', s, idx)
  4178. if _PY3 and not isinstance(s, text_type):
  4179. raise TypeError("Input string must be text, not bytes")
  4180. # strip UTF-8 bom
  4181. if len(s) > idx:
  4182. ord0 = ord(s[idx])
  4183. if ord0 == 0xfeff:
  4184. idx += 1
  4185. elif ord0 == 0xef and s[idx:idx + 3] == '\xef\xbb\xbf':
  4186. idx += 3
  4187. > return self.scan_once(s, idx=_w(s, idx).end())
  4188. E simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
  4189.  
  4190. /usr/local/lib/python3.6/site-packages/simplejson/decoder.py:400: JSONDecodeError
  4191. ----------------------------- Captured stdout call -----------------------------
  4192. 2019-03-08T18:36:26.198337Z [info ] request  client_addr=127.0.0.1 forwarding= json={'first_name': 'Test', 'last_name': 'Testovac', 'email_verified': False, 'login': 'testuser@example.com', 'password': 'MadladPwd42', 'properties': {'currency': {'value': 'usd'}, 'language': {'value': 'en'}}} method=POST path=/v1/user.save request_id=0a9c6fd7a2f349769f3abb0d6ee522e4
  4193. 2019-03-08T18:36:26.860864Z [info ] response  length=640 request_id=0a9c6fd7a2f349769f3abb0d6ee522e4 status=200
  4194. 2019-03-08T18:36:26.870075Z [info ] request  client_addr=127.0.0.1 forwarding= json={'login': 'testuser@example.com', 'password': 'MadladPwd42'} method=POST path=/v1/user.login request_id=30b4272c1b0a456991549bfda0b29809
  4195. ----------------------------- Captured stderr call -----------------------------
  4196. 2019-03-08T18:36:24.912703Z [debug ] stdlib_log  [ddtrace.encoding] message=using Msgpack encoder request_id=0239925bfd9c4558bce0aa5184d8717e
  4197. 2019-03-08T18:36:24.912963Z [info ] stdlib_log  [ddtrace.sampler] message=initialized RateSampler, sample 100.0% of traces request_id=0239925bfd9c4558bce0aa5184d8717e
  4198. 2019-03-08T18:36:24.918036Z [debug ] stdlib_log  [ddtrace.writer] message=resetting queues. pids(old:None new:68) request_id=0239925bfd9c4558bce0aa5184d8717e
  4199. 2019-03-08T18:36:24.918273Z [debug ] stdlib_log  [ddtrace.writer] message=starting flush thread request_id=0239925bfd9c4558bce0aa5184d8717e
  4200. 2019-03-08T18:36:24.983199Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  4201. 2019-03-08T18:36:24.987977Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  4202. 2019-03-08T18:36:25.922842Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  4203. 2019-03-08T18:36:25.924719Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  4204. 2019-03-08T18:36:26.187486Z [debug ] stdlib_log  [userapp] message=Calling post http://localhost:8080/v1/user.save with headers {'Content-Type': 'application/json', 'Authorization': 'Basic UnVNckdhZlAzY0Nwa0dkaHpCcTdCYjo='} and body {"first_name": "Test", "last_name": "Testovac", "email_verified": false, "login": "testuser@example.com", "password": "MadladPwd42", "properties": {"currency": {"value": "usd"}, "language": {"value": "en"}}} request_id=0239925bfd9c4558bce0aa5184d8717e
  4205. 2019-03-08T18:36:26.193008Z [debug ] stdlib_log  [urllib3.connectionpool] message=Starting new HTTP connection (1): localhost request_id=0239925bfd9c4558bce0aa5184d8717e
  4206. 2019-03-08T18:36:26.847612Z [info ] stdlib_log  [datadog.dogstatsd] message=Error submitting packet, dropping the packet and closing the socket request_id=0a9c6fd7a2f349769f3abb0d6ee522e4
  4207. 2019-03-08T18:36:26.862578Z [debug ] stdlib_log  [urllib3.connectionpool] message=http://localhost:8080 "POST /v1/user.save HTTP/1.1" 200 640 request_id=0239925bfd9c4558bce0aa5184d8717e
  4208. 2019-03-08T18:36:26.864288Z [debug ] stdlib_log  [userapp] message=Recieved response={
  4209. "brand": "kiwicom",
  4210. "created_at": 1552070186.227032,
  4211. "email": "testuser@example.com",
  4212. "email_verified": false,
  4213. "first_name": "Test",
  4214. "last_login_at": null,
  4215. "last_name": "Testovac",
  4216. "locks": [
  4217. {
  4218. "created_at": 1552070186.519237,
  4219. "issued_by_user_id": "RuMrGafP3cCpkGdhzBq7Bb",
  4220. "reason": "Email requires verification.",
  4221. "type": "EMAIL_NOT_VERIFIED"
  4222. }
  4223. ],
  4224. "login": "testuser@example.com",
  4225. "properties": {
  4226. "currency": {
  4227. "value": "usd"
  4228. },
  4229. "language": {
  4230. "value": "en"
  4231. }
  4232. },
  4233. "updated_at": 1552070186.227037,
  4234. "user_id": "SnUzWycYFuqlWBPvOtzCkD"
  4235. }
  4236.  request_id=0239925bfd9c4558bce0aa5184d8717e
  4237. 2019-03-08T18:36:26.865055Z [debug ] stdlib_log  [userapp] message=Calling post http://localhost:8080/v1/user.login with headers {'Content-Type': 'application/json', 'Authorization': 'Basic UnVNckdhZlAzY0Nwa0dkaHpCcTdCYjo='} and body {"login": "testuser@example.com", "password": "MadladPwd42"} request_id=0239925bfd9c4558bce0aa5184d8717e
  4238. 2019-03-08T18:36:26.867958Z [debug ] stdlib_log  [urllib3.connectionpool] message=Starting new HTTP connection (1): localhost request_id=0239925bfd9c4558bce0aa5184d8717e
  4239. Traceback (most recent call last):
  4240. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 484, in connect
  4241. sock = self._connect()
  4242. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 541, in _connect
  4243. raise err
  4244. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 529, in _connect
  4245. sock.connect(socket_address)
  4246. File "/usr/local/lib/python3.6/site-packages/gevent/_socket3.py", line 307, in connect
  4247. raise error(result, strerror(result))
  4248. OSError: [Errno 99] Address not available
  4249.  
  4250. During handling of the above exception, another exception occurred:
  4251.  
  4252. Traceback (most recent call last):
  4253. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 667, in execute_command
  4254. connection.send_command(*args)
  4255. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 610, in send_command
  4256. self.send_packed_command(self.pack_command(*args))
  4257. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 585, in send_packed_command
  4258. self.connect()
  4259. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 489, in connect
  4260. raise ConnectionError(self._error_message(e))
  4261. redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  4262.  
  4263. During handling of the above exception, another exception occurred:
  4264.  
  4265. Traceback (most recent call last):
  4266. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 484, in connect
  4267. sock = self._connect()
  4268. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 541, in _connect
  4269. raise err
  4270. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 529, in _connect
  4271. sock.connect(socket_address)
  4272. File "/usr/local/lib/python3.6/site-packages/gevent/_socket3.py", line 307, in connect
  4273. raise error(result, strerror(result))
  4274. OSError: [Errno 99] Address not available
  4275.  
  4276. During handling of the above exception, another exception occurred:
  4277.  
  4278. Traceback (most recent call last):
  4279. File "/usr/local/lib/python3.6/wsgiref/handlers.py", line 137, in run
  4280. self.result = application(self.environ, self.start_response)
  4281. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1997, in __call__
  4282. return self.wsgi_app(environ, start_response)
  4283. File "/usr/src/app/auth/middleware.py", line 57, in __call__
  4284. retval = self.app(environ, custom_start_response)
  4285. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1985, in wsgi_app
  4286. response = self.handle_exception(e)
  4287. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1540, in handle_exception
  4288. reraise(exc_type, exc_value, tb)
  4289. File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
  4290. raise value
  4291. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
  4292. response = self.full_dispatch_request()
  4293. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
  4294. rv = self.handle_user_exception(e)
  4295. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
  4296. reraise(exc_type, exc_value, tb)
  4297. File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
  4298. raise value
  4299. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request
  4300. rv = self.dispatch_request()
  4301. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request
  4302. return self.view_functions[rule.endpoint](**req.view_args)
  4303. File "/usr/src/packages/flask-jsonschemer/flask_jsonschemer.py", line 71, in decorated
  4304. return fn(*args, **kwargs)
  4305. File "/usr/src/app/auth/token/decorators.py", line 38, in decorated
  4306. return f(*args, **kwargs)
  4307. File "/usr/src/app/auth/views.py", line 139, in login
  4308. check_block(user_json["login"])
  4309. File "/usr/src/app/auth/utils.py", line 26, in check_block
  4310. if int(kvstore.get(key)) >= current_app.config["INVALID_LOGIN_ATTEMPTS"]:
  4311. File "/usr/local/lib/python3.6/site-packages/simplekv/decorator.py", line 52, in get
  4312. return self._dstore.get(self._map_key(key), *args, **kwargs)
  4313. File "/usr/local/lib/python3.6/site-packages/simplekv/__init__.py", line 75, in get
  4314. return self._get(key)
  4315. File "/usr/local/lib/python3.6/site-packages/simplekv/memory/redisstore.py", line 31, in _get
  4316. val = self.redis.get(key)
  4317. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 976, in get
  4318. return self.execute_command('GET', name)
  4319. File "/usr/local/lib/python3.6/site-packages/ddtrace/contrib/redis/patch.py", line 58, in traced_execute_command
  4320. return func(*args, **kwargs)
  4321. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 673, in execute_command
  4322. connection.send_command(*args)
  4323. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 610, in send_command
  4324. self.send_packed_command(self.pack_command(*args))
  4325. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 585, in send_packed_command
  4326. self.connect()
  4327. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 489, in connect
  4328. raise ConnectionError(self._error_message(e))
  4329. redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  4330. 2019-03-08T18:36:26.880916Z [debug ] stdlib_log  [urllib3.connectionpool] message=http://localhost:8080 "POST /v1/user.login HTTP/1.1" 500 59 request_id=0239925bfd9c4558bce0aa5184d8717e
  4331. 2019-03-08T18:36:26.881915Z [debug ] stdlib_log  [userapp] message=Recieved response=A server error occurred. Please contact the administrator. request_id=0239925bfd9c4558bce0aa5184d8717e
  4332. 2019-03-08T18:36:26.932048Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  4333. 2019-03-08T18:36:26.936723Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  4334. _________________ AuthTestCase.test_login_user_login_passsword _________________
  4335.  
  4336. self = <tests.test_user.AuthTestCase testMethod=test_login_user_login_passsword>
  4337.  
  4338. def test_login_user_login_passsword(self):
  4339. self.api.user.save(**self.USER_DATA)
  4340. > resp = self.api.user.login(login=self.USER_DATA["login"], password=self.USER_DATA["password"])
  4341.  
  4342. tests/test_user.py:176:
  4343. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  4344. ../packages/userapp/userapp/__init__.py:325: in __call__
  4345. return self._client.call(self._version, self._parent._service_name, self._method_name, kwargs)
  4346. ../packages/userapp/userapp/__init__.py:245: in call
  4347. result = DictionaryUtility.to_object(response.json())
  4348. /usr/local/lib/python3.6/site-packages/requests/models.py:892: in json
  4349. return complexjson.loads(self.text, **kwargs)
  4350. /usr/local/lib/python3.6/site-packages/simplejson/__init__.py:518: in loads
  4351. return _default_decoder.decode(s)
  4352. /usr/local/lib/python3.6/site-packages/simplejson/decoder.py:370: in decode
  4353. obj, end = self.raw_decode(s)
  4354. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  4355.  
  4356. self = <simplejson.decoder.JSONDecoder object at 0x7f794e0da0b8>
  4357. s = 'A server error occurred. Please contact the administrator.', idx = 0
  4358. _w = <built-in method match of _sre.SRE_Pattern object at 0x7f79550f4e70>
  4359. _PY3 = True
  4360.  
  4361. def raw_decode(self, s, idx=0, _w=WHITESPACE.match, _PY3=PY3):
  4362. """Decode a JSON document from ``s`` (a ``str`` or ``unicode``
  4363. beginning with a JSON document) and return a 2-tuple of the Python
  4364. representation and the index in ``s`` where the document ended.
  4365. Optionally, ``idx`` can be used to specify an offset in ``s`` where
  4366. the JSON document begins.
  4367.  
  4368. This can be used to decode a JSON document from a string that may
  4369. have extraneous data at the end.
  4370.  
  4371. """
  4372. if idx < 0:
  4373. # Ensure that raw_decode bails on negative indexes, the regex
  4374. # would otherwise mask this behavior. #98
  4375. raise JSONDecodeError('Expecting value', s, idx)
  4376. if _PY3 and not isinstance(s, text_type):
  4377. raise TypeError("Input string must be text, not bytes")
  4378. # strip UTF-8 bom
  4379. if len(s) > idx:
  4380. ord0 = ord(s[idx])
  4381. if ord0 == 0xfeff:
  4382. idx += 1
  4383. elif ord0 == 0xef and s[idx:idx + 3] == '\xef\xbb\xbf':
  4384. idx += 3
  4385. > return self.scan_once(s, idx=_w(s, idx).end())
  4386. E simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
  4387.  
  4388. /usr/local/lib/python3.6/site-packages/simplejson/decoder.py:400: JSONDecodeError
  4389. ----------------------------- Captured stdout call -----------------------------
  4390. 2019-03-08T18:36:29.026129Z [info ] request  client_addr=127.0.0.1 forwarding= json={'first_name': 'Test', 'last_name': 'Testovac', 'email_verified': True, 'login': 'testuser@example.com', 'password': 'MadladPwd42', 'properties': {'currency': {'value': 'usd'}, 'language': {'value': 'en'}}} method=POST path=/v1/user.save request_id=ae8075b741014f7586b8a92a01ca5343
  4391. 2019-03-08T18:36:29.469932Z [info ] response  length=446 request_id=ae8075b741014f7586b8a92a01ca5343 status=200
  4392. 2019-03-08T18:36:29.495653Z [info ] request  client_addr=127.0.0.1 forwarding= json={'login': 'testuser@example.com', 'password': 'MadladPwd42'} method=POST path=/v1/user.login request_id=dd65e343ebb445c6bbdf7bb62987237b
  4393. ----------------------------- Captured stderr call -----------------------------
  4394. 2019-03-08T18:36:27.563205Z [debug ] stdlib_log  [ddtrace.encoding] message=using Msgpack encoder request_id=0239925bfd9c4558bce0aa5184d8717e
  4395. 2019-03-08T18:36:27.563464Z [info ] stdlib_log  [ddtrace.sampler] message=initialized RateSampler, sample 100.0% of traces request_id=0239925bfd9c4558bce0aa5184d8717e
  4396. 2019-03-08T18:36:27.570534Z [debug ] stdlib_log  [ddtrace.writer] message=resetting queues. pids(old:None new:68) request_id=0239925bfd9c4558bce0aa5184d8717e
  4397. 2019-03-08T18:36:27.570798Z [debug ] stdlib_log  [ddtrace.writer] message=starting flush thread request_id=0239925bfd9c4558bce0aa5184d8717e
  4398. 2019-03-08T18:36:27.943306Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  4399. 2019-03-08T18:36:28.580730Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  4400. 2019-03-08T18:36:28.585193Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  4401. 2019-03-08T18:36:29.021559Z [debug ] stdlib_log  [userapp] message=Calling post http://localhost:8080/v1/user.save with headers {'Content-Type': 'application/json', 'Authorization': 'Basic T3U5NzJ0bzVIUDRQbTE4c0VZUEt1UTo='} and body {"first_name": "Test", "last_name": "Testovac", "email_verified": true, "login": "testuser@example.com", "password": "MadladPwd42", "properties": {"currency": {"value": "usd"}, "language": {"value": "en"}}} request_id=0239925bfd9c4558bce0aa5184d8717e
  4402. 2019-03-08T18:36:29.023650Z [debug ] stdlib_log  [urllib3.connectionpool] message=Starting new HTTP connection (1): localhost request_id=0239925bfd9c4558bce0aa5184d8717e
  4403. 2019-03-08T18:36:29.473260Z [debug ] stdlib_log  [urllib3.connectionpool] message=http://localhost:8080 "POST /v1/user.save HTTP/1.1" 200 446 request_id=0239925bfd9c4558bce0aa5184d8717e
  4404. 2019-03-08T18:36:29.478078Z [debug ] stdlib_log  [userapp] message=Recieved response={
  4405. "brand": "kiwicom",
  4406. "created_at": 1552070189.050981,
  4407. "email": "testuser@example.com",
  4408. "email_verified": true,
  4409. "first_name": "Test",
  4410. "last_login_at": null,
  4411. "last_name": "Testovac",
  4412. "locks": [],
  4413. "login": "testuser@example.com",
  4414. "properties": {
  4415. "currency": {
  4416. "value": "usd"
  4417. },
  4418. "language": {
  4419. "value": "en"
  4420. }
  4421. },
  4422. "updated_at": 1552070189.050989,
  4423. "user_id": "wW1figPNE3siPYz9avjWw_"
  4424. }
  4425.  request_id=0239925bfd9c4558bce0aa5184d8717e
  4426. 2019-03-08T18:36:29.479908Z [debug ] stdlib_log  [userapp] message=Calling post http://localhost:8080/v1/user.login with headers {'Content-Type': 'application/json', 'Authorization': 'Basic T3U5NzJ0bzVIUDRQbTE4c0VZUEt1UTo='} and body {"login": "testuser@example.com", "password": "MadladPwd42"} request_id=0239925bfd9c4558bce0aa5184d8717e
  4427. 2019-03-08T18:36:29.488181Z [debug ] stdlib_log  [urllib3.connectionpool] message=Starting new HTTP connection (1): localhost request_id=0239925bfd9c4558bce0aa5184d8717e
  4428. Traceback (most recent call last):
  4429. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 484, in connect
  4430. sock = self._connect()
  4431. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 541, in _connect
  4432. raise err
  4433. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 529, in _connect
  4434. sock.connect(socket_address)
  4435. File "/usr/local/lib/python3.6/site-packages/gevent/_socket3.py", line 307, in connect
  4436. raise error(result, strerror(result))
  4437. OSError: [Errno 99] Address not available
  4438.  
  4439. During handling of the above exception, another exception occurred:
  4440.  
  4441. Traceback (most recent call last):
  4442. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 667, in execute_command
  4443. connection.send_command(*args)
  4444. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 610, in send_command
  4445. self.send_packed_command(self.pack_command(*args))
  4446. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 585, in send_packed_command
  4447. self.connect()
  4448. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 489, in connect
  4449. raise ConnectionError(self._error_message(e))
  4450. redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  4451.  
  4452. During handling of the above exception, another exception occurred:
  4453.  
  4454. Traceback (most recent call last):
  4455. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 484, in connect
  4456. sock = self._connect()
  4457. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 541, in _connect
  4458. raise err
  4459. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 529, in _connect
  4460. sock.connect(socket_address)
  4461. File "/usr/local/lib/python3.6/site-packages/gevent/_socket3.py", line 307, in connect
  4462. raise error(result, strerror(result))
  4463. OSError: [Errno 99] Address not available
  4464.  
  4465. During handling of the above exception, another exception occurred:
  4466.  
  4467. Traceback (most recent call last):
  4468. File "/usr/local/lib/python3.6/wsgiref/handlers.py", line 137, in run
  4469. self.result = application(self.environ, self.start_response)
  4470. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1997, in __call__
  4471. return self.wsgi_app(environ, start_response)
  4472. File "/usr/src/app/auth/middleware.py", line 57, in __call__
  4473. retval = self.app(environ, custom_start_response)
  4474. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1985, in wsgi_app
  4475. response = self.handle_exception(e)
  4476. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1540, in handle_exception
  4477. reraise(exc_type, exc_value, tb)
  4478. File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
  4479. raise value
  4480. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
  4481. response = self.full_dispatch_request()
  4482. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
  4483. rv = self.handle_user_exception(e)
  4484. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
  4485. reraise(exc_type, exc_value, tb)
  4486. File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
  4487. raise value
  4488. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request
  4489. rv = self.dispatch_request()
  4490. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request
  4491. return self.view_functions[rule.endpoint](**req.view_args)
  4492. File "/usr/src/packages/flask-jsonschemer/flask_jsonschemer.py", line 71, in decorated
  4493. return fn(*args, **kwargs)
  4494. File "/usr/src/app/auth/token/decorators.py", line 38, in decorated
  4495. return f(*args, **kwargs)
  4496. File "/usr/src/app/auth/views.py", line 139, in login
  4497. check_block(user_json["login"])
  4498. File "/usr/src/app/auth/utils.py", line 26, in check_block
  4499. if int(kvstore.get(key)) >= current_app.config["INVALID_LOGIN_ATTEMPTS"]:
  4500. File "/usr/local/lib/python3.6/site-packages/simplekv/decorator.py", line 52, in get
  4501. return self._dstore.get(self._map_key(key), *args, **kwargs)
  4502. File "/usr/local/lib/python3.6/site-packages/simplekv/__init__.py", line 75, in get
  4503. return self._get(key)
  4504. File "/usr/local/lib/python3.6/site-packages/simplekv/memory/redisstore.py", line 31, in _get
  4505. val = self.redis.get(key)
  4506. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 976, in get
  4507. return self.execute_command('GET', name)
  4508. File "/usr/local/lib/python3.6/site-packages/ddtrace/contrib/redis/patch.py", line 58, in traced_execute_command
  4509. return func(*args, **kwargs)
  4510. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 673, in execute_command
  4511. connection.send_command(*args)
  4512. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 610, in send_command
  4513. self.send_packed_command(self.pack_command(*args))
  4514. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 585, in send_packed_command
  4515. self.connect()
  4516. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 489, in connect
  4517. raise ConnectionError(self._error_message(e))
  4518. redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  4519. 2019-03-08T18:36:29.542618Z [debug ] stdlib_log  [urllib3.connectionpool] message=http://localhost:8080 "POST /v1/user.login HTTP/1.1" 500 59 request_id=0239925bfd9c4558bce0aa5184d8717e
  4520. 2019-03-08T18:36:29.545328Z [debug ] stdlib_log  [userapp] message=Recieved response=A server error occurred. Please contact the administrator. request_id=0239925bfd9c4558bce0aa5184d8717e
  4521. 2019-03-08T18:36:29.589971Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  4522. 2019-03-08T18:36:29.592174Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  4523. ______________ AuthTestCase.test_login_user_login_upper_passsword ______________
  4524.  
  4525. self = <tests.test_user.AuthTestCase testMethod=test_login_user_login_upper_passsword>
  4526.  
  4527. def test_login_user_login_upper_passsword(self):
  4528. self.api.user.save(**self.USER_DATA)
  4529. > resp = self.api.user.login(login=self.USER_DATA["login"].upper(), password=self.USER_DATA["password"])
  4530.  
  4531. tests/test_user.py:181:
  4532. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  4533. ../packages/userapp/userapp/__init__.py:325: in __call__
  4534. return self._client.call(self._version, self._parent._service_name, self._method_name, kwargs)
  4535. ../packages/userapp/userapp/__init__.py:245: in call
  4536. result = DictionaryUtility.to_object(response.json())
  4537. /usr/local/lib/python3.6/site-packages/requests/models.py:892: in json
  4538. return complexjson.loads(self.text, **kwargs)
  4539. /usr/local/lib/python3.6/site-packages/simplejson/__init__.py:518: in loads
  4540. return _default_decoder.decode(s)
  4541. /usr/local/lib/python3.6/site-packages/simplejson/decoder.py:370: in decode
  4542. obj, end = self.raw_decode(s)
  4543. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  4544.  
  4545. self = <simplejson.decoder.JSONDecoder object at 0x7f794e0da0b8>
  4546. s = 'A server error occurred. Please contact the administrator.', idx = 0
  4547. _w = <built-in method match of _sre.SRE_Pattern object at 0x7f79550f4e70>
  4548. _PY3 = True
  4549.  
  4550. def raw_decode(self, s, idx=0, _w=WHITESPACE.match, _PY3=PY3):
  4551. """Decode a JSON document from ``s`` (a ``str`` or ``unicode``
  4552. beginning with a JSON document) and return a 2-tuple of the Python
  4553. representation and the index in ``s`` where the document ended.
  4554. Optionally, ``idx`` can be used to specify an offset in ``s`` where
  4555. the JSON document begins.
  4556.  
  4557. This can be used to decode a JSON document from a string that may
  4558. have extraneous data at the end.
  4559.  
  4560. """
  4561. if idx < 0:
  4562. # Ensure that raw_decode bails on negative indexes, the regex
  4563. # would otherwise mask this behavior. #98
  4564. raise JSONDecodeError('Expecting value', s, idx)
  4565. if _PY3 and not isinstance(s, text_type):
  4566. raise TypeError("Input string must be text, not bytes")
  4567. # strip UTF-8 bom
  4568. if len(s) > idx:
  4569. ord0 = ord(s[idx])
  4570. if ord0 == 0xfeff:
  4571. idx += 1
  4572. elif ord0 == 0xef and s[idx:idx + 3] == '\xef\xbb\xbf':
  4573. idx += 3
  4574. > return self.scan_once(s, idx=_w(s, idx).end())
  4575. E simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
  4576.  
  4577. /usr/local/lib/python3.6/site-packages/simplejson/decoder.py:400: JSONDecodeError
  4578. ----------------------------- Captured stdout call -----------------------------
  4579. 2019-03-08T18:36:31.554304Z [info ] request  client_addr=127.0.0.1 forwarding= json={'first_name': 'Test', 'last_name': 'Testovac', 'email_verified': True, 'login': 'testuser@example.com', 'password': 'MadladPwd42', 'properties': {'currency': {'value': 'usd'}, 'language': {'value': 'en'}}} method=POST path=/v1/user.save request_id=7262b4712e064b9daea06990d927c503
  4580. 2019-03-08T18:36:31.889477Z [info ] response  length=446 request_id=7262b4712e064b9daea06990d927c503 status=200
  4581. 2019-03-08T18:36:31.894780Z [info ] request  client_addr=127.0.0.1 forwarding= json={'login': 'TESTUSER@EXAMPLE.COM', 'password': 'MadladPwd42'} method=POST path=/v1/user.login request_id=e2846785fe464d9cbcfc94acb3add907
  4582. ----------------------------- Captured stderr call -----------------------------
  4583. 2019-03-08T18:36:30.220239Z [debug ] stdlib_log  [ddtrace.encoding] message=using Msgpack encoder request_id=0239925bfd9c4558bce0aa5184d8717e
  4584. 2019-03-08T18:36:30.220589Z [info ] stdlib_log  [ddtrace.sampler] message=initialized RateSampler, sample 100.0% of traces request_id=0239925bfd9c4558bce0aa5184d8717e
  4585. 2019-03-08T18:36:30.226918Z [debug ] stdlib_log  [ddtrace.writer] message=resetting queues. pids(old:None new:68) request_id=0239925bfd9c4558bce0aa5184d8717e
  4586. 2019-03-08T18:36:30.227196Z [debug ] stdlib_log  [ddtrace.writer] message=starting flush thread request_id=0239925bfd9c4558bce0aa5184d8717e
  4587. 2019-03-08T18:36:30.598113Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  4588. 2019-03-08T18:36:31.230359Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  4589. 2019-03-08T18:36:31.232207Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  4590. 2019-03-08T18:36:31.546606Z [debug ] stdlib_log  [userapp] message=Calling post http://localhost:8080/v1/user.save with headers {'Content-Type': 'application/json', 'Authorization': 'Basic YkJFNVc3VkRCYXpocGNsWi1ZQWl2WDo='} and body {"first_name": "Test", "last_name": "Testovac", "email_verified": true, "login": "testuser@example.com", "password": "MadladPwd42", "properties": {"currency": {"value": "usd"}, "language": {"value": "en"}}} request_id=0239925bfd9c4558bce0aa5184d8717e
  4591. 2019-03-08T18:36:31.551480Z [debug ] stdlib_log  [urllib3.connectionpool] message=Starting new HTTP connection (1): localhost request_id=0239925bfd9c4558bce0aa5184d8717e
  4592. 2019-03-08T18:36:31.890333Z [debug ] stdlib_log  [urllib3.connectionpool] message=http://localhost:8080 "POST /v1/user.save HTTP/1.1" 200 446 request_id=0239925bfd9c4558bce0aa5184d8717e
  4593. 2019-03-08T18:36:31.891270Z [debug ] stdlib_log  [userapp] message=Recieved response={
  4594. "brand": "kiwicom",
  4595. "created_at": 1552070191.578137,
  4596. "email": "testuser@example.com",
  4597. "email_verified": true,
  4598. "first_name": "Test",
  4599. "last_login_at": null,
  4600. "last_name": "Testovac",
  4601. "locks": [],
  4602. "login": "testuser@example.com",
  4603. "properties": {
  4604. "currency": {
  4605. "value": "usd"
  4606. },
  4607. "language": {
  4608. "value": "en"
  4609. }
  4610. },
  4611. "updated_at": 1552070191.578144,
  4612. "user_id": "vQ8ZghKf39qkguKMxSh10p"
  4613. }
  4614.  request_id=0239925bfd9c4558bce0aa5184d8717e
  4615. 2019-03-08T18:36:31.891671Z [debug ] stdlib_log  [userapp] message=Calling post http://localhost:8080/v1/user.login with headers {'Content-Type': 'application/json', 'Authorization': 'Basic YkJFNVc3VkRCYXpocGNsWi1ZQWl2WDo='} and body {"login": "TESTUSER@EXAMPLE.COM", "password": "MadladPwd42"} request_id=0239925bfd9c4558bce0aa5184d8717e
  4616. 2019-03-08T18:36:31.893286Z [debug ] stdlib_log  [urllib3.connectionpool] message=Starting new HTTP connection (1): localhost request_id=0239925bfd9c4558bce0aa5184d8717e
  4617. Traceback (most recent call last):
  4618. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 484, in connect
  4619. sock = self._connect()
  4620. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 541, in _connect
  4621. raise err
  4622. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 529, in _connect
  4623. sock.connect(socket_address)
  4624. File "/usr/local/lib/python3.6/site-packages/gevent/_socket3.py", line 307, in connect
  4625. raise error(result, strerror(result))
  4626. OSError: [Errno 99] Address not available
  4627.  
  4628. During handling of the above exception, another exception occurred:
  4629.  
  4630. Traceback (most recent call last):
  4631. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 667, in execute_command
  4632. connection.send_command(*args)
  4633. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 610, in send_command
  4634. self.send_packed_command(self.pack_command(*args))
  4635. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 585, in send_packed_command
  4636. self.connect()
  4637. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 489, in connect
  4638. raise ConnectionError(self._error_message(e))
  4639. redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  4640.  
  4641. During handling of the above exception, another exception occurred:
  4642.  
  4643. Traceback (most recent call last):
  4644. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 484, in connect
  4645. sock = self._connect()
  4646. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 541, in _connect
  4647. raise err
  4648. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 529, in _connect
  4649. sock.connect(socket_address)
  4650. File "/usr/local/lib/python3.6/site-packages/gevent/_socket3.py", line 307, in connect
  4651. raise error(result, strerror(result))
  4652. OSError: [Errno 99] Address not available
  4653.  
  4654. During handling of the above exception, another exception occurred:
  4655.  
  4656. Traceback (most recent call last):
  4657. File "/usr/local/lib/python3.6/wsgiref/handlers.py", line 137, in run
  4658. self.result = application(self.environ, self.start_response)
  4659. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1997, in __call__
  4660. return self.wsgi_app(environ, start_response)
  4661. File "/usr/src/app/auth/middleware.py", line 57, in __call__
  4662. retval = self.app(environ, custom_start_response)
  4663. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1985, in wsgi_app
  4664. response = self.handle_exception(e)
  4665. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1540, in handle_exception
  4666. reraise(exc_type, exc_value, tb)
  4667. File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
  4668. raise value
  4669. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
  4670. response = self.full_dispatch_request()
  4671. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
  4672. rv = self.handle_user_exception(e)
  4673. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
  4674. reraise(exc_type, exc_value, tb)
  4675. File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
  4676. raise value
  4677. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request
  4678. rv = self.dispatch_request()
  4679. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request
  4680. return self.view_functions[rule.endpoint](**req.view_args)
  4681. File "/usr/src/packages/flask-jsonschemer/flask_jsonschemer.py", line 71, in decorated
  4682. return fn(*args, **kwargs)
  4683. File "/usr/src/app/auth/token/decorators.py", line 38, in decorated
  4684. return f(*args, **kwargs)
  4685. File "/usr/src/app/auth/views.py", line 139, in login
  4686. check_block(user_json["login"])
  4687. File "/usr/src/app/auth/utils.py", line 26, in check_block
  4688. if int(kvstore.get(key)) >= current_app.config["INVALID_LOGIN_ATTEMPTS"]:
  4689. File "/usr/local/lib/python3.6/site-packages/simplekv/decorator.py", line 52, in get
  4690. return self._dstore.get(self._map_key(key), *args, **kwargs)
  4691. File "/usr/local/lib/python3.6/site-packages/simplekv/__init__.py", line 75, in get
  4692. return self._get(key)
  4693. File "/usr/local/lib/python3.6/site-packages/simplekv/memory/redisstore.py", line 31, in _get
  4694. val = self.redis.get(key)
  4695. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 976, in get
  4696. return self.execute_command('GET', name)
  4697. File "/usr/local/lib/python3.6/site-packages/ddtrace/contrib/redis/patch.py", line 58, in traced_execute_command
  4698. return func(*args, **kwargs)
  4699. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 673, in execute_command
  4700. connection.send_command(*args)
  4701. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 610, in send_command
  4702. self.send_packed_command(self.pack_command(*args))
  4703. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 585, in send_packed_command
  4704. self.connect()
  4705. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 489, in connect
  4706. raise ConnectionError(self._error_message(e))
  4707. redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  4708. 2019-03-08T18:36:31.902663Z [debug ] stdlib_log  [urllib3.connectionpool] message=http://localhost:8080 "POST /v1/user.login HTTP/1.1" 500 59 request_id=0239925bfd9c4558bce0aa5184d8717e
  4709. 2019-03-08T18:36:31.903494Z [debug ] stdlib_log  [userapp] message=Recieved response=A server error occurred. Please contact the administrator. request_id=0239925bfd9c4558bce0aa5184d8717e
  4710. 2019-03-08T18:36:32.239045Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  4711. 2019-03-08T18:36:32.243158Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  4712. ________________ AuthTestCase.test_login_user_too_many_invalids ________________
  4713.  
  4714. self = <tests.test_user.AuthTestCase testMethod=test_login_user_too_many_invalids>
  4715.  
  4716. def test_login_user_too_many_invalids(self):
  4717. self.app.config["INVALID_LOGIN_ATTEMPTS"] = 2
  4718. with self.assertRaises(userapp.UserAppServiceException):
  4719. > self.api.user.login(login="testuser2@example.com", password=self.USER_DATA["password"])
  4720.  
  4721. tests/test_user.py:202:
  4722. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  4723. ../packages/userapp/userapp/__init__.py:325: in __call__
  4724. return self._client.call(self._version, self._parent._service_name, self._method_name, kwargs)
  4725. ../packages/userapp/userapp/__init__.py:245: in call
  4726. result = DictionaryUtility.to_object(response.json())
  4727. /usr/local/lib/python3.6/site-packages/requests/models.py:892: in json
  4728. return complexjson.loads(self.text, **kwargs)
  4729. /usr/local/lib/python3.6/site-packages/simplejson/__init__.py:518: in loads
  4730. return _default_decoder.decode(s)
  4731. /usr/local/lib/python3.6/site-packages/simplejson/decoder.py:370: in decode
  4732. obj, end = self.raw_decode(s)
  4733. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  4734.  
  4735. def raw_decode(self, s, idx=0, _w=WHITESPACE.match, _PY3=PY3):
  4736. """Decode a JSON document from ``s`` (a ``str`` or ``unicode``
  4737. beginning with a JSON document) and return a 2-tuple of the Python
  4738. representation and the index in ``s`` where the document ended.
  4739. Optionally, ``idx`` can be used to specify an offset in ``s`` where
  4740. the JSON document begins.
  4741.  
  4742. This can be used to decode a JSON document from a string that may
  4743. have extraneous data at the end.
  4744.  
  4745. """
  4746. if idx < 0:
  4747. # Ensure that raw_decode bails on negative indexes, the regex
  4748. # would otherwise mask this behavior. #98
  4749. raise JSONDecodeError('Expecting value', s, idx)
  4750. if _PY3 and not isinstance(s, text_type):
  4751. raise TypeError("Input string must be text, not bytes")
  4752. # strip UTF-8 bom
  4753. if len(s) > idx:
  4754. ord0 = ord(s[idx])
  4755. if ord0 == 0xfeff:
  4756. idx += 1
  4757. elif ord0 == 0xef and s[idx:idx + 3] == '\xef\xbb\xbf':
  4758. idx += 3
  4759. > return self.scan_once(s, idx=_w(s, idx).end())
  4760. E simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
  4761.  
  4762. /usr/local/lib/python3.6/site-packages/simplejson/decoder.py:400: JSONDecodeError
  4763. ----------------------------- Captured stdout call -----------------------------
  4764. 2019-03-08T18:36:33.876314Z [info ] request  client_addr=127.0.0.1 forwarding= json={'login': 'testuser2@example.com', 'password': 'MadladPwd42'} method=POST path=/v1/user.login request_id=a4ccec4715164d008ba5369a3edf85fa
  4765. ----------------------------- Captured stderr call -----------------------------
  4766. 2019-03-08T18:36:32.553276Z [debug ] stdlib_log  [ddtrace.encoding] message=using Msgpack encoder request_id=0239925bfd9c4558bce0aa5184d8717e
  4767. 2019-03-08T18:36:32.553532Z [info ] stdlib_log  [ddtrace.sampler] message=initialized RateSampler, sample 100.0% of traces request_id=0239925bfd9c4558bce0aa5184d8717e
  4768. 2019-03-08T18:36:32.558520Z [debug ] stdlib_log  [ddtrace.writer] message=resetting queues. pids(old:None new:68) request_id=0239925bfd9c4558bce0aa5184d8717e
  4769. 2019-03-08T18:36:32.558760Z [debug ] stdlib_log  [ddtrace.writer] message=starting flush thread request_id=0239925bfd9c4558bce0aa5184d8717e
  4770. 2019-03-08T18:36:33.565693Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  4771. 2019-03-08T18:36:33.569834Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  4772. 2019-03-08T18:36:33.865413Z [debug ] stdlib_log  [userapp] message=Calling post http://localhost:8080/v1/user.login with headers {'Content-Type': 'application/json', 'Authorization': 'Basic U1dWWXVyVU9fUkFhZUpVZ3JKeldOUjo='} and body {"login": "testuser2@example.com", "password": "MadladPwd42"} request_id=0239925bfd9c4558bce0aa5184d8717e
  4773. 2019-03-08T18:36:33.871389Z [debug ] stdlib_log  [urllib3.connectionpool] message=Starting new HTTP connection (1): localhost request_id=0239925bfd9c4558bce0aa5184d8717e
  4774. Traceback (most recent call last):
  4775. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 484, in connect
  4776. sock = self._connect()
  4777. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 541, in _connect
  4778. raise err
  4779. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 529, in _connect
  4780. sock.connect(socket_address)
  4781. File "/usr/local/lib/python3.6/site-packages/gevent/_socket3.py", line 307, in connect
  4782. raise error(result, strerror(result))
  4783. OSError: [Errno 99] Address not available
  4784.  
  4785. During handling of the above exception, another exception occurred:
  4786.  
  4787. Traceback (most recent call last):
  4788. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 667, in execute_command
  4789. connection.send_command(*args)
  4790. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 610, in send_command
  4791. self.send_packed_command(self.pack_command(*args))
  4792. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 585, in send_packed_command
  4793. self.connect()
  4794. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 489, in connect
  4795. raise ConnectionError(self._error_message(e))
  4796. redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  4797.  
  4798. During handling of the above exception, another exception occurred:
  4799.  
  4800. Traceback (most recent call last):
  4801. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 484, in connect
  4802. sock = self._connect()
  4803. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 541, in _connect
  4804. raise err
  4805. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 529, in _connect
  4806. sock.connect(socket_address)
  4807. File "/usr/local/lib/python3.6/site-packages/gevent/_socket3.py", line 307, in connect
  4808. raise error(result, strerror(result))
  4809. OSError: [Errno 99] Address not available
  4810.  
  4811. During handling of the above exception, another exception occurred:
  4812.  
  4813. Traceback (most recent call last):
  4814. File "/usr/local/lib/python3.6/wsgiref/handlers.py", line 137, in run
  4815. self.result = application(self.environ, self.start_response)
  4816. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1997, in __call__
  4817. return self.wsgi_app(environ, start_response)
  4818. File "/usr/src/app/auth/middleware.py", line 57, in __call__
  4819. retval = self.app(environ, custom_start_response)
  4820. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1985, in wsgi_app
  4821. response = self.handle_exception(e)
  4822. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1540, in handle_exception
  4823. reraise(exc_type, exc_value, tb)
  4824. File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
  4825. raise value
  4826. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
  4827. response = self.full_dispatch_request()
  4828. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
  4829. rv = self.handle_user_exception(e)
  4830. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
  4831. reraise(exc_type, exc_value, tb)
  4832. File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
  4833. raise value
  4834. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request
  4835. rv = self.dispatch_request()
  4836. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request
  4837. return self.view_functions[rule.endpoint](**req.view_args)
  4838. File "/usr/src/packages/flask-jsonschemer/flask_jsonschemer.py", line 71, in decorated
  4839. return fn(*args, **kwargs)
  4840. File "/usr/src/app/auth/token/decorators.py", line 38, in decorated
  4841. return f(*args, **kwargs)
  4842. File "/usr/src/app/auth/views.py", line 139, in login
  4843. check_block(user_json["login"])
  4844. File "/usr/src/app/auth/utils.py", line 26, in check_block
  4845. if int(kvstore.get(key)) >= current_app.config["INVALID_LOGIN_ATTEMPTS"]:
  4846. File "/usr/local/lib/python3.6/site-packages/simplekv/decorator.py", line 52, in get
  4847. return self._dstore.get(self._map_key(key), *args, **kwargs)
  4848. File "/usr/local/lib/python3.6/site-packages/simplekv/__init__.py", line 75, in get
  4849. return self._get(key)
  4850. File "/usr/local/lib/python3.6/site-packages/simplekv/memory/redisstore.py", line 31, in _get
  4851. val = self.redis.get(key)
  4852. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 976, in get
  4853. return self.execute_command('GET', name)
  4854. File "/usr/local/lib/python3.6/site-packages/ddtrace/contrib/redis/patch.py", line 58, in traced_execute_command
  4855. return func(*args, **kwargs)
  4856. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 673, in execute_command
  4857. connection.send_command(*args)
  4858. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 610, in send_command
  4859. self.send_packed_command(self.pack_command(*args))
  4860. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 585, in send_packed_command
  4861. self.connect()
  4862. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 489, in connect
  4863. raise ConnectionError(self._error_message(e))
  4864. redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  4865. 2019-03-08T18:36:33.897165Z [debug ] stdlib_log  [urllib3.connectionpool] message=http://localhost:8080 "POST /v1/user.login HTTP/1.1" 500 59 request_id=0239925bfd9c4558bce0aa5184d8717e
  4866. 2019-03-08T18:36:33.898532Z [debug ] stdlib_log  [userapp] message=Recieved response=A server error occurred. Please contact the administrator. request_id=0239925bfd9c4558bce0aa5184d8717e
  4867. ________________________ AuthTestCase.test_logout_user _________________________
  4868.  
  4869. self = <tests.test_user.AuthTestCase testMethod=test_logout_user>
  4870.  
  4871. def test_logout_user(self):
  4872. self.api.user.save(**self.USER_DATA)
  4873. > self.api.user.login(login=self.USER_DATA["login"], password=self.USER_DATA["password"])
  4874.  
  4875. tests/test_user.py:219:
  4876. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  4877. ../packages/userapp/userapp/__init__.py:325: in __call__
  4878. return self._client.call(self._version, self._parent._service_name, self._method_name, kwargs)
  4879. ../packages/userapp/userapp/__init__.py:245: in call
  4880. result = DictionaryUtility.to_object(response.json())
  4881. /usr/local/lib/python3.6/site-packages/requests/models.py:892: in json
  4882. return complexjson.loads(self.text, **kwargs)
  4883. /usr/local/lib/python3.6/site-packages/simplejson/__init__.py:518: in loads
  4884. return _default_decoder.decode(s)
  4885. /usr/local/lib/python3.6/site-packages/simplejson/decoder.py:370: in decode
  4886. obj, end = self.raw_decode(s)
  4887. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  4888.  
  4889. self = <simplejson.decoder.JSONDecoder object at 0x7f794e0da0b8>
  4890. s = 'A server error occurred. Please contact the administrator.', idx = 0
  4891. _w = <built-in method match of _sre.SRE_Pattern object at 0x7f79550f4e70>
  4892. _PY3 = True
  4893.  
  4894. def raw_decode(self, s, idx=0, _w=WHITESPACE.match, _PY3=PY3):
  4895. """Decode a JSON document from ``s`` (a ``str`` or ``unicode``
  4896. beginning with a JSON document) and return a 2-tuple of the Python
  4897. representation and the index in ``s`` where the document ended.
  4898. Optionally, ``idx`` can be used to specify an offset in ``s`` where
  4899. the JSON document begins.
  4900.  
  4901. This can be used to decode a JSON document from a string that may
  4902. have extraneous data at the end.
  4903.  
  4904. """
  4905. if idx < 0:
  4906. # Ensure that raw_decode bails on negative indexes, the regex
  4907. # would otherwise mask this behavior. #98
  4908. raise JSONDecodeError('Expecting value', s, idx)
  4909. if _PY3 and not isinstance(s, text_type):
  4910. raise TypeError("Input string must be text, not bytes")
  4911. # strip UTF-8 bom
  4912. if len(s) > idx:
  4913. ord0 = ord(s[idx])
  4914. if ord0 == 0xfeff:
  4915. idx += 1
  4916. elif ord0 == 0xef and s[idx:idx + 3] == '\xef\xbb\xbf':
  4917. idx += 3
  4918. > return self.scan_once(s, idx=_w(s, idx).end())
  4919. E simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
  4920.  
  4921. /usr/local/lib/python3.6/site-packages/simplejson/decoder.py:400: JSONDecodeError
  4922. ----------------------------- Captured stdout call -----------------------------
  4923. 2019-03-08T18:36:35.934802Z [info ] request  client_addr=127.0.0.1 forwarding= json={'first_name': 'Test', 'last_name': 'Testovac', 'email_verified': True, 'login': 'testuser@example.com', 'password': 'MadladPwd42', 'properties': {'currency': {'value': 'usd'}, 'language': {'value': 'en'}}} method=POST path=/v1/user.save request_id=6f37cec1e96645a7bb2de22abf91b3f5
  4924. 2019-03-08T18:36:36.303560Z [info ] response  length=446 request_id=6f37cec1e96645a7bb2de22abf91b3f5 status=200
  4925. 2019-03-08T18:36:36.311405Z [info ] request  client_addr=127.0.0.1 forwarding= json={'login': 'testuser@example.com', 'password': 'MadladPwd42'} method=POST path=/v1/user.login request_id=ee1e2fe5ad0c4519bc8e54b2dae8334b
  4926. ----------------------------- Captured stderr call -----------------------------
  4927. 2019-03-08T18:36:34.648640Z [debug ] stdlib_log  [ddtrace.encoding] message=using Msgpack encoder request_id=0239925bfd9c4558bce0aa5184d8717e
  4928. 2019-03-08T18:36:34.648914Z [info ] stdlib_log  [ddtrace.sampler] message=initialized RateSampler, sample 100.0% of traces request_id=0239925bfd9c4558bce0aa5184d8717e
  4929. 2019-03-08T18:36:34.654580Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  4930. 2019-03-08T18:36:34.655944Z [debug ] stdlib_log  [ddtrace.writer] message=resetting queues. pids(old:None new:68) request_id=0239925bfd9c4558bce0aa5184d8717e
  4931. 2019-03-08T18:36:34.656308Z [debug ] stdlib_log  [ddtrace.writer] message=starting flush thread request_id=0239925bfd9c4558bce0aa5184d8717e
  4932. 2019-03-08T18:36:34.657212Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  4933. 2019-03-08T18:36:35.658979Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  4934. 2019-03-08T18:36:35.660166Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  4935. 2019-03-08T18:36:35.929879Z [debug ] stdlib_log  [userapp] message=Calling post http://localhost:8080/v1/user.save with headers {'Content-Type': 'application/json', 'Authorization': 'Basic OXRWUUp4UGxKUDBWMzlHM0FBblgxMzo='} and body {"first_name": "Test", "last_name": "Testovac", "email_verified": true, "login": "testuser@example.com", "password": "MadladPwd42", "properties": {"currency": {"value": "usd"}, "language": {"value": "en"}}} request_id=0239925bfd9c4558bce0aa5184d8717e
  4936. 2019-03-08T18:36:35.932503Z [debug ] stdlib_log  [urllib3.connectionpool] message=Starting new HTTP connection (1): localhost request_id=0239925bfd9c4558bce0aa5184d8717e
  4937. 2019-03-08T18:36:36.304955Z [debug ] stdlib_log  [urllib3.connectionpool] message=http://localhost:8080 "POST /v1/user.save HTTP/1.1" 200 446 request_id=0239925bfd9c4558bce0aa5184d8717e
  4938. 2019-03-08T18:36:36.306509Z [debug ] stdlib_log  [userapp] message=Recieved response={
  4939. "brand": "kiwicom",
  4940. "created_at": 1552070195.953555,
  4941. "email": "testuser@example.com",
  4942. "email_verified": true,
  4943. "first_name": "Test",
  4944. "last_login_at": null,
  4945. "last_name": "Testovac",
  4946. "locks": [],
  4947. "login": "testuser@example.com",
  4948. "properties": {
  4949. "currency": {
  4950. "value": "usd"
  4951. },
  4952. "language": {
  4953. "value": "en"
  4954. }
  4955. },
  4956. "updated_at": 1552070195.953562,
  4957. "user_id": "3QaPEJk5cq33s2xSw_NWv9"
  4958. }
  4959.  request_id=0239925bfd9c4558bce0aa5184d8717e
  4960. 2019-03-08T18:36:36.307192Z [debug ] stdlib_log  [userapp] message=Calling post http://localhost:8080/v1/user.login with headers {'Content-Type': 'application/json', 'Authorization': 'Basic OXRWUUp4UGxKUDBWMzlHM0FBblgxMzo='} and body {"login": "testuser@example.com", "password": "MadladPwd42"} request_id=0239925bfd9c4558bce0aa5184d8717e
  4961. 2019-03-08T18:36:36.309655Z [debug ] stdlib_log  [urllib3.connectionpool] message=Starting new HTTP connection (1): localhost request_id=0239925bfd9c4558bce0aa5184d8717e
  4962. Traceback (most recent call last):
  4963. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 484, in connect
  4964. sock = self._connect()
  4965. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 541, in _connect
  4966. raise err
  4967. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 529, in _connect
  4968. sock.connect(socket_address)
  4969. File "/usr/local/lib/python3.6/site-packages/gevent/_socket3.py", line 307, in connect
  4970. raise error(result, strerror(result))
  4971. OSError: [Errno 99] Address not available
  4972.  
  4973. During handling of the above exception, another exception occurred:
  4974.  
  4975. Traceback (most recent call last):
  4976. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 667, in execute_command
  4977. connection.send_command(*args)
  4978. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 610, in send_command
  4979. self.send_packed_command(self.pack_command(*args))
  4980. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 585, in send_packed_command
  4981. self.connect()
  4982. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 489, in connect
  4983. raise ConnectionError(self._error_message(e))
  4984. redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  4985.  
  4986. During handling of the above exception, another exception occurred:
  4987.  
  4988. Traceback (most recent call last):
  4989. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 484, in connect
  4990. sock = self._connect()
  4991. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 541, in _connect
  4992. raise err
  4993. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 529, in _connect
  4994. sock.connect(socket_address)
  4995. File "/usr/local/lib/python3.6/site-packages/gevent/_socket3.py", line 307, in connect
  4996. raise error(result, strerror(result))
  4997. OSError: [Errno 99] Address not available
  4998.  
  4999. During handling of the above exception, another exception occurred:
  5000.  
  5001. Traceback (most recent call last):
  5002. File "/usr/local/lib/python3.6/wsgiref/handlers.py", line 137, in run
  5003. self.result = application(self.environ, self.start_response)
  5004. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1997, in __call__
  5005. return self.wsgi_app(environ, start_response)
  5006. File "/usr/src/app/auth/middleware.py", line 57, in __call__
  5007. retval = self.app(environ, custom_start_response)
  5008. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1985, in wsgi_app
  5009. response = self.handle_exception(e)
  5010. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1540, in handle_exception
  5011. reraise(exc_type, exc_value, tb)
  5012. File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
  5013. raise value
  5014. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
  5015. response = self.full_dispatch_request()
  5016. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
  5017. rv = self.handle_user_exception(e)
  5018. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
  5019. reraise(exc_type, exc_value, tb)
  5020. File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
  5021. raise value
  5022. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request
  5023. rv = self.dispatch_request()
  5024. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request
  5025. return self.view_functions[rule.endpoint](**req.view_args)
  5026. File "/usr/src/packages/flask-jsonschemer/flask_jsonschemer.py", line 71, in decorated
  5027. return fn(*args, **kwargs)
  5028. File "/usr/src/app/auth/token/decorators.py", line 38, in decorated
  5029. return f(*args, **kwargs)
  5030. File "/usr/src/app/auth/views.py", line 139, in login
  5031. check_block(user_json["login"])
  5032. File "/usr/src/app/auth/utils.py", line 26, in check_block
  5033. if int(kvstore.get(key)) >= current_app.config["INVALID_LOGIN_ATTEMPTS"]:
  5034. File "/usr/local/lib/python3.6/site-packages/simplekv/decorator.py", line 52, in get
  5035. return self._dstore.get(self._map_key(key), *args, **kwargs)
  5036. File "/usr/local/lib/python3.6/site-packages/simplekv/__init__.py", line 75, in get
  5037. return self._get(key)
  5038. File "/usr/local/lib/python3.6/site-packages/simplekv/memory/redisstore.py", line 31, in _get
  5039. val = self.redis.get(key)
  5040. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 976, in get
  5041. return self.execute_command('GET', name)
  5042. File "/usr/local/lib/python3.6/site-packages/ddtrace/contrib/redis/patch.py", line 58, in traced_execute_command
  5043. return func(*args, **kwargs)
  5044. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 673, in execute_command
  5045. connection.send_command(*args)
  5046. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 610, in send_command
  5047. self.send_packed_command(self.pack_command(*args))
  5048. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 585, in send_packed_command
  5049. self.connect()
  5050. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 489, in connect
  5051. raise ConnectionError(self._error_message(e))
  5052. redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  5053. 2019-03-08T18:36:36.322026Z [debug ] stdlib_log  [urllib3.connectionpool] message=http://localhost:8080 "POST /v1/user.login HTTP/1.1" 500 59 request_id=0239925bfd9c4558bce0aa5184d8717e
  5054. 2019-03-08T18:36:36.322963Z [debug ] stdlib_log  [userapp] message=Recieved response=A server error occurred. Please contact the administrator. request_id=0239925bfd9c4558bce0aa5184d8717e
  5055. 2019-03-08T18:36:36.663280Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  5056. 2019-03-08T18:36:36.665146Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  5057. ______________________ AuthTestCase.test_token_heartbeat _______________________
  5058.  
  5059. self = <tests.test_user.AuthTestCase testMethod=test_token_heartbeat>
  5060.  
  5061. def test_token_heartbeat(self):
  5062. self.api.user.save(**self.USER_DATA)
  5063. > self.api.user.login(login=self.USER_DATA["login"], password=self.USER_DATA["password"])
  5064.  
  5065. tests/test_user.py:259:
  5066. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  5067. ../packages/userapp/userapp/__init__.py:325: in __call__
  5068. return self._client.call(self._version, self._parent._service_name, self._method_name, kwargs)
  5069. ../packages/userapp/userapp/__init__.py:245: in call
  5070. result = DictionaryUtility.to_object(response.json())
  5071. /usr/local/lib/python3.6/site-packages/requests/models.py:892: in json
  5072. return complexjson.loads(self.text, **kwargs)
  5073. /usr/local/lib/python3.6/site-packages/simplejson/__init__.py:518: in loads
  5074. return _default_decoder.decode(s)
  5075. /usr/local/lib/python3.6/site-packages/simplejson/decoder.py:370: in decode
  5076. obj, end = self.raw_decode(s)
  5077. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  5078.  
  5079. self = <simplejson.decoder.JSONDecoder object at 0x7f794e0da0b8>
  5080. s = 'A server error occurred. Please contact the administrator.', idx = 0
  5081. _w = <built-in method match of _sre.SRE_Pattern object at 0x7f79550f4e70>
  5082. _PY3 = True
  5083.  
  5084. def raw_decode(self, s, idx=0, _w=WHITESPACE.match, _PY3=PY3):
  5085. """Decode a JSON document from ``s`` (a ``str`` or ``unicode``
  5086. beginning with a JSON document) and return a 2-tuple of the Python
  5087. representation and the index in ``s`` where the document ended.
  5088. Optionally, ``idx`` can be used to specify an offset in ``s`` where
  5089. the JSON document begins.
  5090.  
  5091. This can be used to decode a JSON document from a string that may
  5092. have extraneous data at the end.
  5093.  
  5094. """
  5095. if idx < 0:
  5096. # Ensure that raw_decode bails on negative indexes, the regex
  5097. # would otherwise mask this behavior. #98
  5098. raise JSONDecodeError('Expecting value', s, idx)
  5099. if _PY3 and not isinstance(s, text_type):
  5100. raise TypeError("Input string must be text, not bytes")
  5101. # strip UTF-8 bom
  5102. if len(s) > idx:
  5103. ord0 = ord(s[idx])
  5104. if ord0 == 0xfeff:
  5105. idx += 1
  5106. elif ord0 == 0xef and s[idx:idx + 3] == '\xef\xbb\xbf':
  5107. idx += 3
  5108. > return self.scan_once(s, idx=_w(s, idx).end())
  5109. E simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
  5110.  
  5111. /usr/local/lib/python3.6/site-packages/simplejson/decoder.py:400: JSONDecodeError
  5112. ----------------------------- Captured stdout call -----------------------------
  5113. 2019-03-08T18:37:12.398288Z [info ] request  client_addr=127.0.0.1 forwarding= json={'first_name': 'Test', 'last_name': 'Testovac', 'email_verified': True, 'login': 'testuser@example.com', 'password': 'MadladPwd42', 'properties': {'currency': {'value': 'usd'}, 'language': {'value': 'en'}}} method=POST path=/v1/user.save request_id=bd2ef07aeb194027ba8ef37444c60da7
  5114. 2019-03-08T18:37:12.745623Z [info ] response  length=446 request_id=bd2ef07aeb194027ba8ef37444c60da7 status=200
  5115. 2019-03-08T18:37:12.750973Z [info ] request  client_addr=127.0.0.1 forwarding= json={'login': 'testuser@example.com', 'password': 'MadladPwd42'} method=POST path=/v1/user.login request_id=15f3dcaa96f648198bd25eda9a4de099
  5116. ----------------------------- Captured stderr call -----------------------------
  5117. 2019-03-08T18:37:11.103814Z [debug ] stdlib_log  [ddtrace.encoding] message=using Msgpack encoder request_id=0239925bfd9c4558bce0aa5184d8717e
  5118. 2019-03-08T18:37:11.104222Z [info ] stdlib_log  [ddtrace.sampler] message=initialized RateSampler, sample 100.0% of traces request_id=0239925bfd9c4558bce0aa5184d8717e
  5119. 2019-03-08T18:37:11.111195Z [debug ] stdlib_log  [ddtrace.writer] message=resetting queues. pids(old:None new:68) request_id=0239925bfd9c4558bce0aa5184d8717e
  5120. 2019-03-08T18:37:11.111620Z [debug ] stdlib_log  [ddtrace.writer] message=starting flush thread request_id=0239925bfd9c4558bce0aa5184d8717e
  5121. 2019-03-08T18:37:11.305904Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  5122. 2019-03-08T18:37:11.310322Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  5123. 2019-03-08T18:37:12.118907Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  5124. 2019-03-08T18:37:12.123113Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  5125. 2019-03-08T18:37:12.391089Z [debug ] stdlib_log  [userapp] message=Calling post http://localhost:8080/v1/user.save with headers {'Content-Type': 'application/json', 'Authorization': 'Basic QmRiZnZ3RVNOUXhRa1h3VENLc2NoTDo='} and body {"first_name": "Test", "last_name": "Testovac", "email_verified": true, "login": "testuser@example.com", "password": "MadladPwd42", "properties": {"currency": {"value": "usd"}, "language": {"value": "en"}}} request_id=0239925bfd9c4558bce0aa5184d8717e
  5126. 2019-03-08T18:37:12.394755Z [debug ] stdlib_log  [urllib3.connectionpool] message=Starting new HTTP connection (1): localhost request_id=0239925bfd9c4558bce0aa5184d8717e
  5127. 2019-03-08T18:37:12.746474Z [debug ] stdlib_log  [urllib3.connectionpool] message=http://localhost:8080 "POST /v1/user.save HTTP/1.1" 200 446 request_id=0239925bfd9c4558bce0aa5184d8717e
  5128. 2019-03-08T18:37:12.747418Z [debug ] stdlib_log  [userapp] message=Recieved response={
  5129. "brand": "kiwicom",
  5130. "created_at": 1552070232.432534,
  5131. "email": "testuser@example.com",
  5132. "email_verified": true,
  5133. "first_name": "Test",
  5134. "last_login_at": null,
  5135. "last_name": "Testovac",
  5136. "locks": [],
  5137. "login": "testuser@example.com",
  5138. "properties": {
  5139. "currency": {
  5140. "value": "usd"
  5141. },
  5142. "language": {
  5143. "value": "en"
  5144. }
  5145. },
  5146. "updated_at": 1552070232.432541,
  5147. "user_id": "BFRSWEgCVHaVP0VSYaUvPI"
  5148. }
  5149.  request_id=0239925bfd9c4558bce0aa5184d8717e
  5150. 2019-03-08T18:37:12.747842Z [debug ] stdlib_log  [userapp] message=Calling post http://localhost:8080/v1/user.login with headers {'Content-Type': 'application/json', 'Authorization': 'Basic QmRiZnZ3RVNOUXhRa1h3VENLc2NoTDo='} and body {"login": "testuser@example.com", "password": "MadladPwd42"} request_id=0239925bfd9c4558bce0aa5184d8717e
  5151. 2019-03-08T18:37:12.749387Z [debug ] stdlib_log  [urllib3.connectionpool] message=Starting new HTTP connection (1): localhost request_id=0239925bfd9c4558bce0aa5184d8717e
  5152. Traceback (most recent call last):
  5153. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 484, in connect
  5154. sock = self._connect()
  5155. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 541, in _connect
  5156. raise err
  5157. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 529, in _connect
  5158. sock.connect(socket_address)
  5159. File "/usr/local/lib/python3.6/site-packages/gevent/_socket3.py", line 307, in connect
  5160. raise error(result, strerror(result))
  5161. OSError: [Errno 99] Address not available
  5162.  
  5163. During handling of the above exception, another exception occurred:
  5164.  
  5165. Traceback (most recent call last):
  5166. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 667, in execute_command
  5167. connection.send_command(*args)
  5168. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 610, in send_command
  5169. self.send_packed_command(self.pack_command(*args))
  5170. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 585, in send_packed_command
  5171. self.connect()
  5172. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 489, in connect
  5173. raise ConnectionError(self._error_message(e))
  5174. redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  5175.  
  5176. During handling of the above exception, another exception occurred:
  5177.  
  5178. Traceback (most recent call last):
  5179. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 484, in connect
  5180. sock = self._connect()
  5181. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 541, in _connect
  5182. raise err
  5183. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 529, in _connect
  5184. sock.connect(socket_address)
  5185. File "/usr/local/lib/python3.6/site-packages/gevent/_socket3.py", line 307, in connect
  5186. raise error(result, strerror(result))
  5187. OSError: [Errno 99] Address not available
  5188.  
  5189. During handling of the above exception, another exception occurred:
  5190.  
  5191. Traceback (most recent call last):
  5192. File "/usr/local/lib/python3.6/wsgiref/handlers.py", line 137, in run
  5193. self.result = application(self.environ, self.start_response)
  5194. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1997, in __call__
  5195. return self.wsgi_app(environ, start_response)
  5196. File "/usr/src/app/auth/middleware.py", line 57, in __call__
  5197. retval = self.app(environ, custom_start_response)
  5198. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1985, in wsgi_app
  5199. response = self.handle_exception(e)
  5200. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1540, in handle_exception
  5201. reraise(exc_type, exc_value, tb)
  5202. File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
  5203. raise value
  5204. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
  5205. response = self.full_dispatch_request()
  5206. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
  5207. rv = self.handle_user_exception(e)
  5208. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
  5209. reraise(exc_type, exc_value, tb)
  5210. File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
  5211. raise value
  5212. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request
  5213. rv = self.dispatch_request()
  5214. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request
  5215. return self.view_functions[rule.endpoint](**req.view_args)
  5216. File "/usr/src/packages/flask-jsonschemer/flask_jsonschemer.py", line 71, in decorated
  5217. return fn(*args, **kwargs)
  5218. File "/usr/src/app/auth/token/decorators.py", line 38, in decorated
  5219. return f(*args, **kwargs)
  5220. File "/usr/src/app/auth/views.py", line 139, in login
  5221. check_block(user_json["login"])
  5222. File "/usr/src/app/auth/utils.py", line 26, in check_block
  5223. if int(kvstore.get(key)) >= current_app.config["INVALID_LOGIN_ATTEMPTS"]:
  5224. File "/usr/local/lib/python3.6/site-packages/simplekv/decorator.py", line 52, in get
  5225. return self._dstore.get(self._map_key(key), *args, **kwargs)
  5226. File "/usr/local/lib/python3.6/site-packages/simplekv/__init__.py", line 75, in get
  5227. return self._get(key)
  5228. File "/usr/local/lib/python3.6/site-packages/simplekv/memory/redisstore.py", line 31, in _get
  5229. val = self.redis.get(key)
  5230. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 976, in get
  5231. return self.execute_command('GET', name)
  5232. File "/usr/local/lib/python3.6/site-packages/ddtrace/contrib/redis/patch.py", line 58, in traced_execute_command
  5233. return func(*args, **kwargs)
  5234. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 673, in execute_command
  5235. connection.send_command(*args)
  5236. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 610, in send_command
  5237. self.send_packed_command(self.pack_command(*args))
  5238. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 585, in send_packed_command
  5239. self.connect()
  5240. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 489, in connect
  5241. raise ConnectionError(self._error_message(e))
  5242. redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  5243. 2019-03-08T18:37:12.759987Z [debug ] stdlib_log  [urllib3.connectionpool] message=http://localhost:8080 "POST /v1/user.login HTTP/1.1" 500 59 request_id=0239925bfd9c4558bce0aa5184d8717e
  5244. 2019-03-08T18:37:12.760919Z [debug ] stdlib_log  [userapp] message=Recieved response=A server error occurred. Please contact the administrator. request_id=0239925bfd9c4558bce0aa5184d8717e
  5245. 2019-03-08T18:37:13.130625Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  5246. 2019-03-08T18:37:13.134840Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  5247. ___________________ AuthTestCase.test_update_user_save_self ____________________
  5248.  
  5249. self = <tests.test_user.AuthTestCase testMethod=test_update_user_save_self>
  5250.  
  5251. def test_update_user_save_self(self):
  5252. new_user = self.api.user.save(**self.USER_DATA)
  5253. > self.api.user.login(login=self.USER_DATA["login"], password=self.USER_DATA["password"])
  5254.  
  5255. tests/test_user.py:142:
  5256. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  5257. ../packages/userapp/userapp/__init__.py:325: in __call__
  5258. return self._client.call(self._version, self._parent._service_name, self._method_name, kwargs)
  5259. ../packages/userapp/userapp/__init__.py:245: in call
  5260. result = DictionaryUtility.to_object(response.json())
  5261. /usr/local/lib/python3.6/site-packages/requests/models.py:892: in json
  5262. return complexjson.loads(self.text, **kwargs)
  5263. /usr/local/lib/python3.6/site-packages/simplejson/__init__.py:518: in loads
  5264. return _default_decoder.decode(s)
  5265. /usr/local/lib/python3.6/site-packages/simplejson/decoder.py:370: in decode
  5266. obj, end = self.raw_decode(s)
  5267. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  5268.  
  5269. self = <simplejson.decoder.JSONDecoder object at 0x7f794e0da0b8>
  5270. s = 'A server error occurred. Please contact the administrator.', idx = 0
  5271. _w = <built-in method match of _sre.SRE_Pattern object at 0x7f79550f4e70>
  5272. _PY3 = True
  5273.  
  5274. def raw_decode(self, s, idx=0, _w=WHITESPACE.match, _PY3=PY3):
  5275. """Decode a JSON document from ``s`` (a ``str`` or ``unicode``
  5276. beginning with a JSON document) and return a 2-tuple of the Python
  5277. representation and the index in ``s`` where the document ended.
  5278. Optionally, ``idx`` can be used to specify an offset in ``s`` where
  5279. the JSON document begins.
  5280.  
  5281. This can be used to decode a JSON document from a string that may
  5282. have extraneous data at the end.
  5283.  
  5284. """
  5285. if idx < 0:
  5286. # Ensure that raw_decode bails on negative indexes, the regex
  5287. # would otherwise mask this behavior. #98
  5288. raise JSONDecodeError('Expecting value', s, idx)
  5289. if _PY3 and not isinstance(s, text_type):
  5290. raise TypeError("Input string must be text, not bytes")
  5291. # strip UTF-8 bom
  5292. if len(s) > idx:
  5293. ord0 = ord(s[idx])
  5294. if ord0 == 0xfeff:
  5295. idx += 1
  5296. elif ord0 == 0xef and s[idx:idx + 3] == '\xef\xbb\xbf':
  5297. idx += 3
  5298. > return self.scan_once(s, idx=_w(s, idx).end())
  5299. E simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
  5300.  
  5301. /usr/local/lib/python3.6/site-packages/simplejson/decoder.py:400: JSONDecodeError
  5302. ----------------------------- Captured stdout call -----------------------------
  5303. 2019-03-08T18:37:18.959281Z [info ] request  client_addr=127.0.0.1 forwarding= json={'first_name': 'Test', 'last_name': 'Testovac', 'email_verified': True, 'login': 'testuser@example.com', 'password': 'MadladPwd42', 'properties': {'currency': {'value': 'usd'}, 'language': {'value': 'en'}}} method=POST path=/v1/user.save request_id=a661fdb9f11e4a5d98a145c6bb14f15c
  5304. 2019-03-08T18:37:19.329540Z [info ] response  length=446 request_id=a661fdb9f11e4a5d98a145c6bb14f15c status=200
  5305. 2019-03-08T18:37:19.336946Z [info ] request  client_addr=127.0.0.1 forwarding= json={'login': 'testuser@example.com', 'password': 'MadladPwd42'} method=POST path=/v1/user.login request_id=65284e66ff94418ab4b4cf8aa74a3105
  5306. ----------------------------- Captured stderr call -----------------------------
  5307. 2019-03-08T18:37:17.492407Z [debug ] stdlib_log  [ddtrace.encoding] message=using Msgpack encoder request_id=0239925bfd9c4558bce0aa5184d8717e
  5308. 2019-03-08T18:37:17.492980Z [info ] stdlib_log  [ddtrace.sampler] message=initialized RateSampler, sample 100.0% of traces request_id=0239925bfd9c4558bce0aa5184d8717e
  5309. 2019-03-08T18:37:17.502698Z [debug ] stdlib_log  [ddtrace.writer] message=resetting queues. pids(old:None new:68) request_id=0239925bfd9c4558bce0aa5184d8717e
  5310. 2019-03-08T18:37:17.503140Z [debug ] stdlib_log  [ddtrace.writer] message=starting flush thread request_id=0239925bfd9c4558bce0aa5184d8717e
  5311. 2019-03-08T18:37:18.510222Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  5312. 2019-03-08T18:37:18.516201Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  5313. 2019-03-08T18:37:18.954956Z [debug ] stdlib_log  [userapp] message=Calling post http://localhost:8080/v1/user.save with headers {'Content-Type': 'application/json', 'Authorization': 'Basic R2ExUF81QkdsR2NUb295R3pmQzVpNDo='} and body {"first_name": "Test", "last_name": "Testovac", "email_verified": true, "login": "testuser@example.com", "password": "MadladPwd42", "properties": {"currency": {"value": "usd"}, "language": {"value": "en"}}} request_id=0239925bfd9c4558bce0aa5184d8717e
  5314. 2019-03-08T18:37:18.956886Z [debug ] stdlib_log  [urllib3.connectionpool] message=Starting new HTTP connection (1): localhost request_id=0239925bfd9c4558bce0aa5184d8717e
  5315. 2019-03-08T18:37:19.330748Z [debug ] stdlib_log  [urllib3.connectionpool] message=http://localhost:8080 "POST /v1/user.save HTTP/1.1" 200 446 request_id=0239925bfd9c4558bce0aa5184d8717e
  5316. 2019-03-08T18:37:19.332115Z [debug ] stdlib_log  [userapp] message=Recieved response={
  5317. "brand": "kiwicom",
  5318. "created_at": 1552070238.986574,
  5319. "email": "testuser@example.com",
  5320. "email_verified": true,
  5321. "first_name": "Test",
  5322. "last_login_at": null,
  5323. "last_name": "Testovac",
  5324. "locks": [],
  5325. "login": "testuser@example.com",
  5326. "properties": {
  5327. "currency": {
  5328. "value": "usd"
  5329. },
  5330. "language": {
  5331. "value": "en"
  5332. }
  5333. },
  5334. "updated_at": 1552070238.986585,
  5335. "user_id": "zODKmx84KA9odjGfNRz72W"
  5336. }
  5337.  request_id=0239925bfd9c4558bce0aa5184d8717e
  5338. 2019-03-08T18:37:19.332694Z [debug ] stdlib_log  [userapp] message=Calling post http://localhost:8080/v1/user.login with headers {'Content-Type': 'application/json', 'Authorization': 'Basic R2ExUF81QkdsR2NUb295R3pmQzVpNDo='} and body {"login": "testuser@example.com", "password": "MadladPwd42"} request_id=0239925bfd9c4558bce0aa5184d8717e
  5339. 2019-03-08T18:37:19.334867Z [debug ] stdlib_log  [urllib3.connectionpool] message=Starting new HTTP connection (1): localhost request_id=0239925bfd9c4558bce0aa5184d8717e
  5340. Traceback (most recent call last):
  5341. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 484, in connect
  5342. sock = self._connect()
  5343. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 541, in _connect
  5344. raise err
  5345. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 529, in _connect
  5346. sock.connect(socket_address)
  5347. File "/usr/local/lib/python3.6/site-packages/gevent/_socket3.py", line 307, in connect
  5348. raise error(result, strerror(result))
  5349. OSError: [Errno 99] Address not available
  5350.  
  5351. During handling of the above exception, another exception occurred:
  5352.  
  5353. Traceback (most recent call last):
  5354. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 667, in execute_command
  5355. connection.send_command(*args)
  5356. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 610, in send_command
  5357. self.send_packed_command(self.pack_command(*args))
  5358. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 585, in send_packed_command
  5359. self.connect()
  5360. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 489, in connect
  5361. raise ConnectionError(self._error_message(e))
  5362. redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  5363.  
  5364. During handling of the above exception, another exception occurred:
  5365.  
  5366. Traceback (most recent call last):
  5367. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 484, in connect
  5368. sock = self._connect()
  5369. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 541, in _connect
  5370. raise err
  5371. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 529, in _connect
  5372. sock.connect(socket_address)
  5373. File "/usr/local/lib/python3.6/site-packages/gevent/_socket3.py", line 307, in connect
  5374. raise error(result, strerror(result))
  5375. OSError: [Errno 99] Address not available
  5376.  
  5377. During handling of the above exception, another exception occurred:
  5378.  
  5379. Traceback (most recent call last):
  5380. File "/usr/local/lib/python3.6/wsgiref/handlers.py", line 137, in run
  5381. self.result = application(self.environ, self.start_response)
  5382. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1997, in __call__
  5383. return self.wsgi_app(environ, start_response)
  5384. File "/usr/src/app/auth/middleware.py", line 57, in __call__
  5385. retval = self.app(environ, custom_start_response)
  5386. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1985, in wsgi_app
  5387. response = self.handle_exception(e)
  5388. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1540, in handle_exception
  5389. reraise(exc_type, exc_value, tb)
  5390. File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
  5391. raise value
  5392. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
  5393. response = self.full_dispatch_request()
  5394. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
  5395. rv = self.handle_user_exception(e)
  5396. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
  5397. reraise(exc_type, exc_value, tb)
  5398. File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
  5399. raise value
  5400. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request
  5401. rv = self.dispatch_request()
  5402. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request
  5403. return self.view_functions[rule.endpoint](**req.view_args)
  5404. File "/usr/src/packages/flask-jsonschemer/flask_jsonschemer.py", line 71, in decorated
  5405. return fn(*args, **kwargs)
  5406. File "/usr/src/app/auth/token/decorators.py", line 38, in decorated
  5407. return f(*args, **kwargs)
  5408. File "/usr/src/app/auth/views.py", line 139, in login
  5409. check_block(user_json["login"])
  5410. File "/usr/src/app/auth/utils.py", line 26, in check_block
  5411. if int(kvstore.get(key)) >= current_app.config["INVALID_LOGIN_ATTEMPTS"]:
  5412. File "/usr/local/lib/python3.6/site-packages/simplekv/decorator.py", line 52, in get
  5413. return self._dstore.get(self._map_key(key), *args, **kwargs)
  5414. File "/usr/local/lib/python3.6/site-packages/simplekv/__init__.py", line 75, in get
  5415. return self._get(key)
  5416. File "/usr/local/lib/python3.6/site-packages/simplekv/memory/redisstore.py", line 31, in _get
  5417. val = self.redis.get(key)
  5418. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 976, in get
  5419. return self.execute_command('GET', name)
  5420. File "/usr/local/lib/python3.6/site-packages/ddtrace/contrib/redis/patch.py", line 58, in traced_execute_command
  5421. return func(*args, **kwargs)
  5422. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 673, in execute_command
  5423. connection.send_command(*args)
  5424. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 610, in send_command
  5425. self.send_packed_command(self.pack_command(*args))
  5426. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 585, in send_packed_command
  5427. self.connect()
  5428. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 489, in connect
  5429. raise ConnectionError(self._error_message(e))
  5430. redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  5431. 2019-03-08T18:37:19.348209Z [debug ] stdlib_log  [urllib3.connectionpool] message=http://localhost:8080 "POST /v1/user.login HTTP/1.1" 500 59 request_id=0239925bfd9c4558bce0aa5184d8717e
  5432. 2019-03-08T18:37:19.349186Z [debug ] stdlib_log  [userapp] message=Recieved response=A server error occurred. Please contact the administrator. request_id=0239925bfd9c4558bce0aa5184d8717e
  5433. 2019-03-08T18:37:19.522988Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  5434. 2019-03-08T18:37:19.527102Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  5435. __________ AuthTestCase.test_update_user_save_self_cant_change_passwd __________
  5436.  
  5437. self = <tests.test_user.AuthTestCase testMethod=test_update_user_save_self_cant_change_passwd>
  5438.  
  5439. def test_update_user_save_self_cant_change_passwd(self):
  5440. self.api.user.save(**self.USER_DATA)
  5441. > self.api.user.login(login=self.USER_DATA["login"], password=self.USER_DATA["password"])
  5442.  
  5443. tests/test_user.py:149:
  5444. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  5445. ../packages/userapp/userapp/__init__.py:325: in __call__
  5446. return self._client.call(self._version, self._parent._service_name, self._method_name, kwargs)
  5447. ../packages/userapp/userapp/__init__.py:245: in call
  5448. result = DictionaryUtility.to_object(response.json())
  5449. /usr/local/lib/python3.6/site-packages/requests/models.py:892: in json
  5450. return complexjson.loads(self.text, **kwargs)
  5451. /usr/local/lib/python3.6/site-packages/simplejson/__init__.py:518: in loads
  5452. return _default_decoder.decode(s)
  5453. /usr/local/lib/python3.6/site-packages/simplejson/decoder.py:370: in decode
  5454. obj, end = self.raw_decode(s)
  5455. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  5456.  
  5457. self = <simplejson.decoder.JSONDecoder object at 0x7f794e0da0b8>
  5458. s = 'A server error occurred. Please contact the administrator.', idx = 0
  5459. _w = <built-in method match of _sre.SRE_Pattern object at 0x7f79550f4e70>
  5460. _PY3 = True
  5461.  
  5462. def raw_decode(self, s, idx=0, _w=WHITESPACE.match, _PY3=PY3):
  5463. """Decode a JSON document from ``s`` (a ``str`` or ``unicode``
  5464. beginning with a JSON document) and return a 2-tuple of the Python
  5465. representation and the index in ``s`` where the document ended.
  5466. Optionally, ``idx`` can be used to specify an offset in ``s`` where
  5467. the JSON document begins.
  5468.  
  5469. This can be used to decode a JSON document from a string that may
  5470. have extraneous data at the end.
  5471.  
  5472. """
  5473. if idx < 0:
  5474. # Ensure that raw_decode bails on negative indexes, the regex
  5475. # would otherwise mask this behavior. #98
  5476. raise JSONDecodeError('Expecting value', s, idx)
  5477. if _PY3 and not isinstance(s, text_type):
  5478. raise TypeError("Input string must be text, not bytes")
  5479. # strip UTF-8 bom
  5480. if len(s) > idx:
  5481. ord0 = ord(s[idx])
  5482. if ord0 == 0xfeff:
  5483. idx += 1
  5484. elif ord0 == 0xef and s[idx:idx + 3] == '\xef\xbb\xbf':
  5485. idx += 3
  5486. > return self.scan_once(s, idx=_w(s, idx).end())
  5487. E simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
  5488.  
  5489. /usr/local/lib/python3.6/site-packages/simplejson/decoder.py:400: JSONDecodeError
  5490. ----------------------------- Captured stdout call -----------------------------
  5491. 2019-03-08T18:37:21.390562Z [info ] request  client_addr=127.0.0.1 forwarding= json={'first_name': 'Test', 'last_name': 'Testovac', 'email_verified': True, 'login': 'testuser@example.com', 'password': 'MadladPwd42', 'properties': {'currency': {'value': 'usd'}, 'language': {'value': 'en'}}} method=POST path=/v1/user.save request_id=aa0e3b43bdc84b46aad4e2bc68079773
  5492. 2019-03-08T18:37:21.711020Z [info ] response  length=446 request_id=aa0e3b43bdc84b46aad4e2bc68079773 status=200
  5493. 2019-03-08T18:37:21.716220Z [info ] request  client_addr=127.0.0.1 forwarding= json={'login': 'testuser@example.com', 'password': 'MadladPwd42'} method=POST path=/v1/user.login request_id=c9854fc8b8f341458593210e2da3d350
  5494. ----------------------------- Captured stderr call -----------------------------
  5495. 2019-03-08T18:37:19.995923Z [debug ] stdlib_log  [ddtrace.encoding] message=using Msgpack encoder request_id=0239925bfd9c4558bce0aa5184d8717e
  5496. 2019-03-08T18:37:19.996194Z [info ] stdlib_log  [ddtrace.sampler] message=initialized RateSampler, sample 100.0% of traces request_id=0239925bfd9c4558bce0aa5184d8717e
  5497. 2019-03-08T18:37:20.001622Z [debug ] stdlib_log  [ddtrace.writer] message=resetting queues. pids(old:None new:68) request_id=0239925bfd9c4558bce0aa5184d8717e
  5498. 2019-03-08T18:37:20.001865Z [debug ] stdlib_log  [ddtrace.writer] message=starting flush thread request_id=0239925bfd9c4558bce0aa5184d8717e
  5499. 2019-03-08T18:37:21.009975Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  5500. 2019-03-08T18:37:21.014780Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  5501. 2019-03-08T18:37:21.386198Z [debug ] stdlib_log  [userapp] message=Calling post http://localhost:8080/v1/user.save with headers {'Content-Type': 'application/json', 'Authorization': 'Basic T0JhTXRIU3E1WHJLMjR6RUphcVl3Rjo='} and body {"first_name": "Test", "last_name": "Testovac", "email_verified": true, "login": "testuser@example.com", "password": "MadladPwd42", "properties": {"currency": {"value": "usd"}, "language": {"value": "en"}}} request_id=0239925bfd9c4558bce0aa5184d8717e
  5502. 2019-03-08T18:37:21.388254Z [debug ] stdlib_log  [urllib3.connectionpool] message=Starting new HTTP connection (1): localhost request_id=0239925bfd9c4558bce0aa5184d8717e
  5503. 2019-03-08T18:37:21.711891Z [debug ] stdlib_log  [urllib3.connectionpool] message=http://localhost:8080 "POST /v1/user.save HTTP/1.1" 200 446 request_id=0239925bfd9c4558bce0aa5184d8717e
  5504. 2019-03-08T18:37:21.712831Z [debug ] stdlib_log  [userapp] message=Recieved response={
  5505. "brand": "kiwicom",
  5506. "created_at": 1552070241.410248,
  5507. "email": "testuser@example.com",
  5508. "email_verified": true,
  5509. "first_name": "Test",
  5510. "last_login_at": null,
  5511. "last_name": "Testovac",
  5512. "locks": [],
  5513. "login": "testuser@example.com",
  5514. "properties": {
  5515. "currency": {
  5516. "value": "usd"
  5517. },
  5518. "language": {
  5519. "value": "en"
  5520. }
  5521. },
  5522. "updated_at": 1552070241.410256,
  5523. "user_id": "Fv-xm_8RzVEy57l7KFcock"
  5524. }
  5525.  request_id=0239925bfd9c4558bce0aa5184d8717e
  5526. 2019-03-08T18:37:21.713228Z [debug ] stdlib_log  [userapp] message=Calling post http://localhost:8080/v1/user.login with headers {'Content-Type': 'application/json', 'Authorization': 'Basic T0JhTXRIU3E1WHJLMjR6RUphcVl3Rjo='} and body {"login": "testuser@example.com", "password": "MadladPwd42"} request_id=0239925bfd9c4558bce0aa5184d8717e
  5527. 2019-03-08T18:37:21.714718Z [debug ] stdlib_log  [urllib3.connectionpool] message=Starting new HTTP connection (1): localhost request_id=0239925bfd9c4558bce0aa5184d8717e
  5528. Traceback (most recent call last):
  5529. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 484, in connect
  5530. sock = self._connect()
  5531. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 541, in _connect
  5532. raise err
  5533. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 529, in _connect
  5534. sock.connect(socket_address)
  5535. File "/usr/local/lib/python3.6/site-packages/gevent/_socket3.py", line 307, in connect
  5536. raise error(result, strerror(result))
  5537. OSError: [Errno 99] Address not available
  5538.  
  5539. During handling of the above exception, another exception occurred:
  5540.  
  5541. Traceback (most recent call last):
  5542. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 667, in execute_command
  5543. connection.send_command(*args)
  5544. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 610, in send_command
  5545. self.send_packed_command(self.pack_command(*args))
  5546. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 585, in send_packed_command
  5547. self.connect()
  5548. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 489, in connect
  5549. raise ConnectionError(self._error_message(e))
  5550. redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  5551.  
  5552. During handling of the above exception, another exception occurred:
  5553.  
  5554. Traceback (most recent call last):
  5555. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 484, in connect
  5556. sock = self._connect()
  5557. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 541, in _connect
  5558. raise err
  5559. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 529, in _connect
  5560. sock.connect(socket_address)
  5561. File "/usr/local/lib/python3.6/site-packages/gevent/_socket3.py", line 307, in connect
  5562. raise error(result, strerror(result))
  5563. OSError: [Errno 99] Address not available
  5564.  
  5565. During handling of the above exception, another exception occurred:
  5566.  
  5567. Traceback (most recent call last):
  5568. File "/usr/local/lib/python3.6/wsgiref/handlers.py", line 137, in run
  5569. self.result = application(self.environ, self.start_response)
  5570. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1997, in __call__
  5571. return self.wsgi_app(environ, start_response)
  5572. File "/usr/src/app/auth/middleware.py", line 57, in __call__
  5573. retval = self.app(environ, custom_start_response)
  5574. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1985, in wsgi_app
  5575. response = self.handle_exception(e)
  5576. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1540, in handle_exception
  5577. reraise(exc_type, exc_value, tb)
  5578. File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
  5579. raise value
  5580. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
  5581. response = self.full_dispatch_request()
  5582. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
  5583. rv = self.handle_user_exception(e)
  5584. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
  5585. reraise(exc_type, exc_value, tb)
  5586. File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
  5587. raise value
  5588. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request
  5589. rv = self.dispatch_request()
  5590. File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request
  5591. return self.view_functions[rule.endpoint](**req.view_args)
  5592. File "/usr/src/packages/flask-jsonschemer/flask_jsonschemer.py", line 71, in decorated
  5593. return fn(*args, **kwargs)
  5594. File "/usr/src/app/auth/token/decorators.py", line 38, in decorated
  5595. return f(*args, **kwargs)
  5596. File "/usr/src/app/auth/views.py", line 139, in login
  5597. check_block(user_json["login"])
  5598. File "/usr/src/app/auth/utils.py", line 26, in check_block
  5599. if int(kvstore.get(key)) >= current_app.config["INVALID_LOGIN_ATTEMPTS"]:
  5600. File "/usr/local/lib/python3.6/site-packages/simplekv/decorator.py", line 52, in get
  5601. return self._dstore.get(self._map_key(key), *args, **kwargs)
  5602. File "/usr/local/lib/python3.6/site-packages/simplekv/__init__.py", line 75, in get
  5603. return self._get(key)
  5604. File "/usr/local/lib/python3.6/site-packages/simplekv/memory/redisstore.py", line 31, in _get
  5605. val = self.redis.get(key)
  5606. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 976, in get
  5607. return self.execute_command('GET', name)
  5608. File "/usr/local/lib/python3.6/site-packages/ddtrace/contrib/redis/patch.py", line 58, in traced_execute_command
  5609. return func(*args, **kwargs)
  5610. File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 673, in execute_command
  5611. connection.send_command(*args)
  5612. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 610, in send_command
  5613. self.send_packed_command(self.pack_command(*args))
  5614. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 585, in send_packed_command
  5615. self.connect()
  5616. File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 489, in connect
  5617. raise ConnectionError(self._error_message(e))
  5618. redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Address not available.
  5619. 2019-03-08T18:37:21.724500Z [debug ] stdlib_log  [urllib3.connectionpool] message=http://localhost:8080 "POST /v1/user.login HTTP/1.1" 500 59 request_id=0239925bfd9c4558bce0aa5184d8717e
  5620. 2019-03-08T18:37:21.725408Z [debug ] stdlib_log  [userapp] message=Recieved response=A server error occurred. Please contact the administrator. request_id=0239925bfd9c4558bce0aa5184d8717e
  5621. 2019-03-08T18:37:22.018724Z [error ] stdlib_log  [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
  5622. 2019-03-08T18:37:22.021142Z [error ] stdlib_log  [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
  5623. ==================== 22 failed, 79 passed in 194.87 seconds ====================
  5624. Stopping pg and redis
  5625. killall: redis-server: no process killed
  5626. killall: postgresql: no process killed
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement