asciidoctor / asciidoctor-bibtex

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

comparison of Array with Array failed (again) #47

Closed CharlesTBetz closed 5 years ago

CharlesTBetz commented 5 years ago

So, have run into this error again:

asciidoctor: FAILED: C:/Users/char/repos/DPBoK/_OG-full-pdf.adoc: Failed to load AsciiDoc document - comparison of Array with Array failed Use --trace for backtrace

Here is the stack trace:

C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/asciidoctor-bibtex-0.3.1/lib/asciidoctor-bibtex/citations.rb:28:in `sort_by': asciidoctor: FAILED: C:/Users/char/repos/DPBoK/_OG-full-pdf.adoc: Failed to load AsciiDoc document - comparison of Array with Array failed (ArgumentError)
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/asciidoctor-bibtex-0.3.1/lib/asciidoctor-bibtex/citations.rb:28:in `sorted_cites'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/asciidoctor-bibtex-0.3.1/lib/asciidoctor-bibtex/processor.rb:189:in `sorted_cites'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/asciidoctor-bibtex-0.3.1/lib/asciidoctor-bibtex/processor.rb:162:in `make_citation'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/asciidoctor-bibtex-0.3.1/lib/asciidoctor-bibtex/processor.rb:66:in `block in complete_citation'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/asciidoctor-bibtex-0.3.1/lib/asciidoctor-bibtex/processor.rb:56:in `each'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/asciidoctor-bibtex-0.3.1/lib/asciidoctor-bibtex/processor.rb:56:in `each_with_index'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/asciidoctor-bibtex-0.3.1/lib/asciidoctor-bibtex/processor.rb:56:in `complete_citation'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/asciidoctor-bibtex-0.3.1/lib/asciidoctor-bibtex/bibextension.rb:119:in `block (3 levels) in process'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/asciidoctor-bibtex-0.3.1/lib/asciidoctor-bibtex/bibextension.rb:118:in `each'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/asciidoctor-bibtex-0.3.1/lib/asciidoctor-bibtex/bibextension.rb:118:in `block (2 levels) in process'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/asciidoctor-bibtex-0.3.1/lib/asciidoctor-bibtex/bibextension.rb:117:in `each'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/asciidoctor-bibtex-0.3.1/lib/asciidoctor-bibtex/bibextension.rb:117:in `block in process'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/asciidoctor-bibtex-0.3.1/lib/asciidoctor-bibtex/bibextension.rb:109:in `each'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/asciidoctor-bibtex-0.3.1/lib/asciidoctor-bibtex/bibextension.rb:109:in `process'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/asciidoctor-1.5.8/lib/asciidoctor/document.rb:577:in `[]'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/asciidoctor-1.5.8/lib/asciidoctor/document.rb:577:in `block in parse'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/asciidoctor-1.5.8/lib/asciidoctor/document.rb:576:in `each'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/asciidoctor-1.5.8/lib/asciidoctor/document.rb:576:in `parse'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/asciidoctor-1.5.8/lib/asciidoctor.rb:1367:in `load'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/asciidoctor-1.5.8/lib/asciidoctor.rb:1479:in `convert'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/asciidoctor-1.5.8/lib/asciidoctor.rb:1595:in `block in convert_file'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/asciidoctor-1.5.8/lib/asciidoctor.rb:1595:in `open'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/asciidoctor-1.5.8/lib/asciidoctor.rb:1595:in `convert_file'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/asciidoctor-1.5.8/lib/asciidoctor/cli/invoker.rb:129:in `block in invoke!'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/asciidoctor-1.5.8/lib/asciidoctor/cli/invoker.rb:112:in `each'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/asciidoctor-1.5.8/lib/asciidoctor/cli/invoker.rb:112:in `invoke!'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/asciidoctor-pdf-1.5.0.alpha.16/bin/asciidoctor-pdf:31:in `<top (required)>'
        from C:/Ruby24-x64/bin/asciidoctor-pdf:23:in `load'
        from C:/Ruby24-x64/bin/asciidoctor-pdf:23:in `<main>'

Error was reproducible across at least four machines, PCs and Macs. One of the PCs represented a completely fresh build of the the toolchain.

This is across a very large and complex document and is an extremely difficult and troubling error to isolate. We narrowed the error to particular citations and in particular the authors' names, but the error itself shifts over time. Last week, we had to replace 4 authors' names with "xx" and then the error would go away, e.g.:

@book{Landis2011,
address = {Walnut Creek, California},
author = {Landis, Sean},
publisher = {Artima, Inc},
title = {{Agile Hiring}},
year = {2011}
}

would not work but

@book{Landis2011,
address = {Walnut Creek, California},
author = {xx},
publisher = {Artima, Inc},
title = {{Agile Hiring by Sean Landis}},
year = {2011}
}

would.

This week, we are able to restore 2 of those authors' names (but not 3) without error. Very puzzling.

Because of the elusive nature of this error, I apologize but cannot put together a minimum viable demonstration, nor can we share here the repository.

Aware of previous issue. I ran into this a couple years ago. It was similarly elusive back then, with the only fix being modifying one particular, arbitrary citation.

Charlie

CharlesTBetz commented 5 years ago

If someone provides some basic pointers on using the Ruby debugger, we might be able to work this more on our end.

mojavelinux commented 5 years ago

@CharlesTBetz Thanks for taking the time to report this issue.

Can you explain how to use asciidoctor-bibtex? Where do I need to put the bibtex files that you cited and what AsciiDoc do I need so they get used? It's not clear to me from the README how to actually use this extension. (I understand how to load an extension in general, so I'm not asking about that part).

CharlesTBetz commented 5 years ago

Sure! The inline syntax is cite:[refkey] with refkey being the Bibtex ID (e.g. Landis2011).

Install via gem install as you probably know, and syntax for using is simply

asciidoctor-pdf --trace -v -r asciidoctor-bibtex -D outputdir -o filename.pdf spineFile.adoc

References show up wherever you put bibliography::[].

Spine file commands:

:bibtex-file: somefile.bib
:bibtex-style: ieee
//:bibtex-style: harvard1
:bibtex-order: alphabetical
mojavelinux commented 5 years ago

Perfect! Just what I needed to know. I'll give that a try. That should give me enough to figure out what the issue is, even if I don't get the error (I can just imagine what might go wrong).

mojavelinux commented 5 years ago

As for the Ruby debugger, I don't use one myself. I guess you could say I run it in my head. But I know I'm weird like that.

The best Ruby debugger to my knowledge is RubyMine. I have used it once before and I remember it being rather easy to set up.

CharlesTBetz commented 5 years ago

well, I'm open to going down that road if it makes sense

mojavelinux commented 5 years ago

I'd say go for it.

ProgramFan commented 5 years ago

Have you tried this on asciidoctor-bibtex 0.4.1? It seems you are using asciidoctor-bibtex 0.3.1.

ProgramFan commented 5 years ago

I would suggest upgrading to ruby 2.6 and try the latest master. A similar issue happened before (#20) but disappears in master with ruby 2.6.0 on macOS.

ProgramFan commented 5 years ago

Closed as being not reproducible. Re-open if needed.

CharlesTBetz commented 5 years ago

We are seeing this reproduce with the following toolchain:

asciidoctor-2.0.10 asciidoctor-bibtex-0.5.1 asciidoctor-pdf-1.5.0.beta.2 ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux]

On Sun, Aug 4, 2019 at 6:51 AM Zhang YANG notifications@github.com wrote:

Closed #47 https://github.com/asciidoctor/asciidoctor-bibtex/issues/47.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/asciidoctor/asciidoctor-bibtex/issues/47?email_source=notifications&email_token=AAMUWC4SJCV5XENZEJKFHQTQC27DJA5CNFSM4HWHXWB2YY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOS3TSNVA#event-2531731156, or mute the thread https://github.com/notifications/unsubscribe-auth/AAMUWC6LWJUR4P3M2M6QQRTQC27DJANCNFSM4HWHXWBQ .

mojavelinux commented 5 years ago

We should expect this to continue failing until CI is set up. I just activated it on the repository, but there is no CI configuration file, so no tests are going to run until that's in place.

mojavelinux commented 5 years ago

Although they don't run in CI, the tests do seem to work locally using rake test. Can you propose a failing test?

CharlesTBetz commented 5 years ago

Referring to Andrew.

On Sat, Aug 31, 2019 at 2:31 PM Dan Allen notifications@github.com wrote:

Although they don't run in CI, the tests do seem to work locally using rake test. Can you propose a failing test?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/asciidoctor/asciidoctor-bibtex/issues/47?email_source=notifications&email_token=AAMUWCZPGO4NQ5V4MTMIHFLQHLBK3A5CNFSM4HWHXWB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5TTZOQ#issuecomment-526859450, or mute the thread https://github.com/notifications/unsubscribe-auth/AAMUWCZ25X4SJTABJJQT2ILQHLBK3ANCNFSM4HWHXWBQ .

CharlesTBetz commented 5 years ago

Also Greg Hunt.

On Sat, Aug 31, 2019 at 2:59 PM Charles Betz char@erp4it.com wrote:

Referring to Andrew.

On Sat, Aug 31, 2019 at 2:31 PM Dan Allen notifications@github.com wrote:

Although they don't run in CI, the tests do seem to work locally using rake test. Can you propose a failing test?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/asciidoctor/asciidoctor-bibtex/issues/47?email_source=notifications&email_token=AAMUWCZPGO4NQ5V4MTMIHFLQHLBK3A5CNFSM4HWHXWB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5TTZOQ#issuecomment-526859450, or mute the thread https://github.com/notifications/unsubscribe-auth/AAMUWCZ25X4SJTABJJQT2ILQHLBK3ANCNFSM4HWHXWBQ .

ajosey commented 5 years ago

I also checked with asciidoctor-bibtex-0.5.2 and the same problem occurs still.

I've now running the builds in a docker image, which may help to isolate/reproduce. We need to reduce what we are building to the minimum to show the error.

Are there any ways to switch on more trace/debug within asciidoctor-bibtex?

This is what we get /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-bibtex-0.5.2/lib/asciidoctor-bibtex/Processor.rb:91:in sort_by': asciidoctor: FAILED: /documents/_OG-full-pdf.adoc: Failed to load AsciiDoc document - comparison of Array with Array failed (ArgumentError) from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-bibtex-0.5.2/lib/asciidoctor-bibtex/Processor.rb:91:infinalize_macro_processing' from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-bibtex-0.5.2/lib/asciidoctor-bibtex/extensions.rb:107:in process' from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.10/lib/asciidoctor/document.rb:556:in[]' from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.10/lib/asciidoctor/document.rb:556:in block in parse' from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.10/lib/asciidoctor/document.rb:555:ineach' from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.10/lib/asciidoctor/document.rb:555:in parse' from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.10/lib/asciidoctor/load.rb:83:inload' from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.10/lib/asciidoctor/convert.rb:78:in convert' from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.10/lib/asciidoctor/convert.rb:183:inblock in convert_file' from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.10/lib/asciidoctor/convert.rb:183:in open' from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.10/lib/asciidoctor/convert.rb:183:inconvert_file' from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.10/lib/asciidoctor/cli/invoker.rb:128:in block in invoke!' from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.10/lib/asciidoctor/cli/invoker.rb:111:ineach' from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.10/lib/asciidoctor/cli/invoker.rb:111:in invoke!' from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-pdf-1.5.0.beta.3/bin/asciidoctor-pdf:32:in<top (required)>' from /usr/bin/asciidoctor-pdf:23:in load' from /usr/bin/asciidoctor-pdf:23:in

'

Environment:

uname -a Linux e87033ff6b78 4.9.184-linuxkit #1 SMP Tue Jul 2 22:58:16 UTC 2019 x86_64 Linux

ruby -v ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux-musl]

asciidoctor --version Asciidoctor 2.0.10 [https://asciidoctor.org] Runtime Environment (ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux-musl]) (lc:UTF-8 fs:UTF-8 in:UTF-8 ex:UTF-8)

asciidoctor-pdf --version Asciidoctor PDF 1.5.0.beta.3 using Asciidoctor 2.0.10 [https://asciidoctor.org] Runtime Environment (ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux-musl]) (lc:UTF-8 fs:UTF-8 in:UTF-8 ex:UTF-8)

ProgramFan commented 5 years ago

The error looks strange. Line 91 of Processor.rb does not compare array with arrays, it just sorts an array of string. And no errors are found on ruby 2.6.

ajosey commented 5 years ago

I get the same issue with ruby 2.6

$ /usr/local/bin/ruby --version ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux] $ export PATH=/usr/local/bin/:pwd/gems/bin:$PATH $ mkdir gems $ export GEM_HOME=pwd/gems $ gem install asciidoctor Successfully installed asciidoctor-2.0.10 Parsing documentation for asciidoctor-2.0.10 Installing ri documentation for asciidoctor-2.0.10 Done installing documentation for asciidoctor after 2 seconds 1 gem installed $ gem install asciidoctor-bibtex Successfully installed asciidoctor-bibtex-0.5.2 Parsing documentation for asciidoctor-bibtex-0.5.2 Installing ri documentation for asciidoctor-bibtex-0.5.2 Done installing documentation for asciidoctor-bibtex after 0 seconds 1 gem installed $ gem install asciidoctor-pdf --pre Successfully installed prawn-icon-2.4.0 Successfully installed asciidoctor-pdf-1.5.0.beta.3 Parsing documentation for prawn-icon-2.4.0 Installing ri documentation for prawn-icon-2.4.0 Parsing documentation for asciidoctor-pdf-1.5.0.beta.3 Installing ri documentation for asciidoctor-pdf-1.5.0.beta.3 Done installing documentation for prawn-icon, asciidoctor-pdf after 1 seconds 2 gems installed $ gem install unicode_utils Successfully installed unicode_utils-1.4.0 Parsing documentation for unicode_utils-1.4.0 Installing ri documentation for unicode_utils-1.4.0 Done installing documentation for unicode_utils after 0 seconds 1 gem installed $ asciidoctor --version Asciidoctor 2.0.10 [https://asciidoctor.org] Runtime Environment (ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux]) (lc:UTF-8 fs:UTF-8 in:UTF-8 ex:UTF-8) $ find gems/bin -print gems/bin gems/bin/asciidoctor gems/bin/asciidoctor-pdf $ asciidoctor-pdf --version Asciidoctor PDF 1.5.0.beta.3 using Asciidoctor 2.0.10 [https://asciidoctor.org] Runtime Environment (ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux]) (lc:UTF-8 fs:UTF-8 in:UTF-8 ex:UTF-8)

$ asciidoctor-pdf --trace -v -r asciidoctor-bibtex -D output/pdf -o DPBoK.pdf _OG-full-pdf.adoc

/home/gitlab-runner/builds/PxJheMGA/0/digital-practitioner/DPBoK/gems/gems/asciidoctor-bibtex-0.5.2/lib/asciidoctor-bibtex/Processor.rb:91:in sort_by': asciidoctor: FAILED: /home/gitlab-runner/builds/PxJheMGA/0/digital-practitioner/DPBoK/_OG-full-pdf.adoc: Failed to load AsciiDoc document - comparison of Array with Array failed (ArgumentError) from /home/gitlab-runner/builds/PxJheMGA/0/digital-practitioner/DPBoK/gems/gems/asciidoctor-bibtex-0.5.2/lib/asciidoctor-bibtex/Processor.rb:91:infinalize_macro_processing' from /home/gitlab-runner/builds/PxJheMGA/0/digital-practitioner/DPBoK/gems/gems/asciidoctor-bibtex-0.5.2/lib/asciidoctor-bibtex/extensions.rb:107:in process' from /home/gitlab-runner/builds/PxJheMGA/0/digital-practitioner/DPBoK/gems/gems/asciidoctor-2.0.10/lib/asciidoctor/document.rb:556:in[]' from /home/gitlab-runner/builds/PxJheMGA/0/digital-practitioner/DPBoK/gems/gems/asciidoctor-2.0.10/lib/asciidoctor/document.rb:556:in block in parse' from /home/gitlab-runner/builds/PxJheMGA/0/digital-practitioner/DPBoK/gems/gems/asciidoctor-2.0.10/lib/asciidoctor/document.rb:555:ineach' from /home/gitlab-runner/builds/PxJheMGA/0/digital-practitioner/DPBoK/gems/gems/asciidoctor-2.0.10/lib/asciidoctor/document.rb:555:in parse' from /home/gitlab-runner/builds/PxJheMGA/0/digital-practitioner/DPBoK/gems/gems/asciidoctor-2.0.10/lib/asciidoctor/load.rb:83:inload' from /home/gitlab-runner/builds/PxJheMGA/0/digital-practitioner/DPBoK/gems/gems/asciidoctor-2.0.10/lib/asciidoctor/convert.rb:78:in convert' from /home/gitlab-runner/builds/PxJheMGA/0/digital-practitioner/DPBoK/gems/gems/asciidoctor-2.0.10/lib/asciidoctor/convert.rb:183:inblock in convert_file' from /home/gitlab-runner/builds/PxJheMGA/0/digital-practitioner/DPBoK/gems/gems/asciidoctor-2.0.10/lib/asciidoctor/convert.rb:183:in open' from /home/gitlab-runner/builds/PxJheMGA/0/digital-practitioner/DPBoK/gems/gems/asciidoctor-2.0.10/lib/asciidoctor/convert.rb:183:inconvert_file' from /home/gitlab-runner/builds/PxJheMGA/0/digital-practitioner/DPBoK/gems/gems/asciidoctor-2.0.10/lib/asciidoctor/cli/invoker.rb:128:in block in invoke!' from /home/gitlab-runner/builds/PxJheMGA/0/digital-practitioner/DPBoK/gems/gems/asciidoctor-2.0.10/lib/asciidoctor/cli/invoker.rb:111:ineach' from /home/gitlab-runner/builds/PxJheMGA/0/digital-practitioner/DPBoK/gems/gems/asciidoctor-2.0.10/lib/asciidoctor/cli/invoker.rb:111:in invoke!' from /home/gitlab-runner/builds/PxJheMGA/0/digital-practitioner/DPBoK/gems/gems/asciidoctor-pdf-1.5.0.beta.3/bin/asciidoctor-pdf:32:in<top (required)>' from /usr/local/bin/asciidoctor-pdf:23:in load' from /usr/local/bin/asciidoctor-pdf:23:in

' /home/gitlab-runner/builds/PxJheMGA/0/digital-practitioner/DPBoK/gems/gems/asciidoctor-bibtex-0.5.2/lib/asciidoctor-bibtex/Processor.rb:91:in sort_by': comparison of Array with Array failed (ArgumentError) from /home/gitlab-runner/builds/PxJheMGA/0/digital-practitioner/DPBoK/gems/gems/asciidoctor-bibtex-0.5.2/lib/asciidoctor-bibtex/Processor.rb:91:infinalize_macro_processing' from /home/gitlab-runner/builds/PxJheMGA/0/digital-practitioner/DPBoK/gems/gems/asciidoctor-bibtex-0.5.2/lib/asciidoctor-bibtex/extensions.rb:107:in process' from /home/gitlab-runner/builds/PxJheMGA/0/digital-practitioner/DPBoK/gems/gems/asciidoctor-2.0.10/lib/asciidoctor/document.rb:556:in[]' from /home/gitlab-runner/builds/PxJheMGA/0/digital-practitioner/DPBoK/gems/gems/asciidoctor-2.0.10/lib/asciidoctor/document.rb:556:in block in parse' from /home/gitlab-runner/builds/PxJheMGA/0/digital-practitioner/DPBoK/gems/gems/asciidoctor-2.0.10/lib/asciidoctor/document.rb:555:ineach' from /home/gitlab-runner/builds/PxJheMGA/0/digital-practitioner/DPBoK/gems/gems/asciidoctor-2.0.10/lib/asciidoctor/document.rb:555:in parse' from /home/gitlab-runner/builds/PxJheMGA/0/digital-practitioner/DPBoK/gems/gems/asciidoctor-2.0.10/lib/asciidoctor/load.rb:83:inload' from /home/gitlab-runner/builds/PxJheMGA/0/digital-practitioner/DPBoK/gems/gems/asciidoctor-2.0.10/lib/asciidoctor/convert.rb:78:in convert' from /home/gitlab-runner/builds/PxJheMGA/0/digital-practitioner/DPBoK/gems/gems/asciidoctor-2.0.10/lib/asciidoctor/convert.rb:183:inblock in convert_file' from /home/gitlab-runner/builds/PxJheMGA/0/digital-practitioner/DPBoK/gems/gems/asciidoctor-2.0.10/lib/asciidoctor/convert.rb:183:in open' from /home/gitlab-runner/builds/PxJheMGA/0/digital-practitioner/DPBoK/gems/gems/asciidoctor-2.0.10/lib/asciidoctor/convert.rb:183:inconvert_file' from /home/gitlab-runner/builds/PxJheMGA/0/digital-practitioner/DPBoK/gems/gems/asciidoctor-2.0.10/lib/asciidoctor/cli/invoker.rb:128:in block in invoke!' from /home/gitlab-runner/builds/PxJheMGA/0/digital-practitioner/DPBoK/gems/gems/asciidoctor-2.0.10/lib/asciidoctor/cli/invoker.rb:111:ineach' from /home/gitlab-runner/builds/PxJheMGA/0/digital-practitioner/DPBoK/gems/gems/asciidoctor-2.0.10/lib/asciidoctor/cli/invoker.rb:111:in invoke!' from /home/gitlab-runner/builds/PxJheMGA/0/digital-practitioner/DPBoK/gems/gems/asciidoctor-pdf-1.5.0.beta.3/bin/asciidoctor-pdf:32:in<top (required)>' from /usr/local/bin/asciidoctor-pdf:23:in load' from /usr/local/bin/asciidoctor-pdf:23:in
'

mojavelinux commented 5 years ago

At the risk of stating the obvious, a sample document would go along way here.

Line 91 of Processor.rb does not compare array with arrays, it just sorts an array of string

Clearly, something else is getting into that Array that is throwing off the built-in sort logic.

mojavelinux commented 5 years ago

I've now running the builds in a docker image, which may help to isolate/reproduce. We need to reduce what we are building to the minimum to show the error.

If you can't share the document publicly, consider sharing a private repo with @ProgramFan.

ajosey commented 5 years ago

At the risk of stating the obvious, a sample document would go along way here.

Line 91 of Processor.rb does not compare array with arrays, it just sorts an array of string

Clearly, something else is getting into that Array that is throwing off the built-in sort logic.

Yes have been trying to isolate to a smaller fragment first. The original question I had was whether there was a way to get more diagnostics from asciidoctor-bibtex. I assume not.

mojavelinux commented 5 years ago

I don't see any logging statements in the extension. What I recommend is using a debugger like RubyMine.

CharlesTBetz commented 5 years ago

Charles, You may recall that the set of symptoms I got on Windows was different to the symptoms described under Linux, suggesting that this is some kind of runtime corruption issue.

What is the state of the discussion now?

Greg

Greg Hunt Architecture Director

Fujitsu Australia Limited 118 Talavera Road, Macquarie Park NSW 2113 Australia T +61 2 9113 9356 M +61 412 188 044 Greg.Hunt@au.fujitsu.commailto:Greg.Hunt@au.fujitsu.com au.fujitsu.comhttp://au.fujitsu.com

[LinkedIn]http://www.linkedin.com/company/fujitsu-australia-limited  [Twitter] https://twitter.com/FujitsuAU   [Facebook] https://www.facebook.com/FujitsuAustraliaNewZealand   [Fujitsu Blog] http://blog.au.fujitsu.com/   [Fujitsu Instagram] https://www.instagram.com/fujitsu_oceania/   [cid:image006.jpg@01D56173.A7BA85D0] From: Charles Betz [mailto:char@erp4it.com] Sent: Sunday, 1 September 2019 6:01 AM To: asciidoctor/asciidoctor-bibtex reply@reply.github.com Cc: asciidoctor/asciidoctor-bibtex asciidoctor-bibtex@noreply.github.com; Mention mention@noreply.github.com; Andrew Josey a.josey@opengroup.org; Hunt, Greg Greg.Hunt@au.fujitsu.com Subject: Re: [asciidoctor/asciidoctor-bibtex] comparison of Array with Array failed (again) (#47)

Also Greg Hunt.

On Sat, Aug 31, 2019 at 2:59 PM Charles Betz char@erp4it.com<mailto:char@erp4it.com> wrote: Referring to Andrew.

On Sat, Aug 31, 2019 at 2:31 PM Dan Allen notifications@github.com<mailto:notifications@github.com> wrote:

Although they don't run in CI, the tests do seem to work locally using rake test. Can you propose a failing test?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/asciidoctor/asciidoctor-bibtex/issues/47?email_source=notifications&email_token=AAMUWCZPGO4NQ5V4MTMIHFLQHLBK3A5CNFSM4HWHXWB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5TTZOQ#issuecomment-526859450, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAMUWCZ25X4SJTABJJQT2ILQHLBK3ANCNFSM4HWHXWBQ.

Disclaimer

The information in this e-mail is confidential and may contain content that is subject to copyright and/or is commercial-in-confidence and is intended only for the use of the above named addressee. If you are not the intended recipient, you are hereby notified that dissemination, copying or use of the information is strictly prohibited. If you have received this e-mail in error, please telephone Fujitsu Australia Limited on 02 9776 4555 or by reply e-mail to the sender and delete the document and all copies thereof.

Whereas Fujitsu Australia Limited would not knowingly transmit a virus within an email communication, it is the receiver’s responsibility to scan all communication and any files attached for computer viruses and other defects. Fujitsu Australia Limited does not accept liability for any loss or damage (whether direct, indirect, consequential or economic) however caused, and whether by negligence or otherwise, which may result directly or indirectly from this communication or any files attached.

If you do not wish to receive commercial and/or marketing email messages from Fujitsu Australia Limited, please email unsubscribe@au.fujitsu.com.

ajosey commented 5 years ago

I have managed to isolate the problem to just a .bib file and one other file.

Unwind the files , and run the run.sh script

bibtex-test.zip

I am able to see the error in many environments including ruby 2.5 and 2.6. If you need some scripts to invoke a docker environment in let me know

ajosey commented 5 years ago

Closed as being not reproducible. Re-open if needed.

How can it be re-opened? Is that just the reporter who can do that? @CharlesTBetz

mojavelinux commented 5 years ago

I'm probing this to see what's wrong. It's tough since the error is coming from inside a Ruby routine.

mojavelinux commented 5 years ago

The problem is that the sort_by method is returning an array value, when it should be returning a string. In certain circumstances, if the year is nil (the last value in the array), it cannot be compared.

The problematic entry is this one:

cite:[Morgan2018, Osterwalder2010, Morgan2006, Ward2014]

It's problematic because it ends up returning:

["MORGAN, JAMES M.", "LIKER, JEFFREY K.", nil]

The presence of the nil value breaks sort_by. And if it's not the nil value, it's the variable length array.

This can be fixed by coercing the return value to a string or leaving off the year if it's nil.

mojavelinux commented 5 years ago

I'm preparing a test and PR.

mojavelinux commented 5 years ago

Here's an even more minimal case

cite:[Morgan2018, Morgan2006]

So it's when all the authors are the same and it comes down to comparing the date. The comparison with nil fails. The error message is misleading.

CharlesTBetz commented 5 years ago

Thanks for everyone's work on this.

On Wed, Sep 4, 2019 at 5:17 PM Zhang YANG notifications@github.com wrote:

Closed #47 https://github.com/asciidoctor/asciidoctor-bibtex/issues/47 via b10db23 https://github.com/asciidoctor/asciidoctor-bibtex/commit/b10db2328a5c0ae0ee1cfd2b64d6b4e8f50e348c .

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/asciidoctor/asciidoctor-bibtex/issues/47?email_source=notifications&email_token=AAMUWC33GQ6FNWJKDRUDE5DQH7GPZA5CNFSM4HWHXWB2YY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOTNVA2UQ#event-2607418706, or mute the thread https://github.com/notifications/unsubscribe-auth/AAMUWC2X3LBXB5CDIA6E6PLQH7GPZANCNFSM4HWHXWBQ .

ProgramFan commented 5 years ago

You can now use v0.6.0 from rubygems where the bug is fixed.