ethersphere / bee

Bee is a Swarm client implemented in Go. It’s the basic building block for the Swarm network: a private; decentralized; and self-sustaining network for permissionless publishing and access to your (application) data.
https://www.ethswarm.org
BSD 3-Clause "New" or "Revised" License
1.45k stars 339 forks source link

bee printconfig gives wrong info #4850

Open cobordism opened 1 month ago

cobordism commented 1 month ago

Context

$ /usr/bin/bee version
2.1.0-de7eccc1
$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 12 (bookworm)
Release:    12
Codename:   bookworm

Summary

bee was installed via apt install bee=2.1.0 and started via systemctl. The configuration file is in /etc/bee/bee.yaml

Expected behaviour

I expect bee printconfig to return the configuration of the running bee... or at least sudo bee printconfig. At the very very least I would expect sudo -u bee bee printconfig to print the correct config of the running bee and for the documentation to call out the need for sudo -u bee.

Actual behavior

bee printconfig prints the default configuration and completely ignores the configuration in /etc/bee that the running bee is using.

Steps to reproduce

install bee from apt repository. Start bee with systemctl start bee.service

note:

$ cat /etc/systemd/system/multi-user.target.wants/bee.service 
[Unit]
Description=Bee - Ethereum Swarm node
Documentation=https://docs.ethswarm.org
After=network.target

[Service]
EnvironmentFile=-/etc/default/bee
NoNewPrivileges=true
User=bee
Group=bee
ExecStart=/usr/bin/bee start --config /etc/bee/bee.yaml
Restart=always
RestartSec=5s

[Install]
WantedBy=multi-user.target

Possible solution

query the running bee to dump its actually used configuration ?

ldeffenb commented 1 month ago

AFAIK, that is WAD - Working As Designed.

cobordism commented 1 month ago

AFAIK, that is WAD - Working As Designed.

then how would I query what the configuration is of the bee client that is currently running?

$ bee -h | grep printconfig
  printconfig Print default or provided configuration in yaml format

Looks like it should print default or provided configuration in yaml format. no?