# ask-community

Kirill Denisenko

09/01/2022, 6:26 AM
Hi all! I'm trying to deploy Dagster to a GCP Compute Engine VM (Ubuntu 22.04 LTS). I want to make both dagit and dagster-daemon run in background, so I push them into background like this:
Copy code
export DAGSTER_HOME=/path/to/dagster_home
dagit -h -p 3000 & disown
dagster-daemon run & disown
This works well at first glance - both processes are running and executing jobs correctly. However I observe three connected unexpected behaviors: 1. Logs from both dagit and dagster-daemon are written to current terminal (stderr?). See attached screenshot for an example when starting dagit. 2. When I close SSH connection to VM, dagit still works but all jobs fail with the error
OSError: [Errno 5] Input/output error
. Presumably, Dagit cannot get stdout and stderr because the terminal is closed. 3. According to this page, running command above should automatically make Dagit write logs to
. However, when I check this folder after running a couple of jobs - the folder is empty. Instead, I only see some run logs per job in
. Is this behavior expected? Given above, I expect: 1. dagit to write all logs to
and don't write anything to stdout/stderr. 2. Do not fail any jobs after disowning processes via
& disown
and closing the terminal. I found a workaround by running both processes like this:
Copy code
dagit -h -p 3000 > /dev/null 2>&1 & disown
dagster-daemon run > /dev/null 2>&1 & disown
However this way I lose access to process logs (except job logs). And if I redirect output to a file, now I have to manually rotate the output log file. Any suggestions?

Kautsar Aqsa

09/14/2022, 3:16 AM
have you set this in your
Copy code
  class: LocalComputeLogManager
    base_dir: /path/to/directory

Kirill Denisenko

09/14/2022, 4:58 AM
Hi @Kautsar Aqsa, thanks for checking. We have our compute logs set to be saved to GCS bucket (and it works), but Dagster still saves some to local storage and outputs to stderr/stdout. I assumed that this is intended, but now that you mentioned it it seems like the logs should be outputted to GCS only?
Copy code
  module: dagster_gcp.gcs.compute_log_manager
  class: GCSComputeLogManager