Skip to content


Subversion checkout URL

You can clone with
Download ZIP


/module/warnings etc. pick up info from wrong files #143

miyagawa opened this Issue · 5 comments

4 participants


/module/warnings returns information from regen/, which seems like a bug. For cpan clients like cpanm to use metacpan, it is critical that It doesn't include 'module' and hence 'version' for a given module.

Known namespaces that have issues like this are:

  • warnings
  • version
  • FCGI
  • bignum (not found - maybe a separate issue?)

In the case of FCGI, the distro doesn't really contain, so the file is correct, but it does't include 'module' key.


This is the query you want:

curl -d '{
  "query": {
    "filtered": {
      "query": { "match_all": {} },
      "filter": {
        "and": [
          "nested": {
            "path": "module",
            "query": {
                "bool": {
                    "must": [
                        { "term": { "": "version" } },
                        { "term": { "module.indexed": true } },
                        { "term": { "module.authorized": true } }
      }, { "term":{"file.status": "latest"}} ]
} }'

But it throws every now and then an ElasticSearch totalShardFailure error. I guess we'd have to upgrade to a newer version and hope that it's fixed there.

the /module/ endpoint uses a different query because it also catches things like scripts which don't have a package declaration. FCGI is somewhat broken/special in that it is .PL with a package declaration which isn't supported by metacpan yet.


Is this related to CPAN-API/metacpan-web#176 ?


The query as proposed above doesn't seem to be always adequate, as in the metadata, there are records that falsely indicate authorized: and indexed: as both being true when they shouldn't be.

For example, replace "version" in that query with "warnings", and you'll get 2 responses, a) perl and b ) Apache-Test-1.37


Seems like CPAN-API/cpan-api#98 is a blocker here.


everything but FCGI is resolved, I'm gonna open a new ticket for that

@monken monken closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.