zalando-stups / pierone-cli

DEPRECATED: Convenient command line client for STUPS' Pier One Docker registry
http://docs.stups.io/en/latest/components/pierone.html#command-line-client
Other
10 stars 13 forks source link

pierone fails with backtrace when the CVE status is COULDNT_FIGURE_OUT #34

Closed vetinari closed 8 years ago

vetinari commented 8 years ago
Traceback (most recent call last):
  File "/usr/local/bin/pierone", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.4/dist-packages/pierone/cli.py", line 485, in main
    cli()
  File "/usr/local/lib/python3.4/dist-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.4/dist-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.4/dist-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.4/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/click/decorators.py", line 27, in new_func
    return f(get_current_context().obj, *args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/pierone/cli.py", line 313, in cves
    installed_software = get_clair_features(config.get('clair_url'), artifact_tag.get('clair_id'), token)
  File "/usr/local/lib/python3.4/dist-packages/pierone/cli.py", line 235, in get_clair_features
    return r.json()['Layer']['Features']
KeyError: 'Features'
hjacobs commented 8 years ago

I guess @rafaelcaricio can take a look..

rafaelcaricio commented 8 years ago

Hi @vetinari, Is there any specific reason for you to conclude that it is only when the CVE is COULDNT_FIGURE_OUT? I am asking because the stack trance leads me to think that the problem is that Clair API replied with a different payload than expected (cc @sarnowski) and not because of the status of the CVE.

rafaelcaricio commented 8 years ago

@sarnowski Is there any situation that Clair API returns a different payload. Is that the case when clair still did not ran for a specific sha256 id?

sarnowski commented 8 years ago

There are 3 cases:

So its correct that this case needs to be handled specially for clair:CloudntFigureOut.