Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REF-2256] 0.4.5a1: Cannot run --backend-only without a .web directory #2878

Closed
masenf opened this issue Mar 19, 2024 · 1 comment
Closed
Labels
bug Something isn't working linear Created by Linear-GitHub Sync

Comments

@masenf
Copy link
Collaborator

masenf commented Mar 19, 2024

Describe the bug
Due to new telemetry routines, Reflex crashes when trying reflex run --backend-only if the project does not have a .web directory.

To Reproduce

reflex init --template blank
rm -rf .web
reflex run --backend-only

Expected behavior
Reflex backend starts normally, with or without the reflex.json file present.

Screenshots

(VENV-pre-0.4.5a) masen@asmbp21 reflex-dev % reflex run --backend-only
───────────────────────────── Starting Reflex App ──────────────────────────────
Traceback (most recent call last):
  File "/Users/masen/code/reflex-dev/VENV-pre-0.4.5a/bin/reflex", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/Users/masen/code/reflex-dev/VENV-pre-0.4.5a/lib/python3.12/site-packages/typer/main.py", line 328, in __call__
    raise e
  File "/Users/masen/code/reflex-dev/VENV-pre-0.4.5a/lib/python3.12/site-packages/typer/main.py", line 311, in __call__
    return get_command(self)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/masen/code/reflex-dev/VENV-pre-0.4.5a/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/masen/code/reflex-dev/VENV-pre-0.4.5a/lib/python3.12/site-packages/typer/core.py", line 778, in main
    return _main(
           ^^^^^^
  File "/Users/masen/code/reflex-dev/VENV-pre-0.4.5a/lib/python3.12/site-packages/typer/core.py", line 216, in _main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/Users/masen/code/reflex-dev/VENV-pre-0.4.5a/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/masen/code/reflex-dev/VENV-pre-0.4.5a/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/masen/code/reflex-dev/VENV-pre-0.4.5a/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/masen/code/reflex-dev/VENV-pre-0.4.5a/lib/python3.12/site-packages/typer/main.py", line 683, in wrapper
    return callback(**use_params)  # type: ignore
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/masen/code/reflex-dev/VENV-pre-0.4.5a/lib/python3.12/site-packages/reflex/reflex.py", line 262, in run
    _run(env, frontend, backend, frontend_port, backend_port, backend_host, loglevel)
  File "/Users/masen/code/reflex-dev/VENV-pre-0.4.5a/lib/python3.12/site-packages/reflex/reflex.py", line 215, in _run
    telemetry.send(f"run-{env.value}")
  File "/Users/masen/code/reflex-dev/VENV-pre-0.4.5a/lib/python3.12/site-packages/reflex/utils/telemetry.py", line 129, in send
    event_data = _prepare_event(event)
                 ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/masen/code/reflex-dev/VENV-pre-0.4.5a/lib/python3.12/site-packages/reflex/utils/telemetry.py", line 77, in _prepare_event
    project_hash = get_project_hash(raise_on_fail=True)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/masen/code/reflex-dev/VENV-pre-0.4.5a/lib/python3.12/site-packages/reflex/utils/prerequisites.py", line 449, in get_project_hash
    with open(constants.Reflex.JSON, "r") as file:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '.web/reflex.json'

Specifics (please complete the following information):

  • Python Version: 3.12.0
  • Reflex Version: 0.4.5a1
  • OS: macOS
  • Browser (Optional):

Additional context
Seems related to #2786

Workaround is to disable telemetry with TELEMETRY_ENABLED=false

REF-2256

@masenf masenf changed the title 0.4.5a1: Cannot run --backend-only without a .web directory [REF-2256] 0.4.5a1: Cannot run --backend-only without a .web directory Mar 19, 2024
@ElijahAhianyo ElijahAhianyo added bug Something isn't working linear Created by Linear-GitHub Sync labels Mar 26, 2024
@masenf
Copy link
Collaborator Author

masenf commented Mar 28, 2024

Fixed via #2881

@masenf masenf closed this as completed Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working linear Created by Linear-GitHub Sync
Projects
None yet
Development

No branches or pull requests

2 participants