# Launching a local session from an image built on Renkulab

**URL:** <https://renku.discourse.group/t/launching-a-local-session-from-an-image-built-on-renkulab/721>\
**Category:** General\
**Created:** [29 November 2022 17:12 UTC](https://renku.discourse.group/t/launching-a-local-session-from-an-image-built-on-renkulab/721 "2022-11-29T17:12:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![champost](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/champost/32/232_2.png) [@champost](https://renku.discourse.group/u/champost)\
**Post date:** [29 November 2022 17:12 UTC](https://renku.discourse.group/t/launching-a-local-session-from-an-image-built-on-renkulab/721/1 "2022-11-29T17:12:08Z")

</div>

Hello,

I followed the documentation for [reusing Docker images built on RenkuLab](https://renku.readthedocs.io/en/latest/how-to-guides/own_machine/reusing-docker-images.html) and have successfully managed to use JupyterLab on my laptop running on Ubuntu (and also independently commit and push my changes to remote).

The RenkuLab project in my case is for [building a Dash app](https://renkulab.io/gitlab/champak.beeravolureddy/dash-example).

I am able work locally in a JupyterLab interface running at `http://127.0.0.1:8888/lab` but cannot see anything at the expected `http://127.0.0.1:8888/dash` endpoint like on [renkulab.io](http://renkulab.io).

I get a

```auto
500 : Internal Server Error

The error was:
could not start dash in time

```

And indeed there is no process running a `python app.py --port XXXX` as can be expected [when running the same on renkulab.io](https://renku.discourse.group/t/dash-app-with-jupyter-server-proxy/626/16).

Any idea what is happening here ?

---

<div class="post-metadata">

**Author:** ![rrrrrok](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/rrrrrok/32/117_2.png) [@rrrrrok](https://renku.discourse.group/u/rrrrrok)\
**Post date:** [2 December 2022 14:06 UTC](https://renku.discourse.group/t/launching-a-local-session-from-an-image-built-on-renkulab/721/2 "2022-12-02T14:06:51Z")

</div>

Hi @champost, I had a look at your project and the trouble is that when the server URL is constructed in `app.py` it uses an environment variable that isn’t available when you launch the session locally.

This patch should be enough to make it work:

```auto
commit d5895a124adbcb1dda531136ab9d92db28eb662a
Author: Rok Roškar <rok.roskar@sdsc.ethz.ch>
Date: Fri Dec 2 13:37:28 2022 +0000

    chore: fix session url when not on renkulab

diff --git a/app.py b/app.py
index cd6efc4..c03943f 100644
--- a/app.py
+++ b/app.py
@@ -20,7 +20,7 @@ parser.add_argument("--port", type=int)
 args = parser.parse_args()
 
 JupyterDash.infer_jupyter_proxy_config()
-session_url = os.environ.get("SESSION_URL")
+session_url = os.environ.get("SESSION_URL", "http://0.0.0.0")
 proxy_base_path = urlparse(urljoin(session_url + "/", f"proxy/{args.port}/")).path
 app = JupyterDash(requests_pathname_prefix=proxy_base_path) # initialising dash app
 df = px.data.stocks() # reading stock price dataset

```

I was able to get the dash app working with a local session with this change. Hope that helps!
