anchore
anchore copied to clipboard
Catalog Service error
Hi
I am unable to start up completely I get an error when the catalog is enabled..
sh-4.2# /bin/twistd --logger=anchore_engine.subsys.twistd_logger.logger --pidfile /var/run/anchore-catalog.pid -n anchore-catalog --config /config
[service:catalog] 2018-06-26 12:16:09+0000 [-] [bootstrap] [WARNING] no webhooks defined in configuration file - notifications will be disabled
[service:catalog] 2018-06-26 12:16:09+0000 [-] [bootstrap] [INFO] initializing database
[service:catalog] 2018-06-26 12:16:11+0000 [-] [bootstrap] [INFO] Archive initialization complete
[service:catalog] 2018-06-26 12:16:11+0000 [-] [bootstrap] [ERROR] cannot create/init/register service: catalog - exception: unable to initialize default user data - exception: coercing to Unicode: need string or buffer, NoneType found
[service:catalog] 2018-06-26 12:16:11+0000 [-] [bootstrap] [ERROR] cannot start service (see above for information)
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/anchore_engine/services/common.py", line 362, in makeService
rc = smodule.initializeService(sname, localconfig)
File "/usr/lib/python2.7/site-packages/anchore_engine/services/catalog/init.py", line 107, in initializeService
raise Exception ("unable to initialize default user data - exception: " + str(err))
Exception: unable to initialize default user data - exception: coercing to Unicode: need string or buffer, NoneType found
Traceback (most recent call last):
File "/bin/twistd", line 11, in
Copy of the configfile:
Anchore Service Configuration File
General system-wide configuration options, these should not need to
be altered for basic operation
service_dir: '/config'
tmp_dir: '/tmp'
log_level: 'DEBUG'
log_level: 'INFO' cleanup_images: True
allow_awsecr_iam_auto: False
docker_conn: 'unix://var/run/docker.sock'
docker_conn_timeout: 600
host_id: 'anchore-engine' internal_ssl_verify: False auto_restart_services: True
credentials: default_user: 'admin' users: admin: password: 'admin' email: '[email protected]' external_service_auths: # anchoreio: # anchorecli: # auth: 'myanchoreiouser:myanchoreiopass' #auto_policy_sync: True
database: db_connect: 'postgresql+pg8000://postgres:postgres@postgres:5432/postgres' db_connect_args: timeout: 120 ssl: False db_pool_size: 30 db_pool_max_overflow: 100
services: apiext: enabled: True require_auth: True endpoint_hostname: 'anchore-engine' listen: '0.0.0.0' port: 8228 kubernetes_webhook: enabled: True require_auth: False endpoint_hostname: 'anchore-engine' listen: '0.0.0.0' port: 8338 catalog: enabled: True require_auth: False endpoint_hostname: 'anchore-engine' listen: '0.0.0.0' port: 8082 external_port: 8082 external_tls: False archive: compression: enabled: False min_size_kbytes: 100 storage_driver: name: db config: {} cycle_timer_seconds: '1' cycle_timers: image_watcher: 3600 policy_eval: 3600 vulnerability_scan: 14400 analyzer_queue: 1 notifications: 30 service_watcher: 15 policy_bundle_sync: 300 repo_watcher: 60 simplequeue: enabled: True require_auth: True endpoint_hostname: 'anchore-engine' listen: '0.0.0.0' port: 8083
external_port: 8083
external_tls: False
analyzer: enabled: True require_auth: True cycle_timer_seconds: 1 max_threads: 1 analyzer_driver: 'nodocker' endpoint_hostname: 'anchore-engine' listen: '0.0.0.0' port: 8084
external_port: 8084
external_tls: False
policy_engine: enabled: True require_auth: True endpoint_hostname: 'anchore-engine' listen: '0.0.0.0' port: 8087
external_port: 8087
external_tls: False
cycle_timer_seconds: 1
cycle_timers:
feed_sync: 21600 # 6 hours between feed syncs
feed_sync_checker: 3600 # 1 hour between checks to see if there needs to be a task queued
hi @tripolitrax
Quick thing first - there is a separate project for 'anchore-engine' where it would be better to file this issue (want to make sure everyone who can help can join the discussion!)
https://github.com/anchore/anchore-engine
If you wouldn't mind, could we move the discussion over to that project? If you could respond over there, the info we'd need to make progress is to figure out where the missing item is coming from that is causing that error output. Suggestions would be to try setting the 'log_level' to 'DEBUG' to get some more output, and also if you could share your config (wrapped in triple back-ticks will help, it looks like formatting got a bit messed up above) that would help too!
@tripolitrax - in fact, the issue might very well be related to the config.yaml formatting - indentation is necessary in our config.yaml, and if your config.yaml has lost the indentation from the original, it will result in an invalid configuration for sure - the credential section, for example, should look like this:
credentials:
default_user: 'admin'
users:
admin:
password: 'admin'
email: '[email protected]'
external_service_auths:
# anchoreio:
# anchorecli:
# auth: 'myanchoreiouser:myanchoreiopass'
#auto_policy_sync: True
@nurmi - thank you so much for your prompt reply. The issue was indeed a spacing issue in the yaml. It was a copy past from https://github.com/anchore/anchore-engine/blob/master/scripts/docker-compose/config.yaml .. However when replacing that section with yours, it started up perfectly.
Thank you once again.