Comments (22)
We've managed to temporary solve this issue by making some small changes on Python libraries.
This are the changes.
/usr/lib/python2.7/wsgiref/simple_server.py
Class ServerHandler
class ServerHandler(SimpleHandler):
server_software = software_version
def close(self):
try:
# if self.status is not defined, pass hardcoded status
status = "200"
if self.status:
status = self.status.split(' ', 1)[0]
self.request_handler.log_request(
status, self.bytes_sent
)
finally:
SimpleHandler.close(self)
/usr/lib/python2.7/wsgiref/handles.py
Class BaseHandler
method "finish_response"
def finish_response(self):
try:
if not self.result_is_file() or not self.sendfile():
for data in self.result:
# self.write(data)
# convert data to str
self.write(str(data))
self.finish_content()
finally:
self.close()
method "client_is_modern"
def client_is_modern(self):
"""True if client can accept status and headers"""
# check if self.environ is defined
if not self.environ:
return False
return self.environ['SERVER_PROTOCOL'].upper() != 'HTTP/0.9'
/cc @gidgreen
from multichain-explorer.
OK - thanks for the update. It fixed the search redirect problem we were seeing, but there's obviously a version/configuration issue here. We'll keep working on it.
from multichain-explorer.
Thanks, so seems very specific to Python 2.7.12/13. We'll look into it and let you know if we need any more info.
from multichain-explorer.
@ottodv What version of python are you running? 2.7.???
from multichain-explorer.
Python 2.7.12
from multichain-explorer.
This error only occurs on the search page?
from multichain-explorer.
Yes, that's the only situation in which I encounter this error.
BTW, I also did a new install from scratch on another VM, but using CentOS this time, to see if the error occurs there too.
The result is exactly the same error in the same situation (i.e. doing a search).
The Python version on that VM is 2.7.5
from multichain-explorer.
This should now be fixed in the latest version of the Explorer - if so please close the issue.
from multichain-explorer.
I installed the lastest version from github as you suggested. Search still doesn't work, but in addition to the previous error, I got an additional error message in the log (on Ubuntu, strangely not on CentOS). It doesn't look very helpful, but I post it here just in case it might be to you.
AttributeError: 'NoneType' object has no attribute 'split'
myheader': [], 'title': ['MultiChain Explorer', ' ', '0.8pre'], 'dotdot': '', 'params': {'q': ['100']}, 'env': {'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'LC_ALL': 'en_US.UTF-8', 'wsgi.multiprocess': False, 'SERVER_PORT': '80', 'HTTP_REFERER': 'http://<REMOVED URL>/chains', 'wsgi.file_wrapper': <class wsgiref.util.FileWrapper at 0x7f4ab654bbb0>, 'SERVER_SOFTWARE': 'WSGIServer/0.1 Python/2.7.12', 'SERVER_PROTOCOL': 'HTTP/1.1', 'wsgi.multithread': True, 'SCRIPT_NAME': '', 'wsgi.input': <socket._fileobject object at 0x7f4ab60428d0>, 'REQUEST_METHOD': 'GET', 'LOGNAME': 'node', 'PATH_INFO': '/search', 'HOME': '/home/node', 'QUERY_STRING': 'q=100', 'PATH': '/usr/bin:/bin:/home/node/bin:/usr/local/bin', 'REMOTE_ADDR': '<REMOVED IP>', '_': '/usr/bin/python', 'wsgi.version': (1, 0), 'LANG': 'en_US.UTF-8', 'SHELL': '/bin/sh', 'HTTP_CONNECTION': 'keep-alive', 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0', 'SERVER_NAME': 'explore.localdomain', 'GATEWAY_INTERFACE': 'CGI/1.1', 'SHLVL': '2', 'OLDPWD': '/home/node', 'HTTP_X_COOKIESOK': 'I explicitly accept all cookies', 'HTTP_ACCEPT_LANGUAGE': 'en-US,en;q=0.8,nl;q=0.7,fr;q=0.5,et;q=0.3,de;q=0.2', 'wsgi.errors': <open file '<stderr>', mode 'w' at 0x7f4ab78f41e0>, 'wsgi.url_scheme': 'http', 'wsgi.run_once': False, 'PWD': '/home/node/multichain-explorer', 'CONTENT_TYPE': 'text/plain', 'CONTENT_LENGTH': '', 'HTTP_HOST': '<REMOVED IP>', 'HTTP_UPGRADE_INSECURE_REQUESTS': '1', 'REMOTE_HOST': '', 'HTTP_ACCEPT_ENCODING': 'gzip, deflate'}}
----------------------------------------
Exception happened during processing of request from ('<REMOVED IP>', 58796)
----------------------------------------
{'status': '200 OK', 'body': [], 'template': u'\n<!DOCTYPE html>\n<html lang="en">\n<head>\n <meta charset="utf-8">\n <meta http-equiv="X-UA-Compatible" content="IE=edge">\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->\n\n <title>%(title)s</title>\n\n <!-- Bootstrap and Theme -->\n <link href="%(dotdot)s%(STATIC_PATH)scss/bootstrap.min.css" rel="stylesheet">\n <link href="%(dotdot)s%(STATIC_PATH)scss/bootstrap-theme.min.css" rel="stylesheet">\n\n <!-- jQuery (necessary for Bootstrap\'s JavaScript plugins) -->\n <script src="%(dotdot)s%(STATIC_PATH)sjs/jquery-1.11.3.min.js"></script>\n <!-- Include all compiled plugins (below), or include individual files as needed -->\n <script src="%(dotdot)s%(STATIC_PATH)sjs/bootstrap.min.js"></script>\n\n %(myheader)s\n</head>\n<body>\n <div class="container">\n\t<table><td>\n\t<a title="Back to home" href="%(dotdot)s%(HOMEPAGE)s"><img src="%(dotdot)s%(STATIC_PATH)slogo32.png" alt="MultiChain logo" /></a>\n\t</td><td style="padding-left: 10px;" valign="middle">\n\t<h1>%(h1)s<h1>\n\t</td></table>\n %(body)s\n <!--<p><a href="%(dotdot)sq">API</a> (machine-readable pages)</p>-->\n <br><br>\n <p style="font-size: smaller">\n <span style="font-style: italic">\n Powered by <a href="%(ABE_URL)s">%(APPNAME)s</a>\n </span>\n %(download)s\n </p>\n </div>\n</body>\n</html>\n', 'chain': None, 'start_response': <bound method ServerHandler.start_response of <wsgiref.simple_server.ServerHandler instance at 0x7f4ab5f56710>>, 'content_type': 'text/html; charset=utf-8', 'myheader': [], 'title': ['MultiChain Explorer', ' ', '0.8pre'], 'dotdot': '', 'params': {'q': ['100']}, 'env': {'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'LC_ALL': 'en_US.UTF-8', 'wsgi.multiprocess': False, 'SERVER_PORT': '80', 'HTTP_REFERER': 'http://<REMOVED URL>/chains', 'wsgi.file_wrapper': <class wsgiref.util.FileWrapper at 0x7f4ab654bbb0>, 'SERVER_SOFTWARE': 'WSGIServer/0.1 Python/2.7.12', 'SERVER_PROTOCOL': 'HTTP/1.1', 'wsgi.multithread': True, 'SCRIPT_NAME': '', 'wsgi.input': <socket._fileobject object at 0x7f4ab60428d0>, 'REQUEST_METHOD': '<REMOVED IP> - - [29/Mar/2017 18:13:32] "GET /search?q=100 HTTP/1.1" 301 0
from multichain-explorer.
That's an error we should have fixed - did you rerun the python setup.py
command from the README file?
from multichain-explorer.
Did now (python setup.py install), but still no dice. Even restarted the VMs. I am now back to seeing only the error I quoted in my opening post, on both the Ubuntu and CentOS severs.
from multichain-explorer.
Same error here, search still does not work.
from multichain-explorer.
ping
from multichain-explorer.
If you're seeing this problem please post your Python version.
from multichain-explorer.
I have the same error described by @ottodv (self.status.split(' ',1)[0], self.bytes_sent)
$ python --version
Python 2.7.13
Update: trying to run with python-3.5 i got this error:
Traceback (most recent call last):
File "/usr/local/lib/python3.5/runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/local/lib/python3.5/runpy.py", line 153, in _get_module_details
code = loader.get_code(mod_name)
File "<frozen importlib._bootstrap_external>", line 775, in get_code
File "<frozen importlib._bootstrap_external>", line 735, in source_to_code
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "/srv/multichain-explorer/Mce/abe.py", line 1206
print "Exception:", e
^
SyntaxError: Missing parentheses in call to 'print'
from multichain-explorer.
python --version
Python 2.7.12
from multichain-explorer.
Count me in if we have to test something on my box, I can post results, versions, etc.
from multichain-explorer.
What version do you recommend? I will try to manually change Python version until we can fix it.
UPDATE: my traceback
Traceback (most recent call last):
File "/usr/lib/python2.7/SocketServer.py", line 290, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 318, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 331, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python2.7/SocketServer.py", line 652, in __init__
self.handle()
File "/usr/lib/python2.7/wsgiref/simple_server.py", line 131, in handle
handler.run(self.server.get_app())
File "/usr/lib/python2.7/wsgiref/handlers.py", line 92, in run
self.close()
File "/usr/lib/python2.7/wsgiref/simple_server.py", line 33, in close
self.status.split(' ',1)[0], self.bytes_sent
AttributeError: 'NoneType' object has no attribute 'split'
from multichain-explorer.
I also tried it on CentOS with Python version 2.7.5. Same Error. See my earlier comment from March 29.
from multichain-explorer.
@maxidev maybe you can switch the fix to a PR?
from multichain-explorer.
@reiven I can't because this was done on Python libraries instead of Multichain-explorer code.
from multichain-explorer.
i found same errors. i try search by address, txid, blocknumber...,but only blocknumber is success, others will cause page crash.
i installed latest explore and 100009 multichain
after i modify simple_server.py & handles.py, search works correctly.
But, this is finally solution?
from multichain-explorer.
Related Issues (20)
- Sometimes explore is very slowly HOT 2
- It will always be "connection refused" and multichaind will always to abort HOT 2
- RPC failed: [Errno socket error] [Errno 111] Connection refused catch_up_rpc: abort
- Its posibble look output in json format HOT 1
- Assetref encoded
- Can't use MySQL db HOT 2
- sendwithdata - show raw data or json in explorer
- getaddressbalances and getunspent
- native currency not show with "getaddressbalances" function in non-owned wallets
- Mysql & Postgresql
- SQL - not working HOT 1
- Is it possible to use Mongodb ?
- code to show amount ?
- Configuration of Multichain.conf
- KeyError: '5a8ec07be00d3cf3824377aa0f1cfb7c' HOT 1
- [Questions] Is possibile to run multichain for CryptoNight algoritm? HOT 2
- Multichain 2.0 Support HOT 7
- Dangerous use of .index in Parse Functions (Error on parse_new_issuance_metadata_10007) HOT 2
- Error while syncing blocks HOT 2
- Multichain-Explorer Status No Connection
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from multichain-explorer.