jupyter-incubator / sparkmagic

Jupyter magics and kernels for working with remote Spark clusters
Other
1.33k stars 447 forks source link

[BUG] error when first client connects #814

Closed jarlva closed 1 year ago

jarlva commented 1 year ago

Hello, I'm getting the following as soon as I use the browser to connect to jupyterlab. On the browser side I loose the pyspark kernel. I use it in a Kubernetes environment with the following pods: image error: json.decoder.JSONDecodeError: Expecting ':' delimiter: line 5 column 64

Complete Error: [D 2023-04-23 19:14:37.265 ServerApp] 200 GET /jupyterlab/api/contents?content=1& 1682277274920 (c9d4dc2ad1c74e129a7c34169647ddfa@127.0.0.1) 1.00ms Traceback (most recent call last): File "/opt/conda/lib/python3.10/runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "/opt/conda/lib/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/opt/conda/lib/python3.10/site-packages/sparkmagic/kernels/pysparkkernel/ pysparkkernel.py", line 37, in <module> IPKernelApp.launch_instance(kernel_class=PySparkKernel) File "/opt/conda/lib/python3.10/site-packages/traitlets/config/application.py", line 1040, in launch_instance app.initialize(argv) File "/opt/conda/lib/python3.10/site-packages/traitlets/config/application.py", line 113, in inner return method(app, *args, **kwargs) File "/opt/conda/lib/python3.10/site-packages/ipykernel/kernelapp.py", line 692 , in initialize self.init_kernel() File "/opt/conda/lib/python3.10/site-packages/ipykernel/kernelapp.py", line 540 , in init_kernel kernel = kernel_factory( File "/opt/conda/lib/python3.10/site-packages/traitlets/config/configurable.py" , line 551, in instance inst = cls(*args, **kwargs) File "/opt/conda/lib/python3.10/site-packages/sparkmagic/kernels/pysparkkernel/ pysparkkernel.py", line 23, in __init__ super(PySparkKernel, self).__init__( File "/opt/conda/lib/python3.10/site-packages/sparkmagic/kernels/wrapperkernel/ sparkkernelbase.py", line 99, in __init__ self.logger = SparkLog("{}_jupyter_kernel".format(self.session_language)) File "/opt/conda/lib/python3.10/site-packages/sparkmagic/utils/sparklogger.py", line 11, in __init__ MAGICS_LOGGER_NAME, conf.logging_config(), class_name File "/opt/conda/lib/python3.10/site-packages/hdijupyterutils/configuration.py" , line 18, in wrapped_f _initialize(overrides, path, fsrw_class) File "/opt/conda/lib/python3.10/site-packages/hdijupyterutils/configuration.py" , line 52, in _initialize new_overrides = _load(path, fsrw_class) File "/opt/conda/lib/python3.10/site-packages/hdijupyterutils/configuration.py" , line 70, in _load overrides = json.loads(line) File "/opt/conda/lib/python3.10/json/__init__.py", line 346, in loads return _default_decoder.decode(s) File "/opt/conda/lib/python3.10/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/opt/conda/lib/python3.10/json/decoder.py", line 353, in raw_decode obj, end = self.scan_once(s, idx) json.decoder.JSONDecodeError: Expecting ':' delimiter: line 5 column 64 (char 139 ) [I 2023-04-23 19:14:39.639 ServerApp] AsyncIOLoopKernelRestarter: restarting kern el (1/5), new random ports [D 2023-04-23 19:14:39.650 ServerApp] Starting kernel: ['/opt/conda/bin/python3.1 0', '-m', 'sparkmagic.kernels.pysparkkernel.pysparkkernel', '-f', '/home/jovyan/. local/share/jupyter/runtime/kernel-499e6f69-66d7-407f-8da5-b8a39dc47f86.json'] [D 2023-04-23 19:14:39.650 ServerApp] Connecting to: tcp://127.0.0.1:60439

Jupyter yaml below (sorry, it won't show nicely even with code enclosure). Made a few changes just for debugging the error (like running as su. What is the root password anyway?).

`apiVersion: v1 kind: ServiceAccount metadata: name: jupyterlab namespace: test-jh

kind: Role apiVersion: rbac.authorization.k8s.io/v1 metadata: name: jupyterlab namespace: test-jh rules:

jarlva commented 1 year ago

found a typo