getting error when running resty-mongol in Lua through nginx - mongodb

I am getting error when trying to running resty-mongol in Lua
through nginx. The err is " attempt to index global 'bit' (a nil
value)". My environment has
https://github.com/openresty/lua-nginx-module/releases/tag/v0.10.6 -
build with nginx 1.10.1 version.
Entry thread aborted: runtime error:
...ules/lua-resty-mongol/lib/resty/mongol/object_id.lua:56: attempt to
index global 'bit' (a nil value) stack traceback: coroutine 0:
...ules/lua-resty-mongol/lib/resty/mongol/object_id.lua:56: in main
chunk [C]: in function 'require'
...e/modules/lua-resty-mongol/lib/resty/mongol/bson.lua:25: in main
chunk [C]: in function 'require'
.../modules/lua-resty-mongol/lib/resty/mongol/colmt.lua:20: in main
chunk [C]: in function 'require'
...e/modules/lua-resty-mongol/lib/resty/mongol/dbmt.lua:9: in main
chunk [C]: in function 'require'enter code here
...e/modules/lua-resty-mongol/lib/resty/mongol/init.lua:14: in main
chunk.
And after a reboot i am getting on the line
mongo:new() [string "mongo:new()"]:1: attempt to call method 'new' (a
nil value)
I started getting this error all of a sudden and now it fails
everytime. The faliure is at the load module line within my code -
require "resty.mongol" line. what possibly have gone wrong. Has
anybody faced it yet?

Related

Yocto: Failure expanding variable KERNEL_LOCALVERSION

