HIVEMIND_SYNC_ARG breaks block processing if it is "" because this gets converted to a / by the cli, and cli sees "sync/" instead of "sync"
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Dan Notestein assigned to @kbotor
assigned to @kbotor
- Maintainer
What you are describing is impossible as there are two arguments between
sync
and${HIVEMIND_SYNC_ARGS:-}
in the service definition: https://gitlab.syncad.com/hive/haf_api_node/-/blob/develop/hivemind.yaml?ref_type=heads#L28.I tried to replicate this locally and as far as I can tell arguments are passed to Hivemind correctly:
[Entrypoint] 2025-01-31 10:25:05,692+00:00 INFO [global] (main) Parameters passed directly to Hivemind docker entrypoint: sync --database-url=postgresql://hivemind@haf/haf_block_log --database-admin-url=postgresql://haf_admin@haf/haf_block_log [Entrypoint] 2025-01-31 10:25:05,695+00:00 INFO [global] (main) Collected Hivemind arguments: sync [Entrypoint] 2025-01-31 10:25:05,697+00:00 INFO [global] (main) Using PostgreSQL instance: postgresql://hivemind@haf/haf_block_log [Entrypoint] 2025-01-31 10:25:05,698+00:00 INFO [global] (main) Using PostgreSQL Admin URL: postgresql://haf_admin@haf/haf_block_log [Entrypoint] 2025-01-31 10:25:05,701+00:00 INFO [run_hive] (main) Starting Hivemind... Traceback (most recent call last): File "/home/hivemind/.hivemind-venv/bin/hive", line 8, in <module> sys.exit(run()) File "/home/hivemind/.hivemind-venv/lib/python3.8/site-packages/hive/cli.py", line 65, in run launch_mode(mode, conf) File "/home/hivemind/.hivemind-venv/lib/python3.8/site-packages/hive/cli.py", line 115, in launch_mode raise Exception(f"unknown run mode {mode}. Accepted run modes are: `build_schema', `sync', `server', `status'") Exception: unknown run mode sync/. Accepted run modes are: `build_schema', `sync', `server', `status'
As you can see in the logs
Collected Hivemind arguments: sync
, which implies the/
is added later on.Edited by Konrad Botor - Maintainer
I've figured it out.
Parameter substitution is made by Docker, which passes the empty parameter to Hivemind - unlike Bash, which would trim it (at least it did in my tests).
And Hivemind's entrypoint is not hardened against such an empty parameter being passed to it.
So here's a fix for Hivemind entrypoint: hivemind!844 (merged)
And for the current version of Hivemind the workaround is to set
HIVEMIND_SYNC_ARGS=--community-start-block=37500000
, where37500000
is the default when no value is explicitly set: https://gitlab.syncad.com/hive/hivemind/-/blob/develop/hive/conf.py?ref_type=heads#L120 - Dan Notestein closed
closed