Mac OS - garage status - Error: Invalid RPC secret key (bad hex) Odd number of digits #659

Closed
opened 2023-10-20 16:18:24 +00:00 by gedw99 · 1 comment

I am not sure if its the rust code or the config.

env:

main branch on m2 mac.

config:

garage.toml is exact copy of whats on web site at https://garagehq.deuxfleurs.fr/documentation/quick-start/

I just changed the path for LMDB data so that its local to the repo.

metadata_dir = "./.data/garage/meta"
data_dir = "./.data/garage/data"
db_engine = "lmdb"

replication_mode = "none"

rpc_bind_addr = "[::]:3901"
rpc_public_addr = "127.0.0.1:3901"
rpc_secret = "$(openssl rand -hex 32)"

[s3_api]
s3_region = "garage"
api_bind_addr = "[::]:3900"
root_domain = ".s3.garage.localhost"

[s3_web]
bind_addr = "[::]:3902"
root_domain = ".web.garage.localhost"
index = "index.html"

[k2v_api]
api_bind_addr = "[::]:3904"

[admin]
api_bind_addr = "0.0.0.0:3903"
admin_token = "$(openssl rand -base64 32)"

make:

warning: variable does not need to be mutable
   --> src/model/helper/bucket.rs:129:7
    |
129 |         let mut bucket_p = bucket.state.as_option_mut().unwrap();
    |             ----^^^^^^^^
    |             |
    |             help: remove this `mut`
    |
    = note: `#[warn(unused_mut)]` on by default

warning: variable does not need to be mutable
   --> src/model/helper/bucket.rs:166:7
    |
166 |         let mut bucket_state = bucket.state.as_option_mut().unwrap();
    |             ----^^^^^^^^^^^^
    |             |
    |             help: remove this `mut`

warning: variable does not need to be mutable
   --> src/model/helper/bucket.rs:248:15
    |
248 |         if let Some(mut bucket_state) = bucket.state.as_option_mut() {
    |                     ----^^^^^^^^^^^^
    |                     |
    |                     help: remove this `mut`

warning: variable does not need to be mutable
   --> src/model/helper/bucket.rs:277:7
    |
277 |         let mut key_param = key.state.as_option_mut().unwrap();
    |             ----^^^^^^^^^
    |             |
    |             help: remove this `mut`

warning: variable does not need to be mutable
   --> src/model/helper/bucket.rs:286:7
    |
286 |         let mut bucket_p = bucket.state.as_option_mut().unwrap();
    |             ----^^^^^^^^
    |             |
    |             help: remove this `mut`

warning: variable does not need to be mutable
   --> src/model/helper/bucket.rs:329:7
    |
329 |         let mut bucket_p = bucket.state.as_option_mut().unwrap();
    |             ----^^^^^^^^
    |             |
    |             help: remove this `mut`

warning: variable does not need to be mutable
   --> src/model/helper/bucket.rs:362:7
    |
362 |         let mut key_param = key.state.as_option_mut().unwrap();
    |             ----^^^^^^^^^
    |             |
    |             help: remove this `mut`

warning: use of deprecated associated function `garage_db::sled_adapter::SledDb::init`: The Sled database is now deprecated and will be removed in Garage v1.0. Please migrate to LMDB or Sqlite as soon as possible.
   --> src/model/garage.rs:131:31
    |
131 |                 db::sled_adapter::SledDb::init(db)
    |                                           ^^^^
    |
    = note: `#[warn(deprecated)]` on by default

warning: variable does not need to be mutable
   --> src/model/index_counter.rs:235:8
    |
235 |             let mut ent = entry.values.entry(s.to_string()).or_insert((0, 0));
    |                 ----^^^
    |                 |
    |                 help: remove this `mut`

warning: variable does not need to be mutable
   --> src/model/index_counter.rs:351:10
    |
351 |                     let mut tv = local_counter.values.entry(s.to_string()).or_insert((0, 0));
    |                         ----^^
    |                         |
    |                         help: remove this `mut`

warning: `garage_model` (lib) generated 10 warnings (run `cargo fix --lib -p garage_model` to apply 9 suggestions)
warning: use of deprecated associated function `garage_db::sled_adapter::SledDb::init`: The Sled database is now deprecated and will be removed in Garage v1.0. Please migrate to LMDB or Sqlite as soon as possible.
  --> src/garage/cli/convert_db.rs:39:29
   |
39 |             Ok(sled_adapter::SledDb::init(db))
   |                                      ^^^^
   |
   = note: `#[warn(deprecated)]` on by default

warning: `garage` (bin "garage") generated 1 warning
    Finished dev [unoptimized + debuginfo] target(s) in 0.28s

run:



RUST_LOG=garage=debug garage/target/debug/garage -c garage.toml server
2023-10-20T16:14:41.813738Z  INFO garage::server: Loading configuration...
2023-10-20T16:14:41.816155Z  INFO garage::server: Initializing Garage main data store...
2023-10-20T16:14:41.816559Z  INFO garage_model::garage: Opening database...
2023-10-20T16:14:41.816620Z  INFO garage_model::garage: Opening LMDB database at: ./.data/garage/meta/db.lmdb
Error: Invalid RPC secret key

status:

RUST_LOG=garage=debug garage/target/debug/garage -c garage.toml status
Error: Invalid RPC secret key (bad hex)
Odd number of digits
I am not sure if its the rust code or the config. env: main branch on m2 mac. config: garage.toml is exact copy of whats on web site at https://garagehq.deuxfleurs.fr/documentation/quick-start/ I just changed the path for LMDB data so that its local to the repo. ``` metadata_dir = "./.data/garage/meta" data_dir = "./.data/garage/data" db_engine = "lmdb" replication_mode = "none" rpc_bind_addr = "[::]:3901" rpc_public_addr = "127.0.0.1:3901" rpc_secret = "$(openssl rand -hex 32)" [s3_api] s3_region = "garage" api_bind_addr = "[::]:3900" root_domain = ".s3.garage.localhost" [s3_web] bind_addr = "[::]:3902" root_domain = ".web.garage.localhost" index = "index.html" [k2v_api] api_bind_addr = "[::]:3904" [admin] api_bind_addr = "0.0.0.0:3903" admin_token = "$(openssl rand -base64 32)" ``` make: ``` warning: variable does not need to be mutable --> src/model/helper/bucket.rs:129:7 | 129 | let mut bucket_p = bucket.state.as_option_mut().unwrap(); | ----^^^^^^^^ | | | help: remove this `mut` | = note: `#[warn(unused_mut)]` on by default warning: variable does not need to be mutable --> src/model/helper/bucket.rs:166:7 | 166 | let mut bucket_state = bucket.state.as_option_mut().unwrap(); | ----^^^^^^^^^^^^ | | | help: remove this `mut` warning: variable does not need to be mutable --> src/model/helper/bucket.rs:248:15 | 248 | if let Some(mut bucket_state) = bucket.state.as_option_mut() { | ----^^^^^^^^^^^^ | | | help: remove this `mut` warning: variable does not need to be mutable --> src/model/helper/bucket.rs:277:7 | 277 | let mut key_param = key.state.as_option_mut().unwrap(); | ----^^^^^^^^^ | | | help: remove this `mut` warning: variable does not need to be mutable --> src/model/helper/bucket.rs:286:7 | 286 | let mut bucket_p = bucket.state.as_option_mut().unwrap(); | ----^^^^^^^^ | | | help: remove this `mut` warning: variable does not need to be mutable --> src/model/helper/bucket.rs:329:7 | 329 | let mut bucket_p = bucket.state.as_option_mut().unwrap(); | ----^^^^^^^^ | | | help: remove this `mut` warning: variable does not need to be mutable --> src/model/helper/bucket.rs:362:7 | 362 | let mut key_param = key.state.as_option_mut().unwrap(); | ----^^^^^^^^^ | | | help: remove this `mut` warning: use of deprecated associated function `garage_db::sled_adapter::SledDb::init`: The Sled database is now deprecated and will be removed in Garage v1.0. Please migrate to LMDB or Sqlite as soon as possible. --> src/model/garage.rs:131:31 | 131 | db::sled_adapter::SledDb::init(db) | ^^^^ | = note: `#[warn(deprecated)]` on by default warning: variable does not need to be mutable --> src/model/index_counter.rs:235:8 | 235 | let mut ent = entry.values.entry(s.to_string()).or_insert((0, 0)); | ----^^^ | | | help: remove this `mut` warning: variable does not need to be mutable --> src/model/index_counter.rs:351:10 | 351 | let mut tv = local_counter.values.entry(s.to_string()).or_insert((0, 0)); | ----^^ | | | help: remove this `mut` warning: `garage_model` (lib) generated 10 warnings (run `cargo fix --lib -p garage_model` to apply 9 suggestions) warning: use of deprecated associated function `garage_db::sled_adapter::SledDb::init`: The Sled database is now deprecated and will be removed in Garage v1.0. Please migrate to LMDB or Sqlite as soon as possible. --> src/garage/cli/convert_db.rs:39:29 | 39 | Ok(sled_adapter::SledDb::init(db)) | ^^^^ | = note: `#[warn(deprecated)]` on by default warning: `garage` (bin "garage") generated 1 warning Finished dev [unoptimized + debuginfo] target(s) in 0.28s ``` run: ``` RUST_LOG=garage=debug garage/target/debug/garage -c garage.toml server 2023-10-20T16:14:41.813738Z INFO garage::server: Loading configuration... 2023-10-20T16:14:41.816155Z INFO garage::server: Initializing Garage main data store... 2023-10-20T16:14:41.816559Z INFO garage_model::garage: Opening database... 2023-10-20T16:14:41.816620Z INFO garage_model::garage: Opening LMDB database at: ./.data/garage/meta/db.lmdb Error: Invalid RPC secret key ``` status: ``` RUST_LOG=garage=debug garage/target/debug/garage -c garage.toml status Error: Invalid RPC secret key (bad hex) Odd number of digits ```
gedw99 changed title from Mac OS - garage.toml: Error: Invalid RPC secret key (bad hex) Odd number of digits to Mac OS - garage status - Error: Invalid RPC secret key (bad hex) Odd number of digits 2023-10-20 16:22:38 +00:00
Author

trying this approach, since i saw in the config it calls openssl.

Its seems to work :)

