Skip to content

InactiveRunException#

Error

----InactiveRunException----------------------------------------

It seems you are trying to log metadata to (or fetch it from) a run that was stopped (<NeptuneRunId>).

where <NeptuneRunId> is the ID of the Neptune run that couldn't be accessed.

Issue#

This exception is raised if you try to access a Run instance but it has been terminated, for example, with the stop() method or with a remote stop/abort signal through the web app.

Sample scenario where the error would occur
run = neptune.init_run()
run.stop()  # or remote stop through the web app
run["metric"] = some_metric

Once the run is stopped, the Neptune client will only synchronize remaining queued operations with the server, but no new metadata will be logged or stored from that point onwards.

Solution#

Ensure that you reinitialize the run that needs to be accessed after stopping.

Resuming a stopped run#

If you intended to reopen the run in order to access its metadata or continue logging, you need to reinitialize it using the Neptune ID.

Resume a run
run = neptune.init_run(with_id="NLI-8")

run["new_field"] = new_metadata
How do I find the ID?

The Neptune ID is a unique identifier for the run. In the table view, it's displayed in the leftmost column.

The ID is stored in the system namespace (sys/id).

If the run is active, you can obtain its ID with run["sys/id"].fetch(). For example:

>>> run = neptune.init_run(project="ml-team/classification")
>>> run["sys/id"].fetch()
'CLS-26'

You can also resume the run in read-only mode. This ensures that the data is not modified, but you can still access and download it.

Resume a run in read-only mode
run = neptune.init_run(
    with_id="NLI-8",
    mode="read-only",
)

value = run["some_field"].fetch()
run["fileset_field"].download()

Getting help