maggienj / ActiveData

Provide high speed filtering and aggregation over data
Mozilla Public License 2.0
0 stars 0 forks source link

Log.error is expecting a unicode template. #8

Closed maggienj closed 7 years ago

maggienj commented 7 years ago

Merged the upstream master changes to local es5 ( pushed ) Reran ...

C:\Python27\python.exe "C:\Program Files\JetBrains\PyCharm Community Edition 2017.1.1\helpers\pydev\pydevd.py" --multiproc --qt-support --client 127.0.0.1 --port 60284 --file C:/Users/user/PycharmProjects/ActiveData/active_data/app.py --settings=tests/es5/maggie_config.json
pydev debugger: process 17460 is connecting

Connected to pydev debugger (build 171.4163.6)
kabalidaa (pid 17460) - 2017-05-25 20:58:22 - Main Thread - "C:/Users/user/PycharmProjects/ActiveData/active_data/app.py:112" (setup) - WARNING: ActiveData is in debug mode
    File "C:/Users/user/PycharmProjects/ActiveData/active_data/app.py", line 112, in setup
    File "C:/Users/user/PycharmProjects/ActiveData/active_data/app.py", line 195, in <module>
    File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.1.1\helpers\pydev\pydevd.py", line 1015, in run
    File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.1.1\helpers\pydev\pydevd.py", line 1578, in <module>

kabalidaa (pid 17460) - 2017-05-25 20:58:23 - Main Thread - "elasticsearch.py:120" (__init__) - 
********************************************************************************
** elasticsearch debugging for http://localhost:9200/saved_queries20170524_113002/query is on
********************************************************************************
kabalidaa (pid 17460) - 2017-05-25 20:58:23 - Main Thread - "elasticsearch.py:300" (extend) - Timer start: Add 1.0 documents to saved_queries20170524_113002
kabalidaa (pid 17460) - 2017-05-25 20:58:23 - Main Thread - "elasticsearch.py:352" (extend) - Timer end  : Add 1.0 documents to saved_queries20170524_113002 (took 0.073 seconds)
kabalidaa (pid 17460) - 2017-05-25 20:58:23 - Main Thread - "elasticsearch.py:120" (__init__) - 
********************************************************************************
** elasticsearch debugging for http://localhost:9200/saved_queries20170524_113002/query is on
********************************************************************************
 * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
