Giter Site home page Giter Site logo

Got error in jupyter lab about ilua HOT 19 OPEN

guysv avatar guysv commented on July 28, 2024
Got error in jupyter lab

from ilua.

Comments (19)

guysv avatar guysv commented on July 28, 2024 4

Good News! I finally got my hands on a macbook, expect a solution soon!

from ilua.

guysv avatar guysv commented on July 28, 2024 1

Hey, thanks for the report

I don't have a mac machine close by, but I must admit I also did not fiddle with jupyter lab.
Will update soon with what I find :)

from ilua.

guysv avatar guysv commented on July 28, 2024 1

Where did you add 'stream:read'? stream is indeed a file object (a named pipe file in our case). anyway the whole netstring part is very delicate. a single byte going to the wrong place will ruin stuff for sure.

but it still reported the error

do you mean in jupyter-lab?

from ilua.

HuangJunye avatar HuangJunye commented on July 28, 2024 1

Hi, I am trying to use ILua in Jupyter notebook on macOS. It has the similar error as reported by @Freakwill

lua: ...local/lib/python3.7/site-packages/ilua/ext/netstring.lua:63: assertion failed!
stack traceback:
	[C]: in function 'assert'
	...local/lib/python3.7/site-packages/ilua/ext/netstring.lua:63: in function 'ext.netstring.read'
	/usr/local/lib/python3.7/site-packages/ilua/interp.lua:158: in main chunk
	[C]: in ?

Like @Freakwill said, ILua works perfectly in Terminal, but not on Jupyter notebook/console. I tried notebook itself and also Jupyter lab, the error message is the same.

Is there any solution for that?

from ilua.

HuangJunye avatar HuangJunye commented on July 28, 2024 1

@guysv I am not sure I am competent enough to debug it. But I will try. Will update here if I figure out anything.

from ilua.

solosito avatar solosito commented on July 28, 2024 1

@guysv I am also having issues when executing commands in macOS. It happens randomly after executing a command (quite often though). For me the error happens when reading the chars of the message in netstring.lua the assertion fails. More precisely, here:

local char_read = assert(stream:read(1))

I guess that's because the while before polls faster than the writing can do? I am happy to provide more debug data if needed.

from ilua.

guysv avatar guysv commented on July 28, 2024

Hey, could you recreate the error using

ILUA_LOG_LEVEL=debug jupyterlab --debug

and put your output here? (console & UI errors)

from ilua.

Freakwill avatar Freakwill commented on July 28, 2024

