Getting type error when trying to get HelmCluster in k8s

I used Helm to create a cluster with out custom change. I am trying to scale the cluster from the jupyter notebook in the dask cluster I just created.

I am using “from dask_kubernetes import HelmCluster → cluster = HelmCluster(name=“dask-cluster”)”

But getting the following error:

TypeError Traceback (most recent call last)
Cell In [10], line 1
----> 1 clusster = HelmCluster(name=“dask-cluster”)

File /opt/conda/lib/python3.8/site-packages/dask_kubernetes/helm/helmcluster.py:101, in HelmCluster.init(self, release_name, auth, namespace, port_forward_cluster_ip, scheduler_name, worker_name, node_host, node_port, name, **kwargs)
99 check_dependency(“helm”)
100 check_dependency(“kubectl”)
→ 101 status = subprocess.run(
102 [“helm”, “-n”, self.namespace, “status”, self.release_name],
103 capture_output=True,
104 encoding=“utf-8”,
105 )
106 if status.returncode != 0:
107 raise RuntimeError(f"No such helm release {self.release_name}.")

File /opt/conda/lib/python3.8/subprocess.py:493, in run(input, capture_output, timeout, check, *popenargs, **kwargs)
490 kwargs[‘stdout’] = PIPE
491 kwargs[‘stderr’] = PIPE
→ 493 with Popen(*popenargs, **kwargs) as process:
494 try:
495 stdout, stderr = process.communicate(input, timeout=timeout)

File /opt/conda/lib/python3.8/subprocess.py:858, in Popen.init(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors, text)
854 if self.text_mode:
855 self.stderr = io.TextIOWrapper(self.stderr,
856 encoding=encoding, errors=errors)
→ 858 self._execute_child(args, executable, preexec_fn, close_fds,
859 pass_fds, cwd, env,
860 startupinfo, creationflags, shell,
861 p2cread, p2cwrite,
862 c2pread, c2pwrite,
863 errread, errwrite,
864 restore_signals, start_new_session)
865 except:
866 # Cleanup if the child failed starting.
867 for f in filter(None, (self.stdin, self.stdout, self.stderr)):

File /opt/conda/lib/python3.8/subprocess.py:1639, in Popen._execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, start_new_session)
1637 fds_to_keep = set(pass_fds)
1638 fds_to_keep.add(errpipe_write)
→ 1639 self.pid = _posixsubprocess.fork_exec(
1640 args, executable_list,
1641 close_fds, tuple(sorted(map(int, fds_to_keep))),
1642 cwd, env_list,
1643 p2cread, p2cwrite, c2pread, c2pwrite,
1644 errread, errwrite,
1645 errpipe_read, errpipe_write,
1646 restore_signals, start_new_session, preexec_fn)
1647 self._child_created = True
1648 finally:
1649 # be sure the FD is closed no matter what

TypeError: expected str, bytes or os.PathLike object, not NoneType

Hi @SRAVICHANDRAN,

It’s a bit hard to read your stacktrace. I’m not sure from where the problem might come, but it looks like a low level one as it’s subprocess Python API failing. Maybe some installation problem? Can you run helm commands in the Jupyter terminal ?

Thanks for the reply. Yes helmcluster works well for local installation. But ya now I have setup internal load balancer for the cluster and able to access it locally well.

OK, so this is kind of a duplicate of Failing to look at gateway cluster when using k8s portforwarding, thanks for the update!