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

Provide an effective configuration file #610

Open
bwangelme opened this issue Mar 24, 2023 · 0 comments
Open

Provide an effective configuration file #610

bwangelme opened this issue Mar 24, 2023 · 0 comments

Comments

@bwangelme
Copy link

Hello, I'm trying to run the thrift server example in this repo. thriftbp/example_server_test.go

But got some errors related to configuration files, please help me.

1. No config file panic

I run the server by go run server.go, i get a panic error

panic: no $BASEPLATE_CONFIG_PATH specified, cannot load config

goroutine 1 [running]:

which indicating that no $BASEPLATE_CONFIG_PATH environment variable is specified, which means the server cannot load the necessary configuration file. To fix this error, I specify the path to the configuration file by setting the BASEPLATE_CONFIG_PATH environment variable to the path of the configuration file, like this:

BASEPLATE_CONFIG_PATH='example/server_cfg.yaml' go run server.go

example/server_cfg.yaml is copy from unittest baseplate_test.go, and I delete the redis config.

2. secrets.json not exist panic

Then, I run the server with BASEPLATE_CONFIG_PATH='example/server_cfg.yaml' go run server.go

The server starts normally, But a few seconds laster, the server panic, and I got following error

ø> BASEPLATE_CONFIG_PATH='example/server_cfg.yaml' go run server.go
2023-03-24T17:23:06.864+0800    DEBUG   Parsed configuration as *baseplate.Config:
addr: :8080
timeout: 30s
stopTimeout: 30s
log:
 level: info
runtime:
 numProcesses:
  max: 100
secrets:
 path: /tmp/secrets.json
tracing:
 namespace: baseplate-test
 queueName: test
 recordTimeout: 1ms
 sampleRate: 0.01
        {"pre_init": true}
maxprocs: Leaving GOMAXPROCS=12: CPU quota undefined
panic: baseplate.New: failed to init secrets: filewatcher: context canceled while waiting for file(s) under "/tmp/secrets.json" to load: errorsbp.Batch: total 2 error(s) in this batch: context deadline exceeded; last error: filewatcher: i/o error: stat /tmp/secrets.json: no such file or directory (config: secrets.Config{Path:"/tmp/secrets.json"})

which means I need to provide a valid secrets.json config file. What's the format of secrets.json, can you give me an exmaple, and explain it's meaning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant