MinaProtocol / mina

Mina is a cryptocurrency protocol with a constant size blockchain, improving scaling while maintaining decentralization and security.
https://minaprotocol.com
Apache License 2.0
1.98k stars 527 forks source link

I get "Deamon Crashed" error when trying to install node for testing #14346

Open inspector44 opened 9 months ago

inspector44 commented 9 months ago

Preliminary Checks

Description

I encountered an error that I think may be related to the MINA_TIME_OFFSET environment variable. I am sharing the detailed log of the error below.

Started Mina Daemon Service. Oct 15 15:01:48 mna-1 mina[7178]: {"timestamp":"2023-10-15 15:01:48.756643Z","level":"Info","source":{"module":"Mina_cli_entrypoint","location":"File \"src/app/cli/src/cli_entrypoint/mina_cli_entrypoint.ml\", line 559, characters 8-19"},"message":"Mina daemon is booting up; built with commit $commit on branch $branch","metadata":{"branch":"rampup","commit":"55b78189c46e1811b8bdb78864cfa95409aeb96a","commit_date":"2023-10-11T18:26:29+02:00","marlin_commit":"fd7c19d4c5dbb6826d1d5ce6bc24796a44087f70"}} Oct 15 15:01:48 mna-1 mina[7178]: {"timestamp":"2023-10-15 15:01:48.758277Z","level":"Info","source":{"module":"Mina_libConf_dir","location":"File \"src/lib/mina_lib/conf_dir.ml\", line 21, characters 10-21"},"message":"Created daemon lockfile $lockfile","metadata":{"lockfile":"/home/kadiralan/.mina-config/.mina-lock"}} Oct 15 15:01:48 mna-1 mina[7178]: {"timestamp":"2023-10-15 15:01:48.758588Z","level":"Info","source":{"module":"Exit_handlers","location":"File \"src/lib/exit_handlers/exit_handlers.ml\", line 28, characters 2-13"},"message":"Registering async shutdown handler: $description","metadata":{"description":"Remove daemon lockfile"}} Oct 15 15:01:48 mna-1 mina[7178]: {"timestamp":"2023-10-15 15:01:48.758816Z","level":"Info","source":{"module":"Mina_cli_entrypoint","location":"File \"src/app/cli/src/cli_entrypoint/mina_cli_entrypoint.ml\", line 567, characters 10-21"},"message":"Daemon will expire at $exp","metadata":{"exp":"2024-12-10 14:00:00-07:00"}} Oct 15 15:01:48 mna-1 mina[7178]: {"timestamp":"2023-10-15 15:01:48.759081Z","level":"Info","source":{"module":"Mina_cli_entrypoint","location":"File \"src/app/cli/src/cli_entrypoint/mina_cli_entrypoint.ml\", line 580, characters 8-19"},"message":"Booting may take several seconds, please wait","metadata":{}} Oct 15 15:01:48 mna-1 mina[7178]: Using libp2p keypair private-key password from environment variable MINA_LIBP2P_PASS Oct 15 15:01:49 mna-1 mina[7178]: {"timestamp":"2023-10-15 15:01:49.282466Z","level":"Info","source":{"module":"Mina_cli_entrypoint","location":"File \"src/app/cli/src/cli_entrypoint/mina_cli_entrypoint.ml\", line 700, characters 12-23"},"message":"Reading configuration files $config_files","metadata":{"config_files":["/var/lib/coda/config_55b78189.json","/home/kadiralan/.mina-config/daemon.json"]}} Oct 15 15:01:50 mna-1 mina[7178]: {"timestamp":"2023-10-15 15:01:50.323575Z","level":"Warn","source":{"module":"Mina_cli_entrypoint","location":"File \"src/app/cli/src/cli_entrypoint/mina_cli_entrypoint.ml\", line 721, characters 24-35"},"message":"Could not read configuration from $config_file","metadata":{"config_file":"/home/kadiralan/.mina-config/daemon.json","error":{"commit_id":"55b78189c46e1811b8bdb78864cfa95409aeb96a","exn_name":"Async_kernelMonitor.Error_","exn":["monitor.ml.Error",["Unix.Unix_error","No such file or directory","open","((filename /home/kadiralan/.mina-config/daemon.json) (mode (O_RDONLY O_CLOEXEC)) (perm 0o0))"],["Raised at BaseResult.ok_exn in file \"src/result.ml\", line 201, characters 17-26","Called from Async_kernelDeferred1.M.map.(fun) in file \"src/deferred1.ml\", line 17, characters 40-45","Called from Async_kernelJob_queue.run_job in file \"src/job_queue.ml\" (inlined), line 128, characters 2-5","Called from Async_kernelJob_queue.run_jobs in file \"src/job_queue.ml\", line 169, characters 6-47","Caught by monitor try_with_or_error at file \"src/lib/genesis_ledger_helper/genesis_ledger_helper.ml\", line 815, characters 34-34"]]}}} Oct 15 15:01:50 mna-1 mina[7178]: {"timestamp":"2023-10-15 15:01:50.678761Z","level":"Info","source":{"module":"Genesis_ledger_helper","location":"File \"src/lib/genesis_ledger_helper/genesis_ledger_helper.ml\", line 840, characters 2-13"},"message":"Initializing with runtime configuration. Ledger name: $name","metadata":{"accounts_omitted":200000,"config":{"genesis":{"genesis_state_timestamp":"2023-10-17T16:01:01Z"},"ledger":{"name":"berkeley-ITN"}},"name":"berkeley-ITN"}} Oct 15 15:01:50 mna-1 mina[7178]: {"timestamp":"2023-10-15 15:01:50.678896Z","level":"Info","source":{"module":"Genesis_ledger_helper","location":"File \"src/lib/genesis_ledger_helper/genesis_ledger_helper.ml\", line 868, characters 8-19"},"message":"Using the compiled constraint constants","metadata":{}} Oct 15 15:01:51 mna-1 mina[7178]: {"timestamp":"2023-10-15 15:01:51.570670Z","level":"Fatal","source":{"module":"Mina_cli_entrypoint","location":"File \"src/app/cli/src/cli_entrypoint/mina_cli_entrypoint.ml\", line 760, characters 16-28"},"message":"Failed initializing with configuration $config: $error","metadata":{"accounts_omitted":200000,"config":{"genesis":{"genesis_state_timestamp":"2023-10-17T16:01:01Z"},"ledger":{"name":"berkeley-ITN"}},"error":{"commit_id":"55b78189c46e1811b8bdb78864cfa95409aeb96a","exn_name":"Async_kernelMonitor.Error_","exn":["monitor.ml.Error",["Unix.Unix_error","Permission denied","mkdir","((dirname /tmp/coda_cache_dir/e26e2349-685a-309c-2479-81dc5157aa2f) (perm 0o777))"],["Raised at CoreCore_unix.improve in file \"src/core_unix.ml\", line 46, characters 4-43","Called from CoreCore_unix.mkdir_p.mkdir_idempotent in file \"src/core_unix.ml\", line 1481, characters 10-25","Called from CoreCore_unix.mkdir_p in file \"src/core_unix.ml\", line 1487, characters 8-34","Called from Merkle_ledgerDatabase.Make.create in file \"src/lib/merkle_ledger/database.ml\", line 84, characters 4-26","Called from Mina_ledgerLedger.Ledger_inner.create in file \"src/lib/mina_ledger/ledger.ml\" (inlined), line 189, characters 16-53","Called from Genesis_ledger.Make.t in file \"src/lib/genesis_ledger/genesis_ledger.ml\", line 124, characters 16-39","Called from CamlinternalLazy.force_lazy_block in file \"camlinternalLazy.ml\", line 31, characters 17-27","Re-raised at CamlinternalLazy.force_lazy_block in file \"camlinternalLazy.ml\", line 36, characters 4-11","Called from BaseLazy.map in file \"src/lazy.ml\", line 17, characters 23-32","Called from CamlinternalLazy.force_lazy_block in file \"camlinternalLazy.ml\", line 31, characters 17-27","Re-raised at CamlinternalLazy.force_lazy_block in file \"camlinternalLazy.ml\", line 36, characters 4-11","Called from Genesis_ledger_helper.Ledger.load.(fun) in file \"src/lib/genesis_ledger_helper/genesis_ledger_helper.ml\", line 384, characters 29-72","Called from Async_kernel__Deferred0.bind.(fun) in file \"src/deferred0.ml\", line 54, characters 64-69","Called from Async_kernelJob_queue.run_job in file \"src/job_queue.ml\" (inlined), line 128, characters 2-5","Called from Async_kernelJob_queue.run_jobs in file \"src/job_queue.ml\", line 169, characters 6-47","Caught by monitor try_with_join_or_error at file \"src/lib/genesis_ledger_helper/genesis_ledger_helper.ml\", line 320, characters 41-41"]]}}} Oct 15 15:01:51 mna-1 mina[7178]: {"timestamp":"2023-10-15 15:01:51.570868Z","level":"Info","source":{"module":"Node_error_service","location":"File \"src/lib/node_error_service/node_error_service.ml\", line 111, characters 10-21"},"message":"Could not send error report: mina instance has not been created yet.","metadata":{}} Oct 15 15:01:51 mna-1 mina[7178]: {"timestamp":"2023-10-15 15:01:51.570979Z","level":"Fatal","source":{"module":"InitMina_run","location":"File \"src/app/cli/src/init/mina_run.ml\", line 670, characters 2-26"},"message":"Unhandled top-level exception: $exn\nGenerating crash report","metadata":{"exn":{"commit_id":"55b78189c46e1811b8bdb78864cfa95409aeb96a","sexp":["monitor.ml.Error",["Unix.Unix_error","Permission denied","mkdir","((dirname /tmp/coda_cache_dir/e26e2349-685a-309c-2479-81dc5157aa2f) (perm 0o777))"],["Raised at CoreCore_unix.improve in file \"src/core_unix.ml\", line 46, characters 4-43","Called from CoreCore_unix.mkdir_p.mkdir_idempotent in file \"src/core_unix.ml\", line 1481, characters 10-25","Called from CoreCore_unix.mkdir_p in file \"src/core_unix.ml\", line 1487, characters 8-34","Called from Merkle_ledgerDatabase.Make.create in file \"src/lib/merkle_ledger/database.ml\", line 84, characters 4-26","Called from Mina_ledgerLedger.Ledger_inner.create in file \"src/lib/mina_ledger/ledger.ml\" (inlined), line 189, characters 16-53","Called from Genesis_ledger.Make.t in file \"src/lib/genesis_ledger/genesis_ledger.ml\", line 124, characters 16-39","Called from CamlinternalLazy.force_lazy_block in file \"camlinternalLazy.ml\", line 31, characters 17-27","Re-raised at CamlinternalLazy.force_lazy_block in file \"camlinternalLazy.ml\", line 36, characters 4-11","Called from BaseLazy.map in file \"src/lazy.ml\", line 17, characters 23-32","Called from CamlinternalLazy.force_lazy_block in file \"camlinternalLazy.ml\", line 31, characters 17-27","Re-raised at CamlinternalLazy.force_lazy_block in file \"camlinternalLazy.ml\", line 36, characters 4-11","Called from Genesis_ledger_helper.Ledger.load.(fun) in file \"src/lib/genesis_ledger_helper/genesis_ledger_helper.ml\", line 384, characters 29-72","Called from Async_kernelDeferred0.bind.(fun) in file \"src/deferred0.ml\", line 54, characters 64-69","Called from Async_kernelJob_queue.run_job in file \"src/job_queue.ml\" (inlined), line 128, characters 2-5","Called from Async_kernelJob_queue.run_jobs in file \"src/job_queue.ml\", line 169, characters 6-47","Caught by monitor try_with_join_or_error at file \"src/lib/genesis_ledger_helper/genesis_ledger_helper.ml\", line 320, characters 41-41"]],"backtrace":["Raised at BaseError.raise in file \"src/error.ml\" (inlined), line 8, characters 14-30","Called from Mina_cli_entrypoint.setup_daemon.(fun).mina_initialization_deferred.(fun) in file \"src/app/cli/src/cli_entrypoint/mina_cli_entrypoint.ml\", line 767, characters 16-31","Called from Async_kernelDeferred1.M.map.(fun) in file \"src/deferred1.ml\", line 17, characters 40-45","Called from Async_kernelJob_queue.run_job in file \"src/job_queue.ml\" (inlined), line 128, characters 2-5","Called from Async_kernelJob_queue.run_jobs in file \"src/job_queue.ml\", line 169, characters 6-47"]}}} Oct 15 15:01:51 mna-1 mina[7178]: {"timestamp":"2023-10-15 15:01:51.573741Z","level":"Warn","source":{"module":"InitMina_run","location":"File \"src/app/cli/src/init/mina_run.ml\", line 103, characters 6-17"},"message":"Shutdown before Coda instance was created, not saving a visualization","metadata":{"coda_run":"Logging state before program ends"}} Oct 15 15:01:51 mna-1 mina[7178]: Environment variable MINA_TIME_OFFSET not found, using default of 0 Oct 15 15:01:51 mna-1 mina[7178]: ☠ Mina Daemon crashed. Oct 15 15:01:51 mna-1 mina[7178]: The Mina Protocol developers would like to know why! Oct 15 15:01:51 mna-1 mina[7178]: Please: Oct 15 15:01:51 mna-1 mina[7178]: Open an issue: Oct 15 15:01:51 mna-1 mina[7178]: https://github.com/MinaProtocol/mina/issues/new Oct 15 15:01:51 mna-1 mina[7178]: Briefly describe what you were doing and attach the crash report /home/kadiralan/.mina-config/coda_crash_report_2023-10-15_15-01-51.573381.tar.gz Oct 15 15:01:51 mna-1 mina[7178]:
Oct 15 15:01:51 mna-1 systemd[1606]: mina.service: Main process exited, code=exited, status=1/FAILURE Oct 15 15:01:51 mna-1 systemd[1606]: mina.service: Failed with result 'exit-code'.

Steps to Reproduce

1 - Create a new user 2- try to run node for block production role under this user 3 - observe the following error

Expected Result

The following error should not be encountered and the node should run successfully

Actual Result

Below error occurs

: Environment variable MINA_TIME_OFFSET not found, using default of 0 Oct 15 15:01:51 mna-1 mina[7178]: ☠ Mina Daemon crashed.

How frequently do you see this issue?

Rarely

What is the impact of this issue on your ability to run a node?

High

Status

Failed to connect to bus: No such file or directory

Additional information

No response

shimkiv commented 9 months ago

It actually seems to fail because of incorrect file-system permissions:

["Unix.Unix_error","Permission denied","mkdir","((dirname /tmp/coda_cache_dir/e26e2349-685a-309c-2479-81dc5157aa2f) (perm 0o777))"]
inspector44 commented 9 months ago

It actually seems to fail because of incorrect file-system permissions:

["Unix.Unix_error","Permission denied","mkdir","((dirname /tmp/coda_cache_dir/e26e2349-685a-309c-2479-81dc5157aa2f) (perm 0o777))"]

Still, if it throws an unhandled exception like this, doesn't that mean it's a bug? Is it a case that needs to be handled?

shimkiv commented 9 months ago

At least not in functional way I'd say. Maybe better error message. In this case application throws to notify you that something went wrong and this something is not under the app's control, like any other applications, that rely on file system to operate correctly, will do.

inspector44 commented 9 months ago

At least not in functional way I'd say. Maybe better error message. In this case application throws to notify you that something went wrong and this something is not under the app's control, like any other applications, that rely on file system to operate correctly, will do.

Yes, I guess it might make sense to handle it and write a more accurate error message. By the way, if you don't handle this, the "issue" will continue to be opened by people related to this. Because the error message will continue to contain this message; "The Mina Protocol developers would like to know why!"