stacks-core icon indicating copy to clipboard operation
stacks-core copied to clipboard

ERR_INVALID_HTTP_RESPONSE on v1/stores

Open wackenvoss opened this issue 9 years ago • 21 comments

Sporadically I receive an ERR_INVALID_HTTP_RESPONSE error which prevents me from receiving data from a user's file. I've noticed this occurs mainly when I've just authenticated. I refresh a few times and the error goes away.

OPTIONS {{v1/stores route}} net::ERR_INVALID_HTTP_RESPONSE

This video demonstrates the bug: https://www.useloom.com/share/82c4799238f44e20a22463c8debde694

Here is my api_endpoint.log: https://gist.github.com/cwackerfuss/dfc0bfcee0521a43067c325664bc8f77

I spoke with @larrysalibra and he suggested this may be network trouble based on the following code:

127.0.0.1 - - [25/Nov/2017 23:31:34] "GET /v1/node/ping HTTP/1.1" 200 -
127.0.0.1 - - [25/Nov/2017 23:31:34] "GET /v1/wallet/payment_address HTTP/1.1" 200 -
[2017-11-25 23:31:35,295] [DEBUG] [common:671] (38825) Fetched 1050 bytes
[2017-11-25 23:31:35,297] [DEBUG] [common:657] (38825) Fetch index page https://www.dropbox.com/s/ccoh5anp92wska5/e?dl=1 via HTTP
[2017-11-25 23:31:36,524] [DEBUG] [common:671] (38825) Fetched 182 bytes
[2017-11-25 23:31:36,525] [ERROR] [common:981] (38825) No data URL from index for '/0%3A1PtxJPxdzkeJ3hmTqKZo2ejiZbNbL5Loka.datastore'
[2017-11-25 23:31:36,525] [ERROR] [common:1048] (38825) Failed to load data for /0%3A1PtxJPxdzkeJ3hmTqKZo2ejiZbNbL5Loka.datastore from hologram.id when forcing cache misses
[2017-11-25 23:31:36,525] [ERROR] [common:1059] (38825) Failed to load data for /0%3A1PtxJPxdzkeJ3hmTqKZo2ejiZbNbL5Loka.datastore from hologram.id
[2017-11-25 23:31:36,526] [DEBUG] [storage:932] (38918.123145497374720) No data from dropbox (https://www.dropbox.com/blockstack/0%253A1PtxJPxdzkeJ3hmTqKZo2ejiZbNbL5Loka.datastore)
[2017-11-25 23:31:36,531] [ERROR] [data:937] (38918.123145497374720) Failed to get mutable datum 0%3A1PtxJPxdzkeJ3hmTqKZo2ejiZbNbL5Loka.datastore from dropbox
[2017-11-25 23:31:36,535] [DEBUG] [data:931] (38918.123145497374720) get_mutable_data(0%3A1PtxJPxdzkeJ3hmTqKZo2ejiZbNbL5Loka.datastore) from s3
[2017-11-25 23:31:36,540] [DEBUG] [storage:873] (38918.123145497374720) get_mutable_data 0%3A1PtxJPxdzkeJ3hmTqKZo2ejiZbNbL5Loka.datastore fqu=hologram.id bsk_version=2
[2017-11-25 23:31:36,544] [DEBUG] [storage:891] (38918.123145497374720) 0%3A1PtxJPxdzkeJ3hmTqKZo2ejiZbNbL5Loka.datastore available at https://blockstack-server-profiles.s3.amazonaws.com/0%3A1PtxJPxdzkeJ3hmTqKZo2ejiZbNbL5Loka.datastore
[2017-11-25 23:31:36,549] [DEBUG] [storage:917] (38918.123145497374720) Try s3 (https://blockstack-server-profiles.s3.amazonaws.com/0%3A1PtxJPxdzkeJ3hmTqKZo2ejiZbNbL5Loka.datastore)
[2017-11-25 23:31:36,553] [DEBUG] [s3:88] (38825) Anonymous read-only connect to S3
[2017-11-25 23:31:37,560] [ERROR] [s3:92] (38825) Connection to S3 failed
[2017-11-25 23:31:37,560] [ERROR] [s3:93] (38825) No handler was ready to authenticate. 1 handlers were checked. ['HmacAuthV1Handler'] Check your credentials
Traceback (most recent call last):
  File "/tmp/blockstack-venv/lib/python2.7/site-packages/blockstack_client/backend/drivers/s3.py", line 90, in get_bucket
    conn = boto.connect_s3()
  File "/tmp/blockstack-venv/lib/python2.7/site-packages/boto/__init__.py", line 141, in connect_s3
    return S3Connection(aws_access_key_id, aws_secret_access_key, **kwargs)
  File "/tmp/blockstack-venv/lib/python2.7/site-packages/boto/s3/connection.py", line 194, in __init__
    validate_certs=validate_certs, profile_name=profile_name)
  File "/tmp/blockstack-venv/lib/python2.7/site-packages/boto/connection.py", line 569, in __init__
    host, config, self.provider, self._required_auth_capability())
  File "/tmp/blockstack-venv/lib/python2.7/site-packages/boto/auth.py", line 1021, in get_auth_handler
    'Check your credentials' % (len(names), str(names)))
