Errors and traceback when using gofed check-deps with snapd #131

Closed
Conan-Kudo opened this Issue Mar 20, 2017 · 3 comments

Comments

Projects
None yet
2 participants

When attempting to use gofed check-deps with snapd source code, I get errors and then ultimately a traceback.


[makerpm snapd]$ gofed check-deps --vendorfile=./vendor/vendor.json
ERROR:root:Unable to get mapping for gopkg.in/yaml.v2
ERROR:root:Unable to get mapping for github.com/ojii/gettext.go/pluralforms
ERROR:root:Unable to get mapping for gopkg.in/retry.v1
ERROR:root:Unable to get mapping for github.com/testing-cabal/subunit-go
ERROR:root:Unable to get mapping for github.com/ojii/gettext.go
github.com/gorilla/context is outdated in distribution
Unable to find ipprefix2rpm mapping 'gopkg.in/yaml.v2' ipprefix
Unable to find ipprefix2rpm mapping 'github.com/ojii/gettext.go' ipprefix
gopkg.in/check.v1 is newer in distribution
Traceback (most recent call last):
  File "/usr/share/gofed/cmd/check-deps/check-deps.py", line 45, in <module>
    SnapshotChecker(options.dryrun).check(snapshot, target[0], target[1])
  File "/usr/lib/python2.7/site-packages/gofedinfra/system/models/snapshots/checker.py", line 181, in check
    upstream_commit = self._getCommitDate(providers[ipprefix], upstream[ipprefix])
  File "/usr/lib/python2.7/site-packages/gofedinfra/system/models/snapshots/checker.py", line 90, in _getCommitDate
    "commit": commit
  File "/usr/lib/python2.7/site-packages/gofedinfra/system/core/acts/basicact.py", line 12, in call
    if not self.obj.setData(data):
  File "/usr/lib/python2.7/site-packages/gofedinfra/system/acts/scanupstreamrepository/act.py", line 103, in setData
    if not self._validateInput(data):
  File "/usr/lib/python2.7/site-packages/gofedinfra/system/core/meta/metaact.py", line 57, in _validateInput
    data
  File "/usr/lib/python2.7/site-packages/gofedinfra/system/helpers/schema_validator.py", line 24, in validateFromFile
    jsonschema.validate(json_data, schema)
  File "/usr/lib/python2.7/site-packages/jsonschema/validators.py", line 478, in validate
    cls(schema, *args, **kwargs).validate(instance)
  File "/usr/lib/python2.7/site-packages/jsonschema/validators.py", line 123, in validate
    raise error
jsonschema.exceptions.ValidationError: {'username': '', 'project': u'macaroon', 'version': u'v1', 'provider': 'gopkg'} is not valid under any of the given schemas

Failed validating u'anyOf' in schema[u'properties'][u'repository']:
    {u'anyOf': [{u'$ref': u'#/definitions/github'},
                {u'$ref': u'#/definitions/bitbucket'}]}

On instance[u'repository']:
    {'project': u'macaroon',
     'provider': 'gopkg',
     'username': '',
     'version': u'v1'}


I'm using git master of snapcore/snapd.

Collaborator

ingvagabund commented Mar 20, 2017

Quick fix:

  1. Open as root /usr/lib/python2.7/site-packages/gofedlib/providers/data/ip2pp_mapping.json
  2. Add {"ipprefix": "gopkg.in/macaroon.v1","provider_prefix":"github.com/go-macaroon/macaroon"} at the end of the json so it looks like:
...
{"ipprefix": "speter.net/go/exp/math/dec/inf","provider_prefix":"github.com/hankya/go-decimal-inf.exp"},
{"ipprefix": "gopkg.in/inf.v0","provider_prefix":"github.com/go-inf/inf"},
{"ipprefix": "gopkg.in/macaroon.v1","provider_prefix":"github.com/go-macaroon/macaroon"}
]

Now it should work.

Collaborator

ingvagabund commented Mar 20, 2017

Collaborator

ingvagabund commented Mar 20, 2017

I will rebuild gofed rpms with another release. Unless it is needed earlier. In that case, open a new bugzilla issue for that. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment