Giter VIP home page Giter VIP logo

Comments (9)

calvn avatar calvn commented on June 26, 2024

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.

juicedM3 avatar juicedM3 commented on June 26, 2024

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.

juicedM3 avatar juicedM3 commented on June 26, 2024

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.

juicedM3 avatar juicedM3 commented on June 26, 2024

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.

juicedM3 avatar juicedM3 commented on June 26, 2024

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.

calvn avatar calvn commented on June 26, 2024

You're right, it looks like /lib/config_reader.js#L17 is using process.env.TOKEN instead of global.token

from git2consul.

juicedM3 avatar juicedM3 commented on June 26, 2024

Other locations:

If you want, I can create a pull request and use utils/config_seeder.js as the example.

from git2consul.

calvn avatar calvn commented on June 26, 2024

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.

juicedM3 avatar juicedM3 commented on June 26, 2024

It works. Thanks guys!

from git2consul.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.