NoAuthHandlerFound: No handler was ready to authenticate. 1 handlers were checked. ['HmacAuthV1Handler'] Check your credentials
[2017-11-25 23:31:37,560] [ERROR] [s3:172] (38825) Failed to get bucket 'blockstack-server-profiles'
[2017-11-25 23:31:37,561] [DEBUG] [storage:932] (38918.123145497374720) No data from s3 (https://blockstack-server-profiles.s3.amazonaws.com/0%3A1PtxJPxdzkeJ3hmTqKZo2ejiZbNbL5Loka.datastore)
[2017-11-25 23:31:37,568] [ERROR] [data:937] (38918.123145497374720) Failed to get mutable datum 0%3A1PtxJPxdzkeJ3hmTqKZo2ejiZbNbL5Loka.datastore from s3
[2017-11-25 23:31:37,573] [DEBUG] [data:931] (38918.123145497374720) get_mutable_data(0%3A1PtxJPxdzkeJ3hmTqKZo2ejiZbNbL5Loka.datastore) from blockstack_resolver
[2017-11-25 23:31:37,577] [DEBUG] [storage:873] (38918.123145497374720) get_mutable_data 0%3A1PtxJPxdzkeJ3hmTqKZo2ejiZbNbL5Loka.datastore fqu=hologram.id bsk_version=2
[2017-11-25 23:31:37,582] [DEBUG] [storage:891] (38918.123145497374720) 0%3A1PtxJPxdzkeJ3hmTqKZo2ejiZbNbL5Loka.datastore available at https://blockstack.s3.amazonaws.com/0%3A1PtxJPxdzkeJ3hmTqKZo2ejiZbNbL5Loka.datastore
[2017-11-25 23:31:37,587] [DEBUG] [storage:917] (38918.123145497374720) Try blockstack_resolver (https://blockstack.s3.amazonaws.com/0%3A1PtxJPxdzkeJ3hmTqKZo2ejiZbNbL5Loka.datastore)
[2017-11-25 23:31:37,858] [DEBUG] [blockstack_resolver:87] (38825) GET https://blockstack.s3.amazonaws.com/hologram.id status code 403
[2017-11-25 23:31:37,858] [DEBUG] [storage:932] (38918.123145497374720) No data from blockstack_resolver (https://blockstack.s3.amazonaws.com/0%3A1PtxJPxdzkeJ3hmTqKZo2ejiZbNbL5Loka.datastore)
[2017-11-25 23:31:37,864] [ERROR] [data:937] (38918.123145497374720) Failed to get mutable datum 0%3A1PtxJPxdzkeJ3hmTqKZo2ejiZbNbL5Loka.datastore from blockstack_resolver
[2017-11-25 23:31:37,869] [DEBUG] [data:931] (38918.123145497374720) get_mutable_data(0%3A1PtxJPxdzkeJ3hmTqKZo2ejiZbNbL5Loka.datastore) from http
[2017-11-25 23:31:37,874] [DEBUG] [storage:873] (38918.123145497374720) get_mutable_data 0%3A1PtxJPxdzkeJ3hmTqKZo2ejiZbNbL5Loka.datastore fqu=hologram.id bsk_version=2
[2017-11-25 23:31:37,878] [DEBUG] [storage:891] (38918.123145497374720) 0%3A1PtxJPxdzkeJ3hmTqKZo2ejiZbNbL5Loka.datastore available at None
[2017-11-25 23:31:37,883] [DEBUG] [storage:897] (38918.123145497374720) Cannot use http to generate a URL for 0%3A1PtxJPxdzkeJ3hmTqKZo2ejiZbNbL5Loka.datastore
[2017-11-25 23:31:37,887] [ERROR] [data:937] (38918.123145497374720) Failed to get mutable datum 0%3A1PtxJPxdzkeJ3hmTqKZo2ejiZbNbL5Loka.datastore from http
[2017-11-25 23:31:37,891] [DEBUG] [data:931] (38918.123145497374720) get_mutable_data(0%3A1PtxJPxdzkeJ3hmTqKZo2ejiZbNbL5Loka.datastore) from dht
[2017-11-25 23:31:37,896] [DEBUG] [storage:873] (38918.123145497374720) get_mutable_data 0%3A1PtxJPxdzkeJ3hmTqKZo2ejiZbNbL5Loka.datastore fqu=hologram.id bsk_version=2
[2017-11-25 23:31:37,902] [DEBUG] [storage:891] (38918.123145497374720) 0%3A1PtxJPxdzkeJ3hmTqKZo2ejiZbNbL5Loka.datastore available at dht+udp://40ad6ff12b4e32b4615e78bb2f28e46931953600
[2017-11-25 23:31:37,907] [DEBUG] [storage:917] (38918.123145497374720) Try dht (dht+udp://40ad6ff12b4e32b4615e78bb2f28e46931953600)
[2017-11-25 23:31:38,006] [DEBUG] [storage:932] (38918.123145497374720) No data from dht (dht+udp://40ad6ff12b4e32b4615e78bb2f28e46931953600)
[2017-11-25 23:31:38,013] [ERROR] [data:937] (38918.123145497374720) Failed to get mutable datum 0%3A1PtxJPxdzkeJ3hmTqKZo2ejiZbNbL5Loka.datastore from dht
[2017-11-25 23:31:38,026] [DEBUG] [data:235] (38918.123145497374720) Cache datastore 1PtxJPxdzkeJ3hmTqKZo2ejiZbNbL5Loka
127.0.0.1 - - [25/Nov/2017 23:31:38] "GET /v1/stores/1PtxJPxdzkeJ3hmTqKZo2ejiZbNbL5Loka?device_ids=0&blockchain_id=hologram.id HTTP/1.1" 200 -
[2017-11-25 23:31:38,031] [ERROR] [rpc:4005] (38918.123145497374720) [Errno 41] Protocol wrong type for socket
Traceback (most recent call last):
  File "/tmp/blockstack-venv/lib/python2.7/site-packages/blockstack_client/rpc.py", line 4002, in _dispatch
    return route_method( session, path_info, *route_args )
  File "/tmp/blockstack-venv/lib/python2.7/site-packages/blockstack_client/rpc.py", line 1318, in GET_store
    return self._reply_json(ret)
  File "/tmp/blockstack-venv/lib/python2.7/site-packages/blockstack_client/rpc.py", line 231, in _reply_json
    self._send_headers(status_code=status_code)
  File "/tmp/blockstack-venv/lib/python2.7/site-packages/blockstack_client/rpc.py", line 219, in _send_headers
    self.send_header('content-type', content_type)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/BaseHTTPServer.py", line 401, in send_header
    self.wfile.write("%s: %s\r\n" % (keyword, value))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 328, in write
    self.flush()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 307, in flush
    self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 41] Protocol wrong type for socket
127.0.0.1 - - [25/Nov/2017 23:31:38] "GET /v1/stores/1PtxJPxdzkeJ3hmTqKZo2ejiZbNbL5Loka?device_ids=0&blockchain_id=hologram.id HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 599, in process_request_thread
    self.finish_request(request, client_address)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 334, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 657, in __init__
    self.finish()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 716, in finish
    self.wfile.close()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 283, in close
    self.flush()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 307, in flush
    self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe
[2017-11-25 23:31:57,509] [DEBUG] [rpc:3923] (38918.123145522614272) 
full path: /v1/wallet/payment_address
method: OPTIONS
path: /v1/wallet/payment_address
qs: {}
headers:
origin: http://localhost:8888
accept-language: en-US,en;q=0.9
accept-encoding: gzip, deflate, br
access-control-request-headers: authorization,content-type
connection: keep-alive
accept: */*
user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36
access-control-request-method: GET
host: localhost:6270
referer: http://localhost:8888/auth?authRequest=eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NksifQ.eyJqdGkiOiIyOTMyOTliMy0zZGZkLTRmNjktOWJiMy02ODgxMTc5NDI0YjgiLCJpYXQiOjE1MTE2NzQzMTYsImV4cCI6MTUxMTY3NzkxNiwiaXNzIjoiZGlkOmJ0Yy1hZGRyOjFDR2dUaFMzb1EyYW03VFBSWThTVm1FaVRXUnpNVkZWSmYiLCJwdWJsaWNfa2V5cyI6WyIwMzQxM2Y5M2M0OTZkNjg3MmNkZWNlZDAzMmExMzkyNmJlNDgzMDMwZGZjMTM4YTA0OTY0MmNhZGExODIwZDUzZTkiXSwiZG9tYWluX25hbWUiOiJodHRwOi8vbG9jYWxob3N0OjMwMDAiLCJtYW5pZmVzdF91cmkiOiJodHRwOi8vbG9jYWxob3N0OjMwMDAvbWFuaWZlc3QuanNvbiIsInJlZGlyZWN0X3VyaSI6Imh0dHA6Ly9sb2NhbGhvc3Q6MzAwMC8iLCJzY29wZXMiOlsic3RvcmVfd3JpdGUiXX0.EghFuYF4NZpIHRW2RWCjjL8f8w34zA_3aGx1UedjDbQU5c_CAp94iBbCcsz6sxq-plrLGJfXZRyAOxmJ6idxYQ

[2017-11-25 23:31:57,510] [DEBUG] [rpc:3923] (38918.123145526820864) 
full path: /v1/node/ping
method: GET
path: /v1/node/ping
qs: {}
headers:
origin: http://localhost:8888
accept-language: en-US,en;q=0.9
accept-encoding: gzip, deflate, br
connection: keep-alive
accept: */*
user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36
host: localhost:6270
referer: http://localhost:8888/auth?authRequest=eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NksifQ.eyJqdGkiOiIyOTMyOTliMy0zZGZkLTRmNjktOWJiMy02ODgxMTc5NDI0YjgiLCJpYXQiOjE1MTE2NzQzMTYsImV4cCI6MTUxMTY3NzkxNiwiaXNzIjoiZGlkOmJ0Yy1hZGRyOjFDR2dUaFMzb1EyYW03VFBSWThTVm1FaVRXUnpNVkZWSmYiLCJwdWJsaWNfa2V5cyI6WyIwMzQxM2Y5M2M0OTZkNjg3MmNkZWNlZDAzMmExMzkyNmJlNDgzMDMwZGZjMTM4YTA0OTY0MmNhZGExODIwZDUzZTkiXSwiZG9tYWluX25hbWUiOiJodHRwOi8vbG9jYWxob3N0OjMwMDAiLCJtYW5pZmVzdF91cmkiOiJodHRwOi8vbG9jYWxob3N0OjMwMDAvbWFuaWZlc3QuanNvbiIsInJlZGlyZWN0X3VyaSI6Imh0dHA6Ly9sb2NhbGhvc3Q6MzAwMC8iLCJzY29wZXMiOlsic3RvcmVfd3JpdGUiXX0.EghFuYF4NZpIHRW2RWCjjL8f8w34zA_3aGx1UedjDbQU5c_CAp94iBbCcsz6sxq-plrLGJfXZRyAOxmJ6idxYQ

[2017-11-25 23:31:57,517] [DEBUG] [rpc:390] (38918.123145522614272) No authorization header
[2017-11-25 23:31:57,522] [DEBUG] [rpc:390] (38918.123145526820864) No authorization header
[2017-11-25 23:31:57,527] [DEBUG] [rpc:3965] (38918.123145522614272) No authentication needed
[2017-11-25 23:31:57,532] [DEBUG] [rpc:3965] (38918.123145526820864) No authentication needed
127.0.0.1 - - [25/Nov/2017 23:31:57] "OPTIONS /v1/wallet/payment_address HTTP/1.1" 200 -
127.0.0.1 - - [25/Nov/2017 23:31:57] "GET /v1/node/ping HTTP/1.1" 200 -
[2017-11-25 23:31:57,542] [ERROR] [rpc:4005] (38918.123145526820864) [Errno 32] Broken pipe
Traceback (most recent call last):
  File "/tmp/blockstack-venv/lib/python2.7/site-packages/blockstack_client/rpc.py", line 4002, in _dispatch
    return route_method( session, path_info, *route_args )
  File "/tmp/blockstack-venv/lib/python2.7/site-packages/blockstack_client/rpc.py", line 2981, in GET_ping
    self._reply_json({'status': 'alive', 'version': SERIES_VERSION})
  File "/tmp/blockstack-venv/lib/python2.7/site-packages/blockstack_client/rpc.py", line 231, in _reply_json
    self._send_headers(status_code=status_code)
  File "/tmp/blockstack-venv/lib/python2.7/site-packages/blockstack_client/rpc.py", line 218, in _send_headers
    self.send_response(status_code)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/BaseHTTPServer.py", line 393, in send_response
    (self.protocol_version, code, message))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 328, in write
    self.flush()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 307, in flush
    self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe
127.0.0.1 - - [25/Nov/2017 23:31:57] "GET /v1/node/ping HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 599, in process_request_thread
    self.finish_request(request, client_address)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 334, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 657, in __init__
    self.finish()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 716, in finish
    self.wfile.close()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 283, in close
    self.flush()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 307, in flush
    self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe
[2017-11-25 23:31:57,653] [DEBUG] [rpc:3923] (38918.123145522614272) 
full path: /v1/wallet/payment_address

Any help would be appreciated!

wackenvoss avatar Nov 26 '17 18:11 wackenvoss

@jcnelson @kantai

wackenvoss avatar Nov 26 '17 18:11 wackenvoss

We are looking into this!

jackzampolin avatar Nov 27 '17 20:11 jackzampolin

K cool, @jackzampolin can we get this completely fixed by Friday? Cryptoportfolio apps will begin being judged right after that

pstan26 avatar Nov 28 '17 17:11 pstan26

Actually perhaps @kantai is the man for this job?

pstan26 avatar Nov 28 '17 17:11 pstan26

@jackzampolin or @kantai I'd love to screenshare with you guys if you think that would help.

cwackerfuss-rl avatar Nov 28 '17 17:11 cwackerfuss-rl

Hey @cwackerfuss --

That's a pretty strange error. Seems like something went wrong in the Python HTTP libraries. Unfortunately, I'm not able to replicate this on my end (tried logging in and out of the Coins app a bunch of times) -- what version of Blockstack are using?

kantai avatar Nov 28 '17 18:11 kantai

Hey @kantai --

I know, it's very strange! I'm running v0.21.1 right now, although this has happened on various versions and multiple users have reported the issue:

@pstan26 got it: screen shot 2017-11-28 at 12 22 49 pm

Xan also ran into this bug.

And then Miphe ran into the bug: screen shot 2017-11-28 at 12 21 40 pm

It's a big issue right now since it prevents users from doing anything with our app.

cwackerfuss-rl avatar Nov 28 '17 18:11 cwackerfuss-rl

Okay, it might be an OS-specific issue then. I'll have to fire this up on macOS.

kantai avatar Nov 28 '17 18:11 kantai

Thanks Aaron -- Friday is the deadline for all the competitors to submit their apps so getting this fixed prior would be a relief.

On Tue, Nov 28, 2017 at 1:58 PM, Aaron Blankstein [email protected] wrote:

Okay, it might be an OS-specific issue then. I'll have to fire this up on macOS.

On Nov 28, 2017 1:25 PM, "Chase Wackerfuss" [email protected] wrote:

Hey @kantai https://github.com/kantai --

I know, it's very strange! I'm running v0.21.1 right now, although this has happened on various versions and multiple users have reported the issue:

@pstan26 https://github.com/pstan26 got it: [image: screen shot 2017-11-28 at 12 22 49 pm] <https://user-images.githubusercontent.com/25306403/33336948-1bc8a720- d437-11e7-9e25-43127597228b.png>

Xan also ran into this bug.

And then Miphe ran into the bug: [image: screen shot 2017-11-28 at 12 21 40 pm] <https://user-images.githubusercontent.com/25306403/33336977-2bd9330a- d437-11e7-9069-31f48d78d09c.png>

It's a big issue right now since it prevents users from doing anything with our app.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <https://github.com/blockstack/blockstack-core/issues/689#issuecomment- 347617202>, or mute the thread <https://github.com/notifications/unsubscribe- auth/ABGaEB6dVxWl6BRGF0wAmUW8-NMCWYmfks5s7FAngaJpZM4Qq36X>

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/blockstack/blockstack-core/issues/689#issuecomment-347627765, or mute the thread https://github.com/notifications/unsubscribe-auth/AFWIsI-w4WsVmDlj-YWoEhFfYkVjulfBks5s7FfygaJpZM4Qq36X .

pstan26 avatar Nov 28 '17 19:11 pstan26

Well, after taking a look at this, it looks like it's mac-specific and has something to do with some strange socket interactions between Python's SimpleHTTPServer and Chrome. I couldn't replicate it with other browsers, but it was very sporadic even in Chrome for me. Does this happen for you in Safari or Firefox?

kantai avatar Nov 28 '17 22:11 kantai

Oh interesting. I can give Chrome and Firefox a shot and get back to you. Do you think the other issue I created here: https://github.com/blockstack/blockstack-core/issues/690 has something to do with that as well?

wackenvoss avatar Nov 28 '17 22:11 wackenvoss

Probably not. The 500 server error is a kind of generic "something broke on the server" response. Would need to take a closer look at the api_endpoint.log to see what's going on there.

kantai avatar Nov 28 '17 22:11 kantai

I'll try to make that happen.

wackenvoss avatar Nov 28 '17 22:11 wackenvoss

By the way, Miphe on Slack is using the Brave browser, but the rest of us are using Chrome.

wackenvoss avatar Nov 28 '17 22:11 wackenvoss

As a temporary workaround, does simply retrying the getFile once or twice work?

kantai avatar Nov 28 '17 23:11 kantai

Thanks Aaron -- Friday is the deadline for all the competitors to submit their apps so getting this fixed prior would be a relief.

@pstan26 in the interests of managing expectations - we're not likely to get this fixed until the next browser release which will like happen after the end of our sprint, which due to our team retreat will be around next thursday.


Irregardless of this particular bug: blockstack apps are writing across an unreliable network, (the internet!) that has no guaranteed quality of service and any number of things that can (and will!) break. Using gaia storage isn't like writing to your database in a centralized app where you control the connection between your application server and the database.

Reads and writes can fail for any number of reasons: because the network is down, the gaia hub is temporarily unreachable, because there are bugs in software somewhere, etc. Apps should be built to be able to handle and recover from read / write errors. For example, if there's an error, they could transparently retry the write.

In the future, we can consider moving this unreliable network handling logic into blockstack.js, but at the moment it's not there.

In this case, it appears the failure is from a bug that results from a particular combination of software. We do need to fix this. However, an app written to handle reading and writing from an unreliable media as described above shouldn't be affected by this bug. In other words, the best way to handle this particular bug in the next week or so is to make sure your app has logic to handle reads and/or writes that fail.

larrysalibra avatar Nov 28 '17 23:11 larrysalibra

Having talked out-of-band with @kantai, I have a hunch that this might be related to the fact that the API server (class BlockstackAPIEndpoint) is derived from the SocketServer.ThreadingMixin class. The specific bugs @kantai saw in the Chrome console looked like some HTTP requests were invalid because the packet stream itself got cut off. I don't have a good explanation as to why this appears this way, but my gut feeling is that might be some sort of data race in the Mac OS SockerServer implementation.

I would be curious to know if this bug goes away when this parent class is removed (in blockstack_client/rpc.py).

jcnelson avatar Nov 28 '17 23:11 jcnelson

Larry you raise a good point. In our app right now when we can't make a successful connection through Gaia we show the onboarding screen in an assumption that you're new. That's really not an acceptable way to recover from not being able to retrieve a users data. More meaningful errors are required on my app in that case. Still, we need to limit the amount of data failures so users will trust that Gaia is a reliable way to manage data. Im preaching to the choir though. :) I appreciate you guys looking into this.

On Nov 28, 2017 5:43 PM, "Jude Nelson" [email protected] wrote:

Having talked out-of-band with @kantai https://github.com/kantai, I have a hunch that this might be related to the fact that the API server (class BlockstackAPIEndpoint) is derived from the SocketServer.ThreadingMixin class. The specific bugs @kantai https://github.com/kantai saw in the Chrome console looked like some HTTP requests were invalid because the packet stream itself got cut off. I don't have a good explanation as to why this appears this way, but my gut feeling is that might be some sort of data race in the Mac OS SockerServer implementation.

I would be curious to know if this bug goes away when this parent class is removed (in blockstack_client/rpc.py).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/blockstack/blockstack-core/issues/689#issuecomment-347702375, or mute the thread https://github.com/notifications/unsubscribe-auth/AEM4bJtD3o7KTV4zjDqBjae5LGr6fcUFks5s7JqLgaJpZM4Qq36X .

wackenvoss avatar Nov 29 '17 00:11 wackenvoss

I would be curious to know if this bug goes away when this parent class is removed (in blockstack_client/rpc.py).

Removing the TreadingMixin makes the API endpoint very unresponsive, so I'm not sure if the bug goes away, or I'm just unable to witness it (the bug itself exhibits timing-specific behavior)

kantai avatar Dec 01 '17 16:12 kantai

Closing this issue, as this endpoint is now no longer used by the latest versions of blockstack.js and blockstack-browser.

kantai avatar Jan 09 '18 18:01 kantai