I am facing below error while building kernel from local workspace(created by devtool modify virtual/kernel). If I do not have workspace created then I don't see any error.
ERROR: ExpansionError during parsing /home/aws-fsp-build/rax-workspace/yocto/meta-ti/recipes-kernel/linux/linux-ti-staging-rt_5.10.bb
Traceback (most recent call last):
File "Var <KERNEL_LOCALVERSION>", line 1, in <module>
bb.data_smart.ExpansionError: Failure expanding variable KERNEL_LOCALVERSION, expression was -g${#d.getVar('SRCPV', True).split('+')[1]} which triggered exception IndexError: list index out of range
Can you help me on resolving this? I need to have workspace since I am working on kernel related changes. I am using dunfell branch of meta-ti.
Loading cache: 100% |#########################################################################################################| Time: 0:00:00
Loaded 4480 entries from dependency cache.
WARNING: /home/aws-fsp-build/rax-workspace/yocto/meta-ti/recipes-kernel/linux/linux-ti-staging-rt_5.10.bb: Exception during build_dependencies for do_configure
WARNING: /home/aws-fsp-build/rax-workspace/yocto/meta-ti/recipes-kernel/linux/linux-ti-staging-rt_5.10.bb: Error during finalise of /home/aws-fsp-build/rax-workspace/yocto/meta-ti/recipes-kernel/linux/linux-ti-staging-rt_5.10.bb
ERROR: ExpansionError during parsing /home/aws-fsp-build/rax-workspace/yocto/meta-ti/recipes-kernel/linux/linux-ti-staging-rt_5.10.bb
Traceback (most recent call last):
File "Var <KERNEL_LOCALVERSION>", line 1, in <module>
bb.data_smart.ExpansionError: Failure expanding variable KERNEL_LOCALVERSION, expression was -g${#d.getVar('SRCPV', True).split('+')[1]} which triggered exception IndexError: list index out of range
WARNING: /home/aws-fsp-build/rax-workspace/yocto/meta-ti/recipes-kernel/linux/linux-ti-staging-rt_5.4.bb: Cooker received SIGTERM, shutting down...
WARNING: /home/aws-fsp-build/rax-workspace/yocto/meta-carrier/recipes-kernel/linux/linux-ti-staging_4.19.bb: Cooker received SIGTERM, shutting down...
WARNING: /home/aws-fsp-build/rax-workspace/yocto/meta-carrier/recipes-kernel/mstp-mod/mstp-mod.bb: Cooker received SIGTERM, shutting down...
Summary: There were 5 WARNING messages shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
It seems like after moving to the workspace, the SRCPV variable changes formatting, which leads to parsing failure. Try to add something like this to the build/workspace/appends/linux-ti-staging-rt_5.4.bbappend file:
KERNEL_LOCALVERSION = "-g999"

Why do I get "./gettext.so: undefined symbol: PL_thr_key" when I try to use gettext in Lua?

I want to use the gettext library with Lua, but I get an undefined symbol error when I try to load it:
require('gettext')
error loading module 'gettext' from file './gettext.so':
./gettext.so: undefined symbol: PL_thr_key
stack traceback:
[C]: in ?
[C]: in function 'require'
stdin:1: in main chunk
[C]: in ?
PL_thr_key is defined in perlapi.h, so this appears to be related to Perl.
The error comes from a module compiled against threaded Perl while your Perl installation is not threaded. Try to switch the version of Perl you're using.

repl hangs for ~15 seconds on each error (emacs + cider + boot)

I'm facing a strange behavior whenever I invoke an error in boot-cljs-repl. The repl (actually the entire emacs) hangs for about 15 seconds and after that I see the following error message below the mode-line:
error in process filter: Lisp nesting exceedsmax-lisp-eval-depth'`
An error would e.g be calling (some-nonexisting-function) from the REPL.
Additionally I get an error message inside the REPL itself. Sorry, for posting the whole thing here - I wouldn't know right now which parts are important:
box.webgl> (some-nonexisting-function)
WARNING: Use of undeclared Var box.webgl/some-nonexisting-function at line 1 <cljs repl>
#object[TypeError TypeError: Cannot read property 'call' of undefined]
TypeError: Cannot read property 'call' of undefined
at eval (eval at <anonymous> (http://localhost:3000/main.out/weasel/repl.js:30:470), <anonymous>:1\
:124)
at eval (eval at <anonymous> (http://localhost:3000/main.out/weasel/repl.js:30:470), <anonymous>:9\
:3)
at eval (eval at <anonymous> (http://localhost:3000/main.out/weasel/repl.js:30:470), <anonymous>:1\
4:4)
at http://localhost:3000/main.out/weasel/repl.js:30:465
at http://localhost:3000/main.out/weasel/repl.js:39:4
at cljs.core.MultiFn.call.G__10839__2 (http://localhost:3000/main.out/cljs/core.js:33327:106)
at cljs.core.MultiFn.call.G__10839 [as call] (http://localhost:3000/main.out/cljs/core.js:33594:20\
)
at .<anonymous> (http://localhost:3000/main.out/weasel/repl.js:184:71)
at goog.events.EventTarget.fireListeners (http://localhost:3000/main.out/goog/events/eventtarget.j\
s:284:23)
at Function.goog.events.EventTarget.dispatchEventInternal_ (http://localhost:3000/main.out/goog/ev\
ents/eventtarget.js:381:26)
recently CIDER was changed to automatically supply it's own cider-nrepl and clj-refactor middleware when starting lein, so you can (should) remove these from your ~/.lein/profifiles.clj file if you have them. This will clear up this warning. (remember to update to the latest cider emacs package.
WARNING: CIDER's version (0.12.0-snapshot) does not match
cider-nrepl's version (not installed). Things will break!
This is a problem and hopefully fixing it clears up your other problems. If not, at least solving this is a prerequisite to debugging it properly.

Error while installing lua socket

I am using lua 5.1 in a linux system.I installed the luasocket 2.0.2 using this manual.But when i execute the below code of the file test.lua
socket = require("socket")
print(socket._VERSION)
I get the following errors :
lua: ./usr/local/share/lua/5.1/socket.lua:14: loop or previous error loading module 'socket'
stack traceback:
[C]: in function 'require'
./usr/local/share/lua/5.1/socket.lua:14: in main chunk
[C]: in function 'require'
test.lua:1: in main chunk
[C]: ?
But i have included the environmental variable as below:
LUA_PATH=/usr/local/share/lua/5.1/?.lua;?.lua
LUA_CPATH=/usr/local/lib/lua/5.1/?.so;?.so
You usually get this error when you have a loop in your require calls, for example, when you do require "socket" and from that module you do require "socket" again, before the first require call is finished.
Check line 14 in socket.lua file. It should probably have something like local socket = require("socket.core") (and not require("socket")). To check if the issue is with loading socket.core, try executing require "socket.core" in your own script as it may give you a better error message.

Error on websocket when try to use Ipython notebook in emacs

Got some error message in buffer Warning when try to evaluate my code
Error (websocket): in callback `on-open': Cannot send message to a closed websocket: cl-struct-websocket-frame, text, "{\"header\":{\"msg_id\":\"14735853-0ed2-4ef4-8f5a-312a198dd251\", \"username\":\"username\"\, \"session\":\"ab484abf-d4e6-4f83-2c2-de1b65264780\", \"msg_type\":\"execute_request\"}, \"metadata\":{}, \"content\":{\"code\":\"__import__('sys').stdout.write(__import__('os').getcwd())\", \"silent\":true, \\"user_variables\":[], \"user_expressions\":{}, \"allow_stdin\":false}, \"parent_header\":{}}", nil, t
Error (websocket): in callback `on-open': Wrong type argument: arrayp, nil
Error (websocket): in callback `on-close': Wrong type argument: arrayp, nil
And on the ipython server side I saw this message
2014-03-05 23:24:40.760 [NotebookApp] WARNING | Cross Origin WebSocket Attempt.
2014-03-05 23:24:40.761 [tornado.application] ERROR | Uncaught exception in /kernels/2691bbe3-ce95-439b-a9ce-97ec52c80988/shell
Traceback (most recent call last):
File "/home/haroldwu/Python-test/lib/python3.3/site-packages/tornado/websocket.py", line 322, in wrapper
return callback(*args, **kwargs)
File "/home/haroldwu/Python-test/lib/python3.3/site-packages/IPython/html/base/zmqhandlers.py", line 114, in open
raise web.HTTPError(404)
tornado.web.HTTPError: HTTP 404: Not Found
What I have done:
Upgrade all package of my python virtualenv and global environment
Upgrade all system package (Archlinux latest 64-bit)
Upgrade all emacs package
Search the web (but found no useful result)
Ipython notebook worked on my emacs weeks ago, but somehow it dosen't work now...
I have no experience on tornado.
Thanks for your help!!! :)
I'd guess that emacs is not sending the Origin header which is checked by the Notebook WS code. See my comment https://github.com/ipython/ipython/issues/5525 .
Quick workaround is to comment out the same origin check in your /home/haroldwu/Python-test/lib/python3.3/site-packages/IPython/html/base/zmqhandlers.py:114 .
You can always add logging of parsed_origin, origin and origin_header in same_origin() function in zmqhandlers.py and fix the emacs package accordingly.