kabalidaa (pid 17460) - 2017-05-25 20:58:39 - Main Thread - "jx.py:36" (jx_query) - Timer start: total duration
kabalidaa (pid 17460) - 2017-05-25 20:58:39 - Main Thread - "jx.py:38" (jx_query) - Timer start: preamble
kabalidaa (pid 17460) - 2017-05-25 20:58:40 - Main Thread - "__init__.py:104" (test_mode_wait) - Mark _id dirty at 2017-05-25 20:58:39.966000
kabalidaa (pid 17460) - 2017-05-25 20:58:40 - Main Thread - "__init__.py:115" (test_mode_wait) - wait for column (table=testing_000_z, name=_id) metadata to arrive
Log.error was expecting a unicode template127.0.0.1 - - [25/May/2017 16:58:41] "GET /query HTTP/1.1" 400 -
kabalidaa (pid 17460) - 2017-05-25 20:58:41 - Main Thread - "__init__.py:124" (test_mode_wait) - fresh column name= updated=2017-05-25 20:58:40.188000 parts=
kabalidaa (pid 17460) - 2017-05-25 20:58:41 - Main Thread - "jx.py:57" (jx_query) - Timer end  : preamble (took 1.173 seconds)
kabalidaa (pid 17460) - 2017-05-25 20:58:41 - Main Thread - "jx.py:60" (jx_query) - Timer start: translate
kabalidaa (pid 17460) - 2017-05-25 20:58:41 - Main Thread - "elasticsearch.py:948" (__init__) - 
********************************************************************************
** Elasticsearch debugging on "testing_000_z" is on
********************************************************************************
kabalidaa (pid 17460) - 2017-05-25 20:58:41 - Main Thread - "elasticsearch.py:948" (__init__) - 
********************************************************************************
** Elasticsearch debugging on "testing_000_z" is on
********************************************************************************
kabalidaa (pid 17460) - 2017-05-25 20:58:41 - Main Thread - "setop.py:191" (extract_rows) - Timer start: call to ES
kabalidaa (pid 17460) - 2017-05-25 20:58:41 - Main Thread - "setop.py:193" (extract_rows) - Timer end  : call to ES (took 0.001 seconds)
kabalidaa (pid 17460) - 2017-05-25 20:58:41 - Main Thread - "jx.py:65" (jx_query) - Timer end  : translate (took 0.236 seconds)
kabalidaa (pid 17460) - 2017-05-25 20:58:41 - Main Thread - "jx.py:81" (jx_query) - Timer end  : total duration (took 1.411 seconds)
kabalidaa (pid 17460) - 2017-05-25 20:58:41 - Main Thread - "__init__.py:32" (send_error) - WARNING: Could not process
{"meta": {"testing": true}, "from": "testing_000_z", "select": "_id", "format": "cube"}
    File "C:\Users\user\PycharmProjects\ActiveData\active_data\actions\__init__.py", line 32, in send_error
    File "C:\Users\user\PycharmProjects\ActiveData\active_data\actions\jx.py", line 100, in jx_query
    File "C:\Users\user\PycharmProjects\ActiveData\active_data\__init__.py", line 54, in output
    File "C:\Python27\lib\site-packages\flask\app.py", line 1598, in dispatch_request
    File "C:\Python27\lib\site-packages\flask\app.py", line 1612, in full_dispatch_request
    File "C:\Python27\lib\site-packages\flask\app.py", line 1982, in wsgi_app
    File "C:\Python27\lib\site-packages\flask\app.py", line 1994, in __call__
    File "C:\Python27\lib\site-packages\werkzeug\serving.py", line 197, in execute
    File "C:\Python27\lib\site-packages\werkzeug\serving.py", line 209, in run_wsgi
    File "C:\Python27\lib\site-packages\werkzeug\serving.py", line 267, in handle_one_request
    File "C:\Python27\lib\BaseHTTPServer.py", line 340, in handle
    File "C:\Python27\lib\site-packages\werkzeug\serving.py", line 232, in handle
    File "C:\Python27\lib\SocketServer.py", line 652, in __init__
    File "C:\Python27\lib\SocketServer.py", line 331, in finish_request
    File "C:\Python27\lib\SocketServer.py", line 596, in process_request_thread
    File "C:\Python27\lib\threading.py", line 754, in run
    File "C:\Python27\lib\threading.py", line 801, in __bootstrap_inner
    File "C:\Python27\lib\threading.py", line 774, in __bootstrap
caused by
    ERROR: problem
    File "C:\Users\user\PycharmProjects\ActiveData\pyLibrary\queries\jx_usingES.py", line 170, in query
    File "C:\Users\user\PycharmProjects\ActiveData\pyLibrary\queries\jx.py", line 71, in run
    File "C:\Users\user\PycharmProjects\ActiveData\active_data\actions\jx.py", line 62, in jx_query
    File "C:\Users\user\PycharmProjects\ActiveData\active_data\__init__.py", line 54, in output
    File "C:\Python27\lib\site-packages\flask\app.py", line 1598, in dispatch_request
    File "C:\Python27\lib\site-packages\flask\app.py", line 1612, in full_dispatch_request
    File "C:\Python27\lib\site-packages\flask\app.py", line 1982, in wsgi_app
    File "C:\Python27\lib\site-packages\flask\app.py", line 1994, in __call__
    File "C:\Python27\lib\site-packages\werkzeug\serving.py", line 197, in execute
    File "C:\Python27\lib\site-packages\werkzeug\serving.py", line 209, in run_wsgi
    File "C:\Python27\lib\site-packages\werkzeug\serving.py", line 267, in handle_one_request
    File "C:\Python27\lib\BaseHTTPServer.py", line 340, in handle
    File "C:\Python27\lib\site-packages\werkzeug\serving.py", line 232, in handle
    File "C:\Python27\lib\SocketServer.py", line 652, in __init__
    File "C:\Python27\lib\SocketServer.py", line 331, in finish_request
    File "C:\Python27\lib\SocketServer.py", line 596, in process_request_thread
    File "C:\Python27\lib\threading.py", line 754, in run
    File "C:\Python27\lib\threading.py", line 801, in __bootstrap_inner
    File "C:\Python27\lib\threading.py", line 774, in __bootstrap
