pytorch-lightning
pytorch-lightning copied to clipboard
Unable to start a lighting app
First check
- [x] I'm sure this is a bug.
- [X] I've added a descriptive title to this bug.
- [X] I've provided clear instructions on how to reproduce the bug.
- [X] I've added a code sample.
- [X] I've provided any other important info that is required.
Bug description
I am unable to run lightning apps on my M1 mac locally. Error below
How to reproduce the bug
import lightning as L
class SingleWorkFlow(L.LightningWork):
def __init__(self):
super().__init__()
def run(self):
print(f"Hello World")
class RootFlow(L.LightningFlow):
def __init__(self):
super().__init__()
self.single_work = SingleWorkFlow()
def run(self):
self.single_work.run()
app = L.LightningApp(RootFlow())
Error messages and logs
On running
python -m lightning run app hello.py
You are connected to the cloud Lightning App: 01gd3eha9tnehec8s4n2hq7f01.
Traceback (most recent call last):
File "/Users/krishna/opt/anaconda3/envs/addverb/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/Users/krishna/opt/anaconda3/envs/addverb/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/Users/krishna/opt/anaconda3/envs/addverb/lib/python3.9/site-packages/lightning/__main__.py", line 4, in <module>
main()
File "/Users/krishna/opt/anaconda3/envs/addverb/lib/python3.9/site-packages/lightning_app/cli/lightning_cli.py", line 68, in main
_run_app_command(app_name, app_id)
File "/Users/krishna/opt/anaconda3/envs/addverb/lib/python3.9/site-packages/lightning_app/cli/commands/app_commands.py", line 18, in _run_app_command
raise Exception("We couldn't find any matching running App.")
Exception: We couldn't find any matching running App.```
Important info
lightning 2022.9.8
lightning-app 0.6.0
lightning-cloud 0.5.3
lightning-utilities 0.3.0
pytorch-lightning 1.7.6
OSX 12.5
More info
Also added a breakpoint here
(Pdb) app_name
'01gd3eha9tnehec8s4n2hq7f01'
(Pdb) app_id
'01gd3eha9tnehec8s4n2hq7f01'
(Pdb) _retrieve_application_url_and_available_commands(app_id)
(None, None, None)
(Pdb)
cc: @kaushikb11
Looks like this issue is a bug. As a workaround run lightning disconnect. If someone forgets to disconnect from an app this can lead to the bug described above.
cc: @hhsecond, @robert-s-lee
If this is expected, we should improve the error message by asking our users to disconnect from the application first.
What do we think about connect being env var based by default (a la conda)? I’ve been bitten by forgetting to disconnect multiple times, assuming that closing the terminal session would disconnect.
We could make it persistent (file-based) opt-in with an extra flag.
WDYT @tchaton ?
@lantiga We could, but we wanted something more persistent. Personally, I don't mind either way. I think users could ask for both depending on the use case.
This issue has been automatically marked as stale because it hasn't had any recent activity. This issue will be closed in 7 days if no further activity occurs. Thank you for your contributions, PyTorch Lightning Team!