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

konfig fails when run inside bash loop #156

Open
max-l-weaver opened this issue Feb 12, 2019 · 1 comment
Open

konfig fails when run inside bash loop #156

max-l-weaver opened this issue Feb 12, 2019 · 1 comment

Comments

@max-l-weaver
Copy link

max-l-weaver commented Feb 12, 2019

kongfig version: 1.5.3

We run kongfig inside a bash loop that loops over a list of *.yml files and runs a kongfig --path $PATH for each one, so our script looks like this:

for config in $(/var/lib/path/to/files/*.yml);
do
  echo $config
  /bin/kongfig --path $config
  sleep 10
done

which has worked fine until recently, when we're getting the following errors per loop:

Loading config /var/lib/path/to/files/config.yml
Apply config to localhost:8001
Kong version: 0.12.1
Error: http://localhost:8001/apis/ee23b.../plugins: 500 Internal Server Error
 Error: http://localhost:8001/apis/ee23b.../plugins: 500 Internal Server Error
    at /usr/lib/node_modules/kongfig/lib/adminApi.js:139:25
    at process._tickCallback (internal/process/next_tick.js:109:7)

However if I run each one manually they work without issue.

sudo kongfig --path /var/lib/path/to/config/file.yml
Loading config /var/lib/path/to/config/file.yml
Apply config to localhost:8001
Kong version: 0.12.1

PATCH http://localhost:8001/apis/foo
 { upstream_url: 'https://foo.com',
  uris: [ '/' ],
  hosts: 'bar.foo.com' }
200 OK { created_at: 1519909028690,
  strip_uri: true,
  id: '',
  hosts: [ 'bar.foo.com' ],
  name: ...

As you can see our Kong version is 0.12.1
Any advice would be great,, thanks!

@takearun
Copy link

Hi, I am facing the same issue and seems to have been introduced in the later versions.
I have a feeling it's to do with the number of concurrent DB Connections Kongfig uses in the background. Any fix or workaround or suggestions would be helpful.

Thanks,
Arun

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

2 participants