The ilua in bash works well. The console and UI always report such error after several executing.
I ran it with jupyter lab --debug, but got nothing valuable, such as (I don't know how to set ILUA_LOG_LEVEL=debug)

[D 09:28:23.857 LabApp] activity on 6a280794-e3d2-4ccb-afa9-44dfe80430ca: status
[D 09:28:23.858 LabApp] activity on 6a280794-e3d2-4ccb-afa9-44dfe80430ca: execute_input
[D 09:28:23.862 LabApp] activity on 6a280794-e3d2-4ccb-afa9-44dfe80430ca: error
[D 09:28:23.865 LabApp] activity on 6a280794-e3d2-4ccb-afa9-44dfe80430ca: status
[D 09:28:23.870 LabApp] Accepting token-authenticated connection from ::1
[D 09:28:23.876 LabApp] 200 GET /api/contents/?content=1&1544664503862 (::1) 6.28ms
[D 09:28:27.759 LabApp] Accepting token-authenticated connection from ::1
[D 09:28:27.760 LabApp] 200 GET /api/sessions?1544664507757 (::1) 1.86ms
[D 09:28:27.762 LabApp] Accepting token-authenticated connection from ::1
[D 09:28:27.763 LabApp] 200 GET /api/terminals?1544664507757 (::1) 1.48ms
[D 09:28:34.254 LabApp] Accepting token-authenticated connection from ::1

from ilua.

guysv avatar guysv commented on July 28, 2024

ILUA_LOG_LEVEL is a environment variable that when set, will configure ILua to pump up verbose messages. prepending ILUA_LOG_LEVEL=debug to jupyter lab should pass it to ILua, and it will post log messages to the jupyter log conosole.

Anyways, I must say I tried to recreate the error on linux and failed. By looking at your error I guess that some component (the kernel, or at least the interpreter communication pipe handlers) of the program died prematurely, and there are two possible sources for that:

  1. Environment configuration error: Right now ILua is not very configurable, although it has reasonable defaults which do work on Windows and Linux. My guess is that maybe your MacOS Lua installation has some unexpected setup I failed to foresee. For this reason I need output logs from the ENTIRE Jupyter-lab session, so I could pin-point unexpected configuration.

  2. ILua uses linux APIs extensively, assuming for now that the same code will work for MacOS (being almost-unix and all). This assumption could be (and probably is) wrong, but because you reported that ILua do work in bash, I can only assume that most of the project do work as expected, so this is the weaker case.

Anyway I should work on emitting more indicative exception messages as I spot that your error could be improved to become less cryptic. I will work on that on the upcoming release, so please stay tuned!

from ilua.

Freakwill avatar Freakwill commented on July 28, 2024

Thank you.
Following is the output until the cryptic error. It kept working for 19 executions, a new record.

[~] ILUA_LOG_LEVEL=debug jupyter lab
[W 17:37:14.931 LabApp] extensions are aborted,use nbserverextensions
[I 17:37:15.223 LabApp] [jupyter_nbextensions_configurator] enabled 0.4.0
[I 17:37:15.229 LabApp] JupyterLab extension loaded from /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/jupyterlab
[I 17:37:15.229 LabApp] JupyterLab application directory is /Library/Frameworks/Python.framework/Versions/3.6/share/jupyter/lab
[W 17:37:15.231 LabApp] JupyterLab server extension not enabled, manually loading...
[I 17:37:15.235 LabApp] JupyterLab extension loaded from /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/jupyterlab
[I 17:37:15.235 LabApp] JupyterLab application directory is /Library/Frameworks/Python.framework/Versions/3.6/share/jupyter/lab
[I 17:37:15.236 LabApp] launch notebooks in path: /Users/william/Folders/jupyter
[I 17:37:15.236 LabApp] running in: http://localhost:8888/?token=4d60d03c25e4fddc8a52b04b393438df56aa867330ba02b9
[I 17:37:15.236 LabApp] stop the server and close the kernels with control-c (...).
[C 17:37:15.237 LabApp]

    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://localhost:8888/?token=4d60d03c25e4fddc8a52b04b393438df56aa867330ba02b9
[I 17:37:15.502 LabApp] Accepting one-time-token-authenticated connection from ::1
[I 17:37:17.017 LabApp] Node v11.4.0

[I 17:37:17.516 LabApp] Build is up to date
[E 17:37:18.409 LabApp] Notebook JSON is invalid: Additional properties are not allowed ('execution_count' was unexpected)

    Failed validating 'additionalProperties' in error:

    On instance['cells'][4]['outputs'][0]:
    {'ename': 'n/a',
     'evalue': "(ilua):1: attempt to concatenate a nil value (global 'a')",
     'execution_count': 1,
     'output_type': 'error',
     'traceback': ["(ilua):1: attempt to concatenate a nil value (global 'a')",
                   'stack traceback:',
                   '\t(ilua):1: in main chunk',
                   "\t[C]: in function 'xpcall'",
                   '\t'
                   '...Versions/3.6/lib/python3.6/site-packages/ilua/interp.lua:70:...',
                   '\t'
                   '...Versions/3.6/lib/python3.6/site-packages/ilua/interp.lua:160...',
                   '\t[C]: in ?']}
[I 17:37:19.733 LabApp] Kernel started: 340a3dc0-a55a-47a0-ad3c-447600d6a356
[I 17:37:20.380 LabApp] Kernel started: c814bcd9-7d2a-4360-81c3-8913f6497f22
[I 17:37:20.432 LabApp] Kernel started: 8daa0f68-f4c8-4680-b0a3-ae5b50b85f03
[I 17:37:21.197 LabApp] Adapting to protocol v5.1 for kernel 340a3dc0-a55a-47a0-ad3c-447600d6a356
[I 17:37:21.198 LabApp] Adapting to protocol v5.1 for kernel 340a3dc0-a55a-47a0-ad3c-447600d6a356
[I 17:37:21.677 LabApp] Adapting to protocol v5.1 for kernel c814bcd9-7d2a-4360-81c3-8913f6497f22
[I 17:37:21.678 LabApp] Adapting to protocol v5.1 for kernel c814bcd9-7d2a-4360-81c3-8913f6497f22
2018-12-14T17:37:21+0800 [ilua.kernel.ILuaKernel#debug] Launching child lua
2018-12-14T17:37:21+0800 [ilua.proto.OutputCapture#debug] Process is running
[I 17:37:21.923 LabApp] Adapting to protocol v5.3.0 for kernel 8daa0f68-f4c8-4680-b0a3-ae5b50b85f03
[I 17:37:21.927 LabApp] Adapting to protocol v5.3.0 for kernel 8daa0f68-f4c8-4680-b0a3-ae5b50b85f03
2018-12-14T17:37:21+0800 [ilua.proto.InterpreterProtocol#debug] Interpreter connections eastablished
2018-12-14T17:37:21+0800 [ilua.kernel.ILuaKernel#debug] Lua version is 5.3
[I 17:37:21.947 LabApp] Adapting to protocol v5.3.0 for kernel 8daa0f68-f4c8-4680-b0a3-ae5b50b85f03
2018-12-14T17:37:56+0800 [ilua.proto.OutputCapture#debug] Received stdout data: "lua: ...b/python3.6/site-packages/ilua/lualibs/json.lua/json.lua:389: expected argument of type string, got nil\nstack traceback:\n\t[C]: in function 'error'\n\t...b/python3.6/site-packages/ilua/lualibs/json.lua/json.lua:389: in field 'decode'\n\t...Versions/3.6/lib/python3.6/site-packages/ilua/interp.lua:156: in main chunk\n\t[C]: in ?\n"

(local language was translated)

from ilua.

guysv avatar guysv commented on July 28, 2024

Interesting, working on it. One last request though: what version of jupyter-lab do you use?

could you please post the output of something like

pip freeze | grep jupyter

from ilua.

Freakwill avatar Freakwill commented on July 28, 2024

I use the latest version.

jupyter==1.0.0
jupyter-client==5.2.4
jupyter-console==6.0.0
jupyter-contrib-core==0.3.3
jupyter-contrib-nbextensions==0.5.0
jupyter-core==4.4.0
jupyter-highlight-selected-word==0.2.0
jupyter-latex-envs==1.4.6
jupyter-nbextensions-configurator==0.4.0
jupyterlab==0.35.4
jupyterlab-launcher==0.13.1
jupyterlab-server==0.2.0

from ilua.

Freakwill avatar Freakwill commented on July 28, 2024

What about your work? I also found the error in bash that was not met before. Just keep with your schedule. I am OK, I am using lua.

from ilua.

guysv avatar guysv commented on July 28, 2024

That is interesting, because I merely added some trivial sqlite code on executions.

Anyway, I bashed around the repo a bit and made the errors clearer. Only problem is I did not create a new release. Could you please clone the repo, follow the dev setup instructions in the README, run ilua with debug output (ILUA_LOG_LEVEL=debug) and post the new errors?

from ilua.

Freakwill avatar Freakwill commented on July 28, 2024

That is interesting, because I merely added some trivial sqlite code on executions.

Anyway, I bashed around the repo a bit and made the errors clearer. Only problem is I did not create a new release. Could you please clone the repo, follow the dev setup instructions in the README, run ilua with debug output (ILUA_LOG_LEVEL=debug) and post the new errors?

I caught it in the dev version! There is difference between dev and old versions.

lua: ...william/Programming/myGithub/ilua/ilua/ext/netstring.lua:63: assertion failed!
stack traceback:
[C]: in function 'assert'
...william/Programming/myGithub/ilua/ilua/ext/netstring.lua:63: in function 'ext.netstring.read'
/Users/william/Programming/myGithub/ilua/ilua/interp.lua:155: in main chunk
[C]: in ?

And before the output, I got

2019-01-03T16:53:08+0800 [ilua.proto.OutputCapture#debug] Received stdout data: b"lua: ...william/Programming/myGithub/ilua/ilua/ext/netstring.lua:63: assertion failed!\nstack traceback:\n\t[C]: in function 'assert'\n\t...william/Programming/myGithub/ilua/ilua/ext/netstring.lua:63: in function 'ext.netstring.read'\n\t/Users/william/Programming/myGithub/ilua/ilua/interp.lua:155: in main chunk\n\t[C]: in ?\n"

The error appears more early, after several tests.

from ilua.

Freakwill avatar Freakwill commented on July 28, 2024

@guysv I have tested the latest version. It work well in shell, but it still reported the error. The shell would also brake down if I injected a code "stream:read(1)" in netstring.lua to see what happened. but print(stream) shown that stream (in netstring.lua) is a file object.

from ilua.

Freakwill avatar Freakwill commented on July 28, 2024

Where did you add 'stream:read'? stream is indeed a file object (a named pipe file in our case). anyway the whole netstring part is very delicate. a single byte going to the wrong place will ruin stuff for sure.

but it still reported the error

do you mean in jupyter-lab?

in netstring.lua

from ilua.

HuangJunye avatar HuangJunye commented on July 28, 2024

My Jupyter notebook/lab versions

jupyter==1.0.0
jupyter-client==5.2.4
jupyter-console==6.0.0
jupyter-core==4.4.0
jupyterlab==1.1.4
jupyterlab-server==1.0.6

from ilua.

guysv avatar guysv commented on July 28, 2024

@HuangJunye Hi, unfortunately it seems like this issue only reproduces on macs.
As I don't have a mac machine nearby, I have no sane way to debug it myself.
Feel free to investigate though.

from ilua.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.