relaton / relaton-nist

NistBib: retrieve NIST Standards for bibliographic use using the BibliographicItem model
https://www.metanorma.com
MIT License
2 stars 2 forks source link

(URGENT) Crash when fetching "NIST CSWP 4" #103

Closed ronaldtse closed 1 year ago

ronaldtse commented 1 year ago
$ bundle exec relaton fetch "NIST CSWP 4"
[relaton-nist] ("NIST CSWP 4") fetching...
bundler: failed to load command: relaton (/.asdf/installs/ruby/3.1.2/bin/relaton)
/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/relaton-nist-1.14.7/lib/relaton_nist/hit_collection.rb:168:in `block in sort_hits!': undefined method `zero?' for nil:NilClass (NoMethodError)

        next code unless code.zero?
                             ^^^^^^
    from /.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/relaton-nist-1.14.7/lib/relaton_nist/hit_collection.rb:166:in `sort!'
    from /.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/relaton-nist-1.14.7/lib/relaton_nist/hit_collection.rb:166:in `sort_hits!'
    from /.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/relaton-nist-1.14.7/lib/relaton_nist/hit_collection.rb:48:in `search'
    from /.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/relaton-nist-1.14.7/lib/relaton_nist/hit_collection.rb:37:in `search'
    from /.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/relaton-nist-1.14.7/lib/relaton_nist/nist_bibliography.rb:23:in `search'
    from /.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/relaton-nist-1.14.7/lib/relaton_nist/nist_bibliography.rb:172:in `nistbib_search_filter'
    from /.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/relaton-nist-1.14.7/lib/relaton_nist/nist_bibliography.rb:85:in `nistbib_get'
    from /.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/relaton-nist-1.14.7/lib/relaton_nist/nist_bibliography.rb:67:in `get'
    from /.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/relaton-nist-1.14.7/lib/relaton_nist/processor.rb:18:in `get'
    from /.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/relaton-1.15.5/lib/relaton/db.rb:191:in `fetch_doc'
    from /.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/relaton-1.15.5/lib/relaton/db.rb:473:in `net_retry'
    from /.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/relaton-1.15.5/lib/relaton/db.rb:442:in `new_bib_entry'
    from /.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/relaton-1.15.5/lib/relaton/db.rb:406:in `check_bibliocache'
    from /.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/relaton-1.15.5/lib/relaton/db.rb:68:in `fetch'
    from /.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/relaton-cli-1.15.5/lib/relaton/cli/command.rb:185:in `fetch_document'
    from /.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/relaton-cli-1.15.5/lib/relaton/cli/command.rb:36:in `fetch'
    from /.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/thor-1.2.2/lib/thor/command.rb:27:in `run'
    from /.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/thor-hollaback-0.2.1/lib/thor/hollaback.rb:71:in `block in run'
    from /.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/hollaback-0.1.1/lib/hollaback/sequence.rb:34:in `call'
    from /.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/thor-hollaback-0.2.1/lib/thor/hollaback.rb:71:in `run'
    from /.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/thor-1.2.2/lib/thor/invocation.rb:127:in `invoke_command'
    from /.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/thor-1.2.2/lib/thor.rb:392:in `dispatch'
    from /.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/thor-1.2.2/lib/thor/base.rb:485:in `start'
    from /.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/relaton-cli-1.15.5/lib/relaton/cli.rb:55:in `start'
    from /.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/relaton-cli-1.15.5/exe/relaton:20:in `<top (required)>'
    from /.asdf/installs/ruby/3.1.2/bin/relaton:25:in `load'
    from /.asdf/installs/ruby/3.1.2/bin/relaton:25:in `<top (required)>'
    from /.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.4.14/lib/bundler/cli/exec.rb:58:in `load'
    from /.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.4.14/lib/bundler/cli/exec.rb:58:in `kernel_load'
    from /.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.4.14/lib/bundler/cli/exec.rb:23:in `run'
    from /.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.4.14/lib/bundler/cli.rb:492:in `exec'
    from /.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.4.14/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
    from /.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.4.14/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
    from /.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.4.14/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
    from /.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.4.14/lib/bundler/cli.rb:34:in `dispatch'
    from /.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.4.14/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
    from /.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.4.14/lib/bundler/cli.rb:28:in `start'
    from /.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.4.14/exe/bundle:37:in `block in <top (required)>'
    from /.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.4.14/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
    from /.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.4.14/exe/bundle:29:in `<top (required)>'
    from /.asdf/installs/ruby/3.1.2/bin/bundle:25:in `load'
    from /.asdf/installs/ruby/3.1.2/bin/bundle:25:in `<main>'
andrew2net commented 1 year ago

Fixed in v 1.14.9

$ relaton fetch "NIST CSWP 4"
[relaton-nist] ("NIST CSWP 4") fetching...
[relaton-nist] ("NIST CSWP 4") found NIST CSWP 4
<bibdata type="standard" schema-version="v1.2.3">
  <fetched>2023-08-19</fetched>
  ...