openssl rand -hex 32
7a967af14c6a03802b17b8047f64be5b2b7186d92a1f31e4feeb694cd86af146
# the in config replace: 
# rpc_secret = "$(openssl rand -hex 32)"
# rpc_secret = "a4cf65a94b8fe359289fc274846d70ee721d197722a0d067863cf36945a806a7"

then run server:

garage server
2023-10-20T16:26:40.927362Z  INFO garage::server: Loading configuration...
2023-10-20T16:26:40.934877Z  INFO garage::server: Initializing Garage main data store...
2023-10-20T16:26:40.936477Z  INFO garage_model::garage: Opening database...
2023-10-20T16:26:40.936825Z  INFO garage_model::garage: Opening LMDB database at: ./.data/garage/meta/db.lmdb
2023-10-20T16:26:40.942433Z  INFO garage_model::garage: Initialize background variable system...
2023-10-20T16:26:40.942450Z  INFO garage_model::garage: Initialize membership management system...
2023-10-20T16:26:40.943436Z  INFO garage_rpc::system: Generating new node key pair.
2023-10-20T16:26:40.943962Z  INFO garage_rpc::system: Node ID of this node: 4249cfc6a82cfa55
2023-10-20T16:26:40.944015Z  INFO garage_rpc::system: No valid previous cluster layout stored (IO error: No such file or directory (os error 2)), starting fresh.
2023-10-20T16:26:40.945509Z  WARN garage_rpc::ring: Could not build ring: network role assignment data has invalid length
2023-10-20T16:26:40.946257Z  INFO garage_model::garage: Initialize block manager...
2023-10-20T16:26:40.949374Z  INFO garage_model::garage: Initialize bucket_table...
2023-10-20T16:26:40.952701Z  INFO garage_model::garage: Initialize bucket_alias_table...
2023-10-20T16:26:40.953025Z  INFO garage_model::garage: Initialize key_table_table...
2023-10-20T16:26:40.953208Z  INFO garage_model::garage: Initialize block_ref_table...
2023-10-20T16:26:40.953543Z  INFO garage_model::garage: Initialize version_table...
2023-10-20T16:26:40.953686Z  INFO garage_model::garage: Initialize multipart upload counter table...
2023-10-20T16:26:40.954069Z  INFO garage_model::garage: Initialize multipart upload table...
2023-10-20T16:26:40.954260Z  INFO garage_model::garage: Initialize object counter table...
2023-10-20T16:26:40.954443Z  INFO garage_model::garage: Initialize object_table...
2023-10-20T16:26:40.954604Z  INFO garage_model::garage: Load lifecycle worker state...
2023-10-20T16:26:40.955218Z  INFO garage_model::garage: Initialize K2V counter table...
2023-10-20T16:26:40.955398Z  INFO garage_model::garage: Initialize K2V subscription manager...
2023-10-20T16:26:40.955405Z  INFO garage_model::garage: Initialize K2V item table...
2023-10-20T16:26:40.955586Z  INFO garage_model::garage: Initialize K2V RPC handler...
2023-10-20T16:26:40.955639Z  INFO garage::server: Initializing background runner...
2023-10-20T16:26:40.955810Z  INFO garage::server: Spawning Garage workers...
2023-10-20T16:26:40.957344Z  INFO garage_model::s3::lifecycle_worker: Starting lifecycle worker for 2023-10-20
2023-10-20T16:26:40.957362Z  INFO garage::server: Initialize Admin API server and metrics collector...
2023-10-20T16:26:40.958386Z  INFO garage::server: Launching internal Garage cluster communications...
2023-10-20T16:26:40.958562Z  INFO garage::server: Create admin RPC handler...
2023-10-20T16:26:40.959211Z  INFO garage::server: Initializing S3 API server...
2023-10-20T16:26:40.959363Z  INFO garage::server: Initializing K2V API server...
2023-10-20T16:26:40.959432Z  INFO garage::server: Initializing web server...
2023-10-20T16:26:40.959515Z  INFO garage::server: Launching Admin API server...
2023-10-20T16:26:40.959804Z  INFO garage_api::generic_server: K2V API server listening on http://[::]:3904
2023-10-20T16:26:40.959631Z  INFO garage_web::web_server: Web server listening on http://[::]:3902
2023-10-20T16:26:40.959655Z  INFO garage_api::generic_server: S3 API server listening on http://[::]:3900
2023-10-20T16:26:40.959808Z  INFO garage_api::generic_server: Admin API server listening on http://0.0.0.0:3903
2023-10-20T16:26:40.960233Z  INFO garage_rpc::system: Doing a bootstrap/discovery step (not_configured: true, no_peers: false, bad_peers: true)
2023-10-20T16:26:40.962826Z  INFO garage_model::s3::lifecycle_worker: Lifecycle worker finished for 2023-10-20, objects expired: 0, mpu aborted: 0

then status:

status
==== HEALTHY NODES ====
ID                Hostname                  Address         Tags              Zone  Capacity  DataAvail
4249cfc6a82cfa55  apples-MacBook-Pro.local  127.0.0.1:3901  NO ROLE ASSIGNED
trying this approach, since i saw in the config it calls openssl. Its seems to work :) ``` openssl rand -hex 32 7a967af14c6a03802b17b8047f64be5b2b7186d92a1f31e4feeb694cd86af146 # the in config replace: # rpc_secret = "$(openssl rand -hex 32)" # rpc_secret = "a4cf65a94b8fe359289fc274846d70ee721d197722a0d067863cf36945a806a7" ``` then run server: ``` garage server 2023-10-20T16:26:40.927362Z INFO garage::server: Loading configuration... 2023-10-20T16:26:40.934877Z INFO garage::server: Initializing Garage main data store... 2023-10-20T16:26:40.936477Z INFO garage_model::garage: Opening database... 2023-10-20T16:26:40.936825Z INFO garage_model::garage: Opening LMDB database at: ./.data/garage/meta/db.lmdb 2023-10-20T16:26:40.942433Z INFO garage_model::garage: Initialize background variable system... 2023-10-20T16:26:40.942450Z INFO garage_model::garage: Initialize membership management system... 2023-10-20T16:26:40.943436Z INFO garage_rpc::system: Generating new node key pair. 2023-10-20T16:26:40.943962Z INFO garage_rpc::system: Node ID of this node: 4249cfc6a82cfa55 2023-10-20T16:26:40.944015Z INFO garage_rpc::system: No valid previous cluster layout stored (IO error: No such file or directory (os error 2)), starting fresh. 2023-10-20T16:26:40.945509Z WARN garage_rpc::ring: Could not build ring: network role assignment data has invalid length 2023-10-20T16:26:40.946257Z INFO garage_model::garage: Initialize block manager... 2023-10-20T16:26:40.949374Z INFO garage_model::garage: Initialize bucket_table... 2023-10-20T16:26:40.952701Z INFO garage_model::garage: Initialize bucket_alias_table... 2023-10-20T16:26:40.953025Z INFO garage_model::garage: Initialize key_table_table... 2023-10-20T16:26:40.953208Z INFO garage_model::garage: Initialize block_ref_table... 2023-10-20T16:26:40.953543Z INFO garage_model::garage: Initialize version_table... 2023-10-20T16:26:40.953686Z INFO garage_model::garage: Initialize multipart upload counter table... 2023-10-20T16:26:40.954069Z INFO garage_model::garage: Initialize multipart upload table... 2023-10-20T16:26:40.954260Z INFO garage_model::garage: Initialize object counter table... 2023-10-20T16:26:40.954443Z INFO garage_model::garage: Initialize object_table... 2023-10-20T16:26:40.954604Z INFO garage_model::garage: Load lifecycle worker state... 2023-10-20T16:26:40.955218Z INFO garage_model::garage: Initialize K2V counter table... 2023-10-20T16:26:40.955398Z INFO garage_model::garage: Initialize K2V subscription manager... 2023-10-20T16:26:40.955405Z INFO garage_model::garage: Initialize K2V item table... 2023-10-20T16:26:40.955586Z INFO garage_model::garage: Initialize K2V RPC handler... 2023-10-20T16:26:40.955639Z INFO garage::server: Initializing background runner... 2023-10-20T16:26:40.955810Z INFO garage::server: Spawning Garage workers... 2023-10-20T16:26:40.957344Z INFO garage_model::s3::lifecycle_worker: Starting lifecycle worker for 2023-10-20 2023-10-20T16:26:40.957362Z INFO garage::server: Initialize Admin API server and metrics collector... 2023-10-20T16:26:40.958386Z INFO garage::server: Launching internal Garage cluster communications... 2023-10-20T16:26:40.958562Z INFO garage::server: Create admin RPC handler... 2023-10-20T16:26:40.959211Z INFO garage::server: Initializing S3 API server... 2023-10-20T16:26:40.959363Z INFO garage::server: Initializing K2V API server... 2023-10-20T16:26:40.959432Z INFO garage::server: Initializing web server... 2023-10-20T16:26:40.959515Z INFO garage::server: Launching Admin API server... 2023-10-20T16:26:40.959804Z INFO garage_api::generic_server: K2V API server listening on http://[::]:3904 2023-10-20T16:26:40.959631Z INFO garage_web::web_server: Web server listening on http://[::]:3902 2023-10-20T16:26:40.959655Z INFO garage_api::generic_server: S3 API server listening on http://[::]:3900 2023-10-20T16:26:40.959808Z INFO garage_api::generic_server: Admin API server listening on http://0.0.0.0:3903 2023-10-20T16:26:40.960233Z INFO garage_rpc::system: Doing a bootstrap/discovery step (not_configured: true, no_peers: false, bad_peers: true) 2023-10-20T16:26:40.962826Z INFO garage_model::s3::lifecycle_worker: Lifecycle worker finished for 2023-10-20, objects expired: 0, mpu aborted: 0 ``` then status: ``` status ==== HEALTHY NODES ==== ID Hostname Address Tags Zone Capacity DataAvail 4249cfc6a82cfa55 apples-MacBook-Pro.local 127.0.0.1:3901 NO ROLE ASSIGNED ```
lx closed this issue 2023-10-23 09:14:41 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Deuxfleurs/garage#659
No description provided.