"Search by address, Block number/hash, transaction ID" option in explorer doesn't work.

+1 vote

The "Search by address, Block number/hash, transaction ID" option in multichain explorer causes the following error":

"A server error occurred. Please contact the administrator."

 

asked Feb 17, 2017 by Cypher
Are you able to review your web server's error logs to see what is reported there?
Traceback (most recent call last):
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run
    self.result = application(self.environ, self.start_response)
  File "/root/multichain-explorer/Mce/abe.py", line 332, in __call__
    return redirect(page)
  File "/root/multichain-explorer/Mce/abe.py", line 4107, in redirect
    ('Content-Type', 'text/html')])
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 180, in start_response
    assert type(val) is StringType,"Header values must be strings"
AssertionError: Header values must be strings
Thanks - we're looking into it.
Any update on this? Now I'm getting this error even on the asset details page of certain assets.
http://localhost:2750/demochain/assetref/3047-267-5096
What version of MultiChain are you running?  Do you know if this problem started with a certain version?  For the assets that are no longer show the asset details page correctly, is there anything common about those assets?

2 Answers

+1 vote
 
Best answer
This should now be fixed in the latest version of the Explorer - please confirm if that's the case.
answered Mar 29, 2017 by MultiChain
selected May 29, 2019 by Cypher
I got the latest version of multichain-explorer, cleared the database and launched the explorer. But still I'm getting the same error.
Did you rerun the "python setup.py" command from the Explorer README file? If not you still might be running a compiled version of the old Python files.
+1 vote

@Cypher What version of Python are you running?  I can't reproduce this on 2.7.12.  I think this is environmental as users did not have problems before and this issue has only recently started appearing.  The built-in http server code has not changed.  Maybe there is an issue with 2.7.13 or some other libraries?

To help debug this, in Mce/abe.py add a "print page" above this bit of code, around line 273:

if abe.fix_path_info(env):
    abe.log.debug("fixed path_info")
    return redirect(page)
answered Mar 28, 2017 by simon
edited Mar 28, 2017 by simon
The python version on the server is 2.7.12.
I've added the line "print page" before the piece of code mentioned above. Now how to proceed?
When I search by address I can observe the following in logs:

"GET /search?q=1MsPKec9zMcRu4qWnxr2NrNUvBV9By2qXZWvn8 HTTP/1.1" 301 0
Traceback (most recent call last):
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 86, in run
    self.finish_response()
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 128, in finish_response
    self.write(data)
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 204, in write
    assert type(data) is StringType,"write() argument must be string"
AssertionError: write() argument must be string
49.35.14.104 - - [29/Mar/2017 17:07:20] "GET /search?q=1MsPKec9zMcRu4qWnxr2NrNUvBV9By2qXZWvn8 HTTP/1.1" 500 59
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'
...