question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Docker container issue - cannot find kibitzr-creds.yml

See original GitHub issue

using centos 7.8 on a Dell Rsomething

docker version 19.03.08

docker image peterdemin/kibitzer:latest

running the docker command from documentation

  • docker run -v $PWD:/root/.config/kibitzr -v $PWD/pages:/pages peterdemin/kibitzr run

Getting error:

2020-04-01 23:33:41,187 [INFO] kibitzr.conf: No credentials file found at /root/.config/kibitzr/kibitzr-creds.yml
Traceback (most recent call last):
  File "/usr/local/bin/kibitzr", line 11, in <module>
    load_entry_point('kibitzr', 'console_scripts', 'kibitzr')()
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/kibitzr/kibitzr/cli.py", line 75, in run
    sys.exit(app.run(once=False, log_level=ctx.obj['log_level'], names=name))
  File "/kibitzr/kibitzr/app.py", line 65, in run
    checks=settings().checks,
  File "/kibitzr/kibitzr/conf.py", line 166, in settings
    return ReloadableSettings.instance()
  File "/kibitzr/kibitzr/conf.py", line 52, in instance
    cls._instance = cls(config_dir)
  File "/kibitzr/kibitzr/conf.py", line 32, in __init__
    self.reread()
  File "/kibitzr/kibitzr/conf.py", line 63, in reread
    checks = self.parser.parse_checks(conf)
  File "/kibitzr/kibitzr/conf.py", line 178, in parse_checks
    checks = conf.get('checks', conf.get('pages', []))
AttributeError: 'NoneType' object has no attribute 'get'

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
peterdemincommented, Apr 5, 2020

Make sure you’re using the current version:

$ docker run --rm peterdemin/kibitzr version
6.0.0

I updated docs with the correct directory mapping. I’m sorry for the poor initial experience. I’m closing the issue. Feel free to reopen, if it doesn’t work for you.

0reactions
peterdemincommented, Apr 5, 2020

I tried to reproduce the issue with the latest Docker container, but it worked. Note, that I changed directory mapping and pass -l debug for verbose logging:

$ ll  # No files in current directory
total 44
drwxrwxr-x   2 ***** *****  4096 Apr  4 21:49 ./
drwx------ 153 ***** ***** 36864 Apr  4 21:28 ../

$ # Run without configuration files:
$ docker run -v $PWD:/root --rm peterdemin/kibitzr -l debug once
Traceback (most recent call last):
  File "/usr/local/bin/kibitzr", line 11, in <module>
    load_entry_point('kibitzr', 'console_scripts', 'kibitzr')()
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/kibitzr/kibitzr/cli.py", line 65, in once
    sys.exit(app.run(once=True, log_level=ctx.obj['log_level'], names=name))
  File "/kibitzr/kibitzr/app.py", line 65, in run
    checks=settings().checks,
  File "/kibitzr/kibitzr/conf.py", line 166, in settings
    return ReloadableSettings.instance()
  File "/kibitzr/kibitzr/conf.py", line 51, in instance
    config_dir = cls.detect_config_dir()
  File "/kibitzr/kibitzr/conf.py", line 45, in detect_config_dir
    % ", ".join([x[1] for x in candidates])
kibitzr.exceptions.ConfigurationError: kibitzr.yml not found in following locations: kibitzr.yml, /root/.config/kibitzr/kibitzr.yml, /root/kibitzr.yml

$ # Bootstrap example configuration:
$ docker run -v $PWD:/root --rm peterdemin/kibitzr -l debug init
2020-04-05 01:50:32,669 [INFO] kibitzr.bootstrap: Saving sample check in kibitzr.yml
2020-04-05 01:50:32,669 [INFO] kibitzr.bootstrap: Creating kibitzr-creds.yml

$ # Check that files are created in the current directory:
$ ll
total 68
drwxrwxr-x   2 ***** *****  4096 Apr  4 21:50 ./
drwx------ 153 ***** ***** 36864 Apr  4 21:28 ../
-rw-------   1 root   root     173 Apr  4 21:50 kibitzr-creds.yml
-rw-r--r--   1 root   root     308 Apr  4 21:50 kibitzr.yml

$ # Run sample checks once with the sample config:
$ docker run -v $PWD:/root --rm peterdemin/kibitzr -l debug once
2020-04-05 01:50:52,838 [DEBUG] kibitzr.conf: Loading credentials from /root/kibitzr-creds.yml
2020-04-05 01:50:52,846 [DEBUG] kibitzr.conf: Loading settings from /root/kibitzr.yml
2020-04-05 01:50:57,000 [INFO] kibitzr.fetcher.loader: Fetching Kibitzr release at https://pypi.python.org/pypi/kibitzr/json
2020-04-05 01:50:57,024 [DEBUG] cachecontrol.controller: Looking up "https://pypi.python.org/pypi/kibitzr/json" in the cache
2020-04-05 01:50:57,025 [DEBUG] cachecontrol.controller: No cache entry available
2020-04-05 01:50:57,026 [DEBUG] urllib3.connectionpool: Starting new HTTPS connection (1): pypi.python.org:443
2020-04-05 01:50:57,236 [DEBUG] urllib3.connectionpool: https://pypi.python.org:443 "GET /pypi/kibitzr/json HTTP/1.1" 301 122
2020-04-05 01:50:57,236 [DEBUG] cachecontrol.controller: Updating cache with response from "https://pypi.python.org/pypi/kibitzr/json"
2020-04-05 01:50:57,237 [DEBUG] cachecontrol.controller: Caching permanant redirect
2020-04-05 01:50:57,238 [DEBUG] cachecontrol.controller: Looking up "https://pypi.org/pypi/kibitzr/json" in the cache
2020-04-05 01:50:57,238 [DEBUG] cachecontrol.controller: No cache entry available
2020-04-05 01:50:57,239 [DEBUG] urllib3.connectionpool: Starting new HTTPS connection (1): pypi.org:443
2020-04-05 01:50:57,325 [DEBUG] urllib3.connectionpool: https://pypi.org:443 "GET /pypi/kibitzr/json HTTP/1.1" 200 24569
2020-04-05 01:50:57,335 [DEBUG] cachecontrol.controller: Updating cache with response from "https://pypi.org/pypi/kibitzr/json"
2020-04-05 01:50:57,335 [DEBUG] cachecontrol.controller: Caching due to etag
2020-04-05 01:51:00,179 [DEBUG] kibitzr.notifier.factory: Sending report: 'Kibitzr release at https://pypi.python.org/pypi/kibitzr/json\n6.0.0'
2020-04-05 01:51:00,179 [INFO] kibitzr.notifier.custom: Executing Python notifier
2020-04-05 01:51:00,179 [DEBUG] kibitzr.notifier.custom: print(content)
Kibitzr release at https://pypi.python.org/pypi/kibitzr/json
6.0.0

$ ll  # pages/ directory created during previous command:
total 72
drwxrwxr-x   3 ***** *****  4096 Apr  4 21:50 ./
drwx------ 153 ***** ***** 36864 Apr  4 21:28 ../
-rw-------   1 root   root     173 Apr  4 21:50 kibitzr-creds.yml
-rw-r--r--   1 root   root     308 Apr  4 21:50 kibitzr.yml
drwxr-xr-x   3 root   root    4096 Apr  4 21:50 pages/

⚠️ Before I did docker pull, I had issues similar to what you’ve seen.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Docker Compose Up gives "The system cannot find the file ...
My issue was that I hadn't actually run Docker first; I just installed the .msi and ran "docker-compose" from the command line. Once...
Read more >
How to Fix and Debug Docker Containers Like a Superhero
While spinning up a new container, you'll hit a snag. The runtime in this instance will fail since Docker cannot find the executable....
Read more >
Use Docker Compose - Docker Documentation
Docker Compose is a tool that was developed to help define and share multi-container applications. With Compose, we can create a YAML file...
Read more >
Store configuration data using Docker Configs
You cannot remove a config that a running service is using. ... The first command below illustrates how to find the container ID,...
Read more >
Docker Context - Docker Documentation
This guide shows how contexts make it easy for a single Docker CLI to manage multiple Swarm clusters, multiple Kubernetes clusters, and multiple...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found