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

App-Frame: Error running "up" command in non-interactive environment #5

Open
davenquinn opened this issue Sep 6, 2023 · 0 comments

Comments

@davenquinn
Copy link
Member

When the macrostrat.app_frame up command is run in an environment without a TTY (for instance, in an SSH script), it gets to the last part, where it waits for user input, and errors:

Following container logs
- Press q or Ctrl+c to exit logs (Macrostrat will keep running).
- Press r or run macrostrat restart to restart Macrostrat.
- Press x or run macrostrat down to stop Macrostrat.

Traceback (most recent call last):
  File "/data/macrostrat/.venv/bin/macrostrat", line 6, in <module>
    sys.exit(main())
  File "/data/macrostrat/.venv/lib/python3.10/site-packages/macrostrat/app_frame/control_command.py", line 87, in __call__
    return self._click()
  File "/data/macrostrat/.venv/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/data/macrostrat/.venv/lib/python3.10/site-packages/typer/core.py", line 778, in main
    return _main(
  File "/data/macrostrat/.venv/lib/python3.10/site-packages/typer/core.py", line 216, in _main
    rv = self.invoke(ctx)
  File "/data/macrostrat/.venv/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/data/macrostrat/.venv/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/data/macrostrat/.venv/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/data/macrostrat/.venv/lib/python3.10/site-packages/typer/main.py", line 683, in wrapper
    return callback(**use_params)  # type: ignore
  File "/data/macrostrat/.venv/lib/python3.10/site-packages/macrostrat/app_frame/control_command.py", line 130, in up
    res = follow_logs_with_reloader(app, container)
  File "/data/macrostrat/.venv/lib/python3.10/site-packages/macrostrat/app_frame/follow_logs.py", line 52, in follow_logs_with_reloader
    with wait_for_keys():
  File "/usr/lib/python3.10/contextlib.py", line 135, in __enter__
    return next(self.gen)
  File "/data/macrostrat/.venv/lib/python3.10/site-packages/macrostrat/app_frame/follow_logs.py", line 74, in wait_for_keys
    oldterm = termios.tcgetattr(fd)
termios.error: (25, 'Inappropriate ioctl for device')

This seems like it could be solved by detecting non-interactive environments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant