Invoke-rc.d: could not determine current runlevel invoke-rc.d: policy-rc.d denied execution of start

When trying to install maas on ubuntu, I encounter the below error :
invoke-rc.d: could not determine current runlevel
invoke-rc.d: policy-rc.d denied execution of start.:

Due to this, no services are started.

I am having the same issue in trying to run docker container on gitlab-ci (image: debian:buster). .gitlab-ci.yml