Skip to content

Commit 0045906

Browse files
authored
bugfix: ship run local fails with --no-ngrok flag (#536)
The locally running package was attempting to adopt an instance handle from a non-extant Engine response. In the event that --no-ngrok is specified, this PR assigns the locally running package a fixed constant handle intended to be clearly identified (in debugging logs) as a disconnected locally running copy.
1 parent 05a8f0e commit 0045906

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/steamship/cli/cli.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,9 @@ def serve_local( # noqa: C901
292292
ngrok_api_url = None
293293
public_api_url = None
294294

295+
# Hard coded instance handle to represent "a local instance that isn't connected to the engine"
296+
local_instance_handle = "local-dev-instance-not-connected-to-engine"
297+
295298
if not no_ngrok:
296299
ngrok_api_url = _run_ngrok(port)
297300

@@ -307,6 +310,9 @@ def serve_local( # noqa: C901
307310
config=config,
308311
)
309312

313+
# Replace the local instance handle with the instance just registered in the engine.
314+
local_instance_handle = registered_instance.handle
315+
310316
# Notes:
311317
# 1. registered_instance.invocation_url is the NGROK URL, not the Steamship Proxy URL.
312318
# 2. The public_api_url should still be NGROK, not the Proxy. The local server emulates the Proxy and
@@ -319,7 +325,7 @@ def serve_local( # noqa: C901
319325
try:
320326
local_api_url = _run_local_server(
321327
local_port=port,
322-
instance_handle=registered_instance.handle,
328+
instance_handle=local_instance_handle,
323329
config=config,
324330
workspace=workspace,
325331
base_url=public_api_url,

0 commit comments

Comments
 (0)