muesli / beehive

A flexible event/agent & automation system with lots of bees 🐝
GNU Affero General Public License v3.0
6.3k stars 324 forks source link

Configuration file is not created #287

Closed crile closed 4 years ago

crile commented 4 years ago

Hi,

I simply run "beehive.exe" but nothing is created in the current directory.

$ beehive -version
Beehive 0.3.2 (c66102d5e32bffbad9124d41ae2ffd203ee55399)

$ beehive -help
Usage of beehive.exe:
  -bind string
        Which address to bind Beehive's API & admin interface to (default "localhost:8181")
  -canonicalurl string
        Canonical URL for the API & admin interface (default "http://localhost:8181")
  -config string
        Config-file to use (default "./beehive.conf")
  -version
        Beehive version
muesli commented 4 years ago

Did you connect to the Admin interface and created some Bees and Chains?

crile commented 4 years ago

Yes I did. I even try with "-config" flag. I stop the server with "CTRL+C". The file is not generated during the startup ?

muesli commented 4 years ago

@crile Could you paste Beehive's output just before & after hitting CTRL-C?

crile commented 4 years ago

Extract of the console output below.

INFO[0213] Handling request                              Method=GET URL=/v1/bees
INFO[0213] Finished request                              Duration="996.8µs" Method=GET Response=200 URL=/v1/bees
INFO[0217] Got signal: interrupt                        
INFO[0217] Storing config...                    

I attached the log file beehive.log

crile commented 4 years ago

Sorry, it is not a beehive bug.

I use an alternative console (nyagos.exe), and I think that the kill signal force beehive.exe to stop so it doesn't have the time to write its configuration file.

It is the first time that I encounter this kind of issue.

Thanks anyway.

muesli commented 4 years ago

Interesting! So you can't reproduce this when starting from a "normal" cmd? There's already a PR which changes this behavior a bit and stores the config before shutdown. I guess this should improve the situation, even though it's clearly never ideal if the console kills the process while it's shutting down.

crile commented 4 years ago

Yes, "CRTL+c" in "normal" cmd works properly. Thanks.