relaton / relaton-oasis

MIT License
0 stars 0 forks source link

lib/relaton_oasis/data_part_parser.rb:27:in `title': undefined method `[]' for nil:NilClass (NoMethodError) #8

Closed CAMOBAP closed 8 months ago

CAMOBAP commented 8 months ago

https://github.com/relaton/relaton-data-oasis/actions/runs/8097436210/job/22128498477#step:7:10

encoding error : input conversion failed due to input error, bytes 0x81 0x3C 0x73 0x70
encoding error : input conversion failed due to input error, bytes 0x81 0x3C 0x73 0x70
File data/GENERICODE-V1.0.yaml already exists. Document: genericode-v1.0
/home/runner/work/relaton-data-oasis/relaton-data-oasis/vendor/bundle/ruby/3.1.0/bundler/gems/relaton-oasis-3bdf8805fcdc/lib/relaton_oasis/data_part_parser.rb:27:in `title': undefined method `[]' for nil:NilClass (NoMethodError)

                 text.match(/(?<content>.+)\\s(?:Edited|\\d{2}\\s\\w+\\d{4})/)[:content]
                                                                         ^^^^^^^^^^
    from /home/runner/work/relaton-data-oasis/relaton-data-oasis/vendor/bundle/ruby/3.1.0/bundler/gems/relaton-oasis-3bdf8805fcdc/lib/relaton_oasis/data_parser_utils.rb:133:in `parse_errata'
    from /home/runner/work/relaton-data-oasis/relaton-data-oasis/vendor/bundle/ruby/3.1.0/bundler/gems/relaton-oasis-3bdf8805fcdc/lib/relaton_oasis/data_part_parser.rb:72:in `parse_docnumber'
    from /home/runner/work/relaton-data-oasis/relaton-data-oasis/vendor/bundle/ruby/3.1.0/bundler/gems/relaton-oasis-3bdf8805fcdc/lib/relaton_oasis/data_parser_utils.rb:146:in `parse_docid'
    from /home/runner/work/relaton-data-oasis/relaton-data-oasis/vendor/bundle/ruby/3.1.0/bundler/gems/relaton-oasis-3bdf8805fcdc/lib/relaton_oasis/data_parser.rb:123:in `block in parse_relation'
    from /home/runner/work/relaton-data-oasis/relaton-data-oasis/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.15.5-x86_64-linux/lib/nokogiri/xml/node_set.rb:235:in `block in each'
    from /home/runner/work/relaton-data-oasis/relaton-data-oasis/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.15.5-x86_64-linux/lib/nokogiri/xml/node_set.rb:234:in `upto'
Started at: 2024-02-29 14:16:24 +0000
    from /home/runner/work/relaton-data-oasis/relaton-data-oasis/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.15.5-x86_64-linux/lib/nokogiri/xml/node_set.rb:234:in `each'
    from /home/runner/work/relaton-data-oasis/relaton-data-oasis/vendor/bundle/ruby/3.1.0/bundler/gems/relaton-oasis-3bdf8805fcdc/lib/relaton_oasis/data_parser.rb:122:in `map'
    from /home/runner/work/relaton-data-oasis/relaton-data-oasis/vendor/bundle/ruby/3.1.0/bundler/gems/relaton-oasis-3bdf8805fcdc/lib/relaton_oasis/data_parser.rb:122:in `parse_relation'
    from /home/runner/work/relaton-data-oasis/relaton-data-oasis/vendor/bundle/ruby/3.1.0/bundler/gems/relaton-oasis-3bdf8805fcdc/lib/relaton_oasis/data_parser.rb:44:in `parse'
    from /home/runner/work/relaton-data-oasis/relaton-data-oasis/vendor/bundle/ruby/3.1.0/bundler/gems/relaton-oasis-3bdf8805fcdc/lib/relaton_oasis/data_fetcher.rb:42:in `block in fetch'
    from /home/runner/work/relaton-data-oasis/relaton-data-oasis/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.15.5-x86_64-linux/lib/nokogiri/xml/node_set.rb:235:in `block in each'
    from /home/runner/work/relaton-data-oasis/relaton-data-oasis/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.15.5-x86_64-linux/lib/nokogiri/xml/node_set.rb:234:in `upto'
    from /home/runner/work/relaton-data-oasis/relaton-data-oasis/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.15.5-x86_64-linux/lib/nokogiri/xml/node_set.rb:234:in `each'
    from /home/runner/work/relaton-data-oasis/relaton-data-oasis/vendor/bundle/ruby/3.1.0/bundler/gems/relaton-oasis-3bdf8805fcdc/lib/relaton_oasis/data_fetcher.rb:41:in `map'
    from /home/runner/work/relaton-data-oasis/relaton-data-oasis/vendor/bundle/ruby/3.1.0/bundler/gems/relaton-oasis-3bdf8805fcdc/lib/relaton_oasis/data_fetcher.rb:41:in `fetch'
    from /home/runner/work/relaton-data-oasis/relaton-data-oasis/vendor/bundle/ruby/3.1.0/bundler/gems/relaton-oasis-3bdf8805fcdc/lib/relaton_oasis/data_fetcher.rb:28:in `fetch'
    from crawler.rb:9:in `<main>'
andrew2net commented 8 months ago

@ronaldtse for some reason the relaton-data-oasis GHA doesn't email me when an error is occurred.

I'm thinking about creating a logging channel that can sen email notifications. Currently we get error notification when GHA fails on some document. It's not good, because when GHA fails it stops parsing rest dataset. We need to catch any parser error, log error through email channel, and continue GHA should still run and continue parsing rest data.

andrew2net commented 8 months ago

Fixed