Comments (9)
Can you try running it again, but without the --config-file
flag? Looking at that log message, I suspect something is wrong with config_reader.read()
, but I want to double check that it is not related to config_seeder.js
from git2consul.
Same result (minus writing to consul) as with the flag.
Thanks!
Justin
On Thu, Mar 24, 2016 at 5:57 PM, Calvin Leung Huang < [email protected] [[email protected]] > wrote:
Can you try running it again, but without the --config-file flag? Looking at that log message, I suspect something is wrong with config_reader.read() , but I want to double check that it is not related to config_seeder.js
—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub [https://github.com//issues/67#issuecomment-201043010]
from git2consul.
Adding example:
$ node . --endpoint consul.service.consul --port 8500 --token $MASTER_TOKEN | python -mjson.tool
Config value is not valid JSON: undefined
{
"hostname": "host.example.com",
"level": 30,
"msg": "item: undefined",
"name": "git2consul",
"pid": 8245,
"time": "2016-03-25T13:57:50.383Z",
"v": 0
}
Is it having an issue parsing the config when it fetches it from Consul?
from git2consul.
Looking at the config in Consul:
$ curl http://consul.service.consul:8500/v1/kv/git2consul/config?raw\&token=$MASTER_TOKEN
{
"version": "1.0",
"repos": [{
"name": "sample_configuration",
"url": "https://github.com/ryanbreen/git2consul_data.git",
"branches": ["dev"],
"hooks": [{
"type": "polling",
"interval": "1"
}]
}]
}
from git2consul.
The Consul ACL token is not being passed along for reads. When I export the ENV variable TOKEN, it works as expected.
$ TOKEN=$MASTER_TOKEN node . --endpoint jb11 --port 8500 --token $MASTER_TOKEN
{"name":"git2consul","hostname":"host.example.com","pid":9905,"level":30,"msg":"git2consul is running","time":"2016-03-25T14:09:20.777Z","v":0}
{"name":"git2consul","hostname":"host.example.com","pid":9905,"level":30,"msg":"Initting repo sample_configuration","time":"2016-03-25T14:09:20.786Z","v":0}
{"name":"git2consul","hostname":"host.example.com","pid":9905,"level":30,"msg":"Initting branch /tmp/sample_configuration /tmp/sample_configuration/dev","time":"2016-03-25T14:09:20.786Z","v":0}
{"name":"git2consul","hostname":"host.example.com","pid":9905,"level":30,"msg":"Initialized branch dev from sample_configuration","time":"2016-03-25T14:09:21.174Z","v":0}
{"name":"git2consul","hostname":"host.example.com","pid":9905,"level":30,"msg":"Loaded repo sample_configuration","time":"2016-03-25T14:09:21.177Z","v":0}
$ curl http://consul.service.consul:8500/v1/kv/sample_configuration/dev/sample.json?raw\&token=$MASTER_TOKEN
{
"sample": "configuration"
}
$ curl http://consul.service.consul:8500/v1/kv/sample_configuration/dev/sample.conf?raw\&token=$MASTER_TOKEN
sample = configuration
$ curl http://consul.service.consul:8500/v1/kv/sample_configuration/dev/sample.yaml?raw\&token=$MASTER_TOKEN
sample: configuration
from git2consul.
You're right, it looks like /lib/config_reader.js#L17 is using process.env.TOKEN
instead of global.token
from git2consul.
Other locations:
- https://github.com/Cimpress-MCP/git2consul/blob/35ee67aee083f1e48843a05f46c75b0abe089a8a/utils/consul_purge.js#L13
- https://github.com/Cimpress-MCP/git2consul/blob/35ee67aee083f1e48843a05f46c75b0abe089a8a/utils/consul_ls.js#L8
- https://github.com/Cimpress-MCP/git2consul/blob/466df22c7a8c7d598baf51a4b7c4c1742bb87839/test/git2consul_halt_on_change_test.js#L19
If you want, I can create a pull request and use utils/config_seeder.js as the example.
from git2consul.
The changes has been released on v0.12.9
I did not change /test/git2consul_halt_on_change.js
to use global.token since that test case doesn't go through index.js and therefore there is no option to pass in the token.
from git2consul.
It works. Thanks guys!
from git2consul.
Related Issues (20)
- Java Properties file `+` is removed HOT 5
- Error consul: kv.get: moved permanently HOT 2
- Is a new release planned anytime soon? HOT 10
- git2consul unable to install due to pinkie-promise being unpublished HOT 1
- Git2Consul does not support keys containing '[' and ']' HOT 2
- Git2consul Generates PUT GET every 2 seconds on local agent. Why is that?
- How to configure parameters to use consul with HTTPS? HOT 1
- Problem synchronizing binary files
- git2consul is not converting .json file to KV entry in consul HOT 3
- git2consul problem does not cause Docker container to exit HOT 4
- Project status, new official fork? HOT 6
- Getting [Error: consul: kv.get: connect ECONNREFUSED] HOT 1
- Update of git files trigger unwanted delete of similar key name in consul
- support unix socket?
- files in git not within source_root forcing check_pending to setLastProcessedRef HOT 1
- Files not in source_root are killing my consul API. HOT 1
- support_tags should have option for "true", "false", and "read_once"
- git2consul not importing list in yaml HOT 1
- Git2Consul tool not supported for Google Cloud Run
- Windows - running example sync content of git2consul.json intro Consul KV
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from git2consul.