asciidoctor / asciidoctor-bibtex

Add bibtex citation support for asciidoc documents
Other
69 stars 27 forks source link

comparison of Array with Array failed #20

Closed CharlesTBetz closed 5 years ago

CharlesTBetz commented 7 years ago

I have been encountering a consistent yet difficult to isolate error of

Failed to load AsciiDoc document - comparison of Array with Array failed Use --trace for backtrace

I cannot create a minimum working example; all such examples work fine. But in my book project with 250+ citations, the error has halted my production. It can be reproduced on both MacOS and Ubuntu. The error seems to be dependent on the location or existence of particular citations in the .adoc file, and/or their ordering in the .bib file, which makes no sense. Sometimes, I can prevent the error by including a dummy cite "cite:[x]" early in the build, but this does not work consistently. Can anyone provide at least some troubleshooting steps?

Thanks

Trace is:

/Users/Char/.chefdk/gem/ruby/2.1.0/gems/asciidoctor-bibtex-0.2.0/lib/asciidoctor-bibtex/citations.rb:28:in sort_by': asciidoctor: FAILED: /Users/Char/repos/aitm/aitm-instructor.adoc: Failed to load AsciiDoc document - comparison of Array with Array failed (ArgumentError) from /Users/Char/.chefdk/gem/ruby/2.1.0/gems/asciidoctor-bibtex-0.2.0/lib/asciidoctor-bibtex/citations.rb:28:insorted_cites' from /Users/Char/.chefdk/gem/ruby/2.1.0/gems/asciidoctor-bibtex-0.2.0/lib/asciidoctor-bibtex/processor.rb:292:in sorted_cites' from /Users/Char/.chefdk/gem/ruby/2.1.0/gems/asciidoctor-bibtex-0.2.0/lib/asciidoctor-bibtex/processor.rb:265:inmake_citation' from /Users/Char/.chefdk/gem/ruby/2.1.0/gems/asciidoctor-bibtex-0.2.0/lib/asciidoctor-bibtex/processor.rb:169:in block in complete_citation' from /Users/Char/.chefdk/gem/ruby/2.1.0/gems/asciidoctor-bibtex-0.2.0/lib/asciidoctor-bibtex/processor.rb:159:ineach' from /Users/Char/.chefdk/gem/ruby/2.1.0/gems/asciidoctor-bibtex-0.2.0/lib/asciidoctor-bibtex/processor.rb:159:in each_with_index' from /Users/Char/.chefdk/gem/ruby/2.1.0/gems/asciidoctor-bibtex-0.2.0/lib/asciidoctor-bibtex/processor.rb:159:incomplete_citation' from /Users/Char/.chefdk/gem/ruby/2.1.0/gems/asciidoctor-bibtex-0.2.0/lib/asciidoctor-bibtex/bibextension.rb:87:in block (3 levels) in process' from /Users/Char/.chefdk/gem/ruby/2.1.0/gems/asciidoctor-bibtex-0.2.0/lib/asciidoctor-bibtex/bibextension.rb:86:ineach' from /Users/Char/.chefdk/gem/ruby/2.1.0/gems/asciidoctor-bibtex-0.2.0/lib/asciidoctor-bibtex/bibextension.rb:86:in block (2 levels) in process' from /Users/Char/.chefdk/gem/ruby/2.1.0/gems/asciidoctor-bibtex-0.2.0/lib/asciidoctor-bibtex/bibextension.rb:85:ineach' from /Users/Char/.chefdk/gem/ruby/2.1.0/gems/asciidoctor-bibtex-0.2.0/lib/asciidoctor-bibtex/bibextension.rb:85:in block in process' from /Users/Char/.chefdk/gem/ruby/2.1.0/gems/asciidoctor-bibtex-0.2.0/lib/asciidoctor-bibtex/bibextension.rb:77:ineach' from /Users/Char/.chefdk/gem/ruby/2.1.0/gems/asciidoctor-bibtex-0.2.0/lib/asciidoctor-bibtex/bibextension.rb:77:in process' from /Users/Char/.chefdk/gem/ruby/2.1.0/gems/asciidoctor-1.5.5/lib/asciidoctor/document.rb:479:in[]' from /Users/Char/.chefdk/gem/ruby/2.1.0/gems/asciidoctor-1.5.5/lib/asciidoctor/document.rb:479:in block in parse' from /Users/Char/.chefdk/gem/ruby/2.1.0/gems/asciidoctor-1.5.5/lib/asciidoctor/document.rb:478:ineach' from /Users/Char/.chefdk/gem/ruby/2.1.0/gems/asciidoctor-1.5.5/lib/asciidoctor/document.rb:478:in parse' from /Users/Char/.chefdk/gem/ruby/2.1.0/gems/asciidoctor-1.5.5/lib/asciidoctor.rb:1347:inload' from /Users/Char/.chefdk/gem/ruby/2.1.0/gems/asciidoctor-1.5.5/lib/asciidoctor.rb:1465:in convert' from /Users/Char/.chefdk/gem/ruby/2.1.0/gems/asciidoctor-1.5.5/lib/asciidoctor/cli/invoker.rb:95:inblock in invoke!' from /Users/Char/.chefdk/gem/ruby/2.1.0/gems/asciidoctor-1.5.5/lib/asciidoctor/cli/invoker.rb:87:in each' from /Users/Char/.chefdk/gem/ruby/2.1.0/gems/asciidoctor-1.5.5/lib/asciidoctor/cli/invoker.rb:87:ininvoke!' from /Users/Char/.chefdk/gem/ruby/2.1.0/gems/asciidoctor-1.5.5/bin/asciidoctor:14:in <top (required)>' from /Users/Char/.chefdk/gem/ruby/2.1.0/bin/asciidoctor:22:inload' from /Users/Char/.chefdk/gem/ruby/2.1.0/bin/asciidoctor:22:in `

'

ProgramFan commented 7 years ago

Thanks for reporting. I will look into it this weekend.

dagget commented 7 years ago

I got the same error and managed to track it down. In my case it happens when I have the following minimal example:

@misc{REO, author = {CWI}, year = {2008} }

@misc{PRDKTOOLKIT, author = {CWI}, year = {2017} }

I get the error when I remove the 'year' entry from the first (REO) entry. Removing the second date doesn't make a difference it seems.

ProgramFan commented 5 years ago

Not reproducible in master.