caused by
    ERROR: Log.error was expecting a unicode template
    File "C:\Users\user\PycharmProjects\ActiveData\mo_logs\__init__.py", line 376, in error
    File "C:\Users\user\PycharmProjects\ActiveData\pyLibrary\queries\es14\setop.py", line 192, in extract_rows
    File "C:\Users\user\PycharmProjects\ActiveData\pyLibrary\queries\es14\setop.py", line 63, in es_setop
    File "C:\Users\user\PycharmProjects\ActiveData\pyLibrary\queries\jx_usingES.py", line 159, in query
    File "C:\Users\user\PycharmProjects\ActiveData\pyLibrary\queries\jx.py", line 71, in run
    File "C:\Users\user\PycharmProjects\ActiveData\active_data\actions\jx.py", line 62, in jx_query
    File "C:\Users\user\PycharmProjects\ActiveData\active_data\__init__.py", line 54, in output
    File "C:\Python27\lib\site-packages\flask\app.py", line 1598, in dispatch_request
    File "C:\Python27\lib\site-packages\flask\app.py", line 1612, in full_dispatch_request
    File "C:\Python27\lib\site-packages\flask\app.py", line 1982, in wsgi_app
    File "C:\Python27\lib\site-packages\flask\app.py", line 1994, in __call__
    File "C:\Python27\lib\site-packages\werkzeug\serving.py", line 197, in execute
    File "C:\Python27\lib\site-packages\werkzeug\serving.py", line 209, in run_wsgi
    File "C:\Python27\lib\site-packages\werkzeug\serving.py", line 267, in handle_one_request
    File "C:\Python27\lib\BaseHTTPServer.py", line 340, in handle
    File "C:\Python27\lib\site-packages\werkzeug\serving.py", line 232, in handle
    File "C:\Python27\lib\SocketServer.py", line 652, in __init__
    File "C:\Python27\lib\SocketServer.py", line 331, in finish_request
    File "C:\Python27\lib\SocketServer.py", line 596, in process_request_thread
    File "C:\Python27\lib\threading.py", line 754, in run
    File "C:\Python27\lib\threading.py", line 801, in __bootstrap_inner
    File "C:\Python27\lib\threading.py", line 774, in __bootstrap
klahnakoski commented 7 years ago

yes, as per the stack trace, the problem is here:

File "C:\Users\user\PycharmProjects\ActiveData\pyLibrary\queries\es14\setop.py", line 192, in extract_rows
maggienj commented 7 years ago

That is where the Log.error logs the esquery. Not sure what datatype is accepted by this Log.error. I see different patterns... log.error ("string").... and other patterns too. still checking on this... may be use utf82unicode? need to check the acceptable params and datatypes for log.error. will check it... for the moment, commented and tried to see what the actual err msg is... (pushed)

maggienj commented 7 years ago

trying Log.error(unicode(es_query))

klahnakoski commented 7 years ago

use your IDE to go to the definition of Log.error the comments document the parameters. Also here are some docs: https://github.com/klahnakoski/mo-logs

klahnakoski commented 7 years ago

this is fixed, please close the issue