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

error while reading config.toml: Config File \"config\" Not Found #12

Open
Throbac-Labs opened this issue Apr 12, 2022 · 1 comment
Open

Comments

@Throbac-Labs
Copy link

Having an issue with running the solana_mc.service

It looks like the service cannot locate my config.toml when the execution begins.

here's the error:

Apr 12 18:10:13 solana2 solana-mc[219813]: time="2022-04-12T18:10:13Z" level=fatal msg="error while reading config.toml: Config File "config" Not Found in "[/ /home/$USER/.solana-mc/config]""

here's the systemd file located in /lib/systemd/system/solana_mc.service:

[Unit]
Description=Solana-mc
After=network-online.target

[Service]
User=$USER 
Environment="SOLANA_BINARY_PATH=/home/sol/.local/share/solana/install/active_release/bin/solana"
ExecStart=/home/$USER/go/bin/solana-mc 
Restart=always
RestartSec=3
LimitNOFILE=4096

[Install]
WantedBy=multi-user.target

Current solana-mc script was built using:

 $ go build -o /home/$USER/go/bin/solana-mc 

and my config.toml

[rpc_and_lcd_endpoints]
rpc_endpoint = "http://localhost:8899"
network_rpc = "http://localhost:8899"

[validator_details]
validator_name = "throbacLabs"
pub_key = "AcK8zw3FUvHLZUBXByWMzkESx319bPkVEEt7qvrNMoSY"
vote_key = "4LQL2azc6VDPxWtTPFvi9MCQs32BFyxeMuUyPktD38s8"

[enable_alerts]
enable_telegram_alerts = false
enable_email_alerts = false

[regular_status_alerts]
alert_timings = ["02:30AM","02:30PM"]

[alerter_preferences]
delegation_alerts = "yes"
block_diff_alerts = "yes"
node_health_alert = "yes"
epoch_diff_alrets = "yes"
account_balance_change_alerts = "yes"
skip_rate_alerts = "yes"

[alerting_threholds]
block_diff_threshold = 10
balance_change_threshold = 1000.123
epoch_diff_threshold = 0

The script works just fine when i type "solana-mc" into the command prompt, and I see metrics in grafana via prometheus.

I examined the config.go file within the repos config directory and see where the error is coming from, but I am still unsure where & exactly what i need to do to fix the config path error.

Things i tried:

  • cp example.config.toml /home/$USER/config.toml -- to create config.toml in the /home/user location
  • export CONFIG_PATH="/home/$USER"
  • tried adding a --config flag to the exec function inside the systemd file
  • tried using the repo path for the exec "/home/monitoring/solana-mission-control/solana-mc"
    • used this when i built the go script "solana-=mc" inside this repo

Running Ubuntu 20.04 with a validator on Solana Devnet.

Any help is appreciated!

@Throbac-Labs
Copy link
Author

Throbac-Labs commented Apr 12, 2022

UPDATE:

Was able to solve by adding a "Working Directory" variable to the /lib/systemd/system/solana_mc.service


[Unit]
Description=Solana-mc
After=network-online.target

[Service]
User=$USER 
Environment="SOLANA_BINARY_PATH=/home/sol/.local/share/solana/install/active_release/bin/solana"
WorkingDirectory=/home/$USER
ExecStart=/home/$USER/go/bin/solana-mc 
Restart=always
RestartSec=3
LimitNOFILE=4096

[Install]
WantedBy=multi-user.target

Might be worth adding to the repo, def a little confusing trying to make sure the service can access the necessary config. I was not able to get 'export CONFIG_PATH="/home/$USER"' to work. I'm sure I'm missing something, but hopefully this helps others!

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