samvera / hydra-head

Samvera Repository Rails Engine
Other
98 stars 41 forks source link

Investigate invalid token messages #212

Closed jcoyne closed 9 years ago

jcoyne commented 9 years ago

I'm seeing messages like this in STDOUT when running the test suite:

ERROR With input 'fizz': Invalid token "fizz"} (found "fizz")

You can duplicate by running this test inside of hydra-core:

SPEC=spec/controllers/downloads_controller_spec.rb:76 rake spec

I suspect it may be in the ebnf gem which does parsing for rdf-turtle. But I don't know how it's going down this path.

See here: https://github.com/gkellogg/ebnf/blob/eca1e41cb98e43cee13ebb8166f22b4a1246cc9f/lib/ebnf/ll1/parser.rb#L677

awead commented 9 years ago

It's complaining that the token is nil:

https://github.com/gkellogg/ebnf/blob/eca1e41cb98e43cee13ebb8166f22b4a1246cc9f/lib/ebnf/ll1/lexer.rb#L191

Looking further down the stack trace, there's something happening at fetch_original_name_from_headers but I can't tell what.

Here's the stack trace.

     # /Users/awead/Projects/Github/other/ebnf/lib/ebnf/ll1/parser.rb:675:in `rescue in get_token'
     # /Users/awead/Projects/Github/other/ebnf/lib/ebnf/ll1/parser.rb:669:in `get_token'
     # /Users/awead/Projects/Github/other/ebnf/lib/ebnf/ll1/parser.rb:262:in `parse'
     # /Users/awead/.gem/ruby/2.1.2/gems/rdf-turtle-1.1.4/lib/rdf/turtle/reader.rb:294:in `each_statement'
     # /Users/awead/.gem/ruby/2.1.2/gems/ldp-0.0.8/lib/ldp/response.rb:103:in `block in graph'
     # /Users/awead/.gem/ruby/2.1.2/gems/rdf-turtle-1.1.4/lib/rdf/turtle/reader.rb:274:in `call'
     # /Users/awead/.gem/ruby/2.1.2/gems/rdf-turtle-1.1.4/lib/rdf/turtle/reader.rb:274:in `block in initialize'
     # /Users/awead/.gem/ruby/2.1.2/gems/rdf-1.1.6/lib/rdf/reader.rb:210:in `instance_eval'
     # /Users/awead/.gem/ruby/2.1.2/gems/rdf-1.1.6/lib/rdf/reader.rb:210:in `initialize'
     # /Users/awead/.gem/ruby/2.1.2/gems/rdf-turtle-1.1.4/lib/rdf/turtle/reader.rb:251:in `initialize'
     # /Users/awead/.gem/ruby/2.1.2/gems/rdf-turtle-1.1.4/lib/rdf/turtle/reader.rb:213:in `new'
     # /Users/awead/.gem/ruby/2.1.2/gems/ldp-0.0.8/lib/ldp/response.rb:102:in `graph'
     # /Users/awead/.gem/ruby/2.1.2/gems/ldp-0.0.8/lib/ldp/response.rb:92:in `has_page?'
     # /Users/awead/.gem/ruby/2.1.2/gems/ldp-0.0.8/lib/ldp/response.rb:9:in `wrap'
     # /Users/awead/.gem/ruby/2.1.2/gems/ldp-0.0.8/lib/ldp/client/methods.rb:48:in `get'
     # /Users/awead/.gem/ruby/2.1.2/gems/ldp-0.0.8/lib/ldp/resource.rb:45:in `get'
     # /Users/awead/.gem/ruby/2.1.2/bundler/gems/active_fedora-aafa5265adef/lib/active_fedora/file.rb:199:in `fetch_original_name_from_headers'
     # /Users/awead/.gem/ruby/2.1.2/bundler/gems/active_fedora-aafa5265adef/lib/active_fedora/file.rb:102:in `original_name'
     # /Users/awead/Projects/Github/projecthydra/hydra-head/hydra-core/app/controllers/concerns/hydra/controller/download_behavior.rb:82:in `datastream_name'
     # /Users/awead/Projects/Github/projecthydra/hydra-head/hydra-core/app/controllers/concerns/hydra/controller/download_behavior.rb:76:in `content_options'
     # /Users/awead/Projects/Github/projecthydra/hydra-head/hydra-core/app/controllers/concerns/hydra/controller/download_behavior.rb:122:in `prepare_file_headers'
     # /Users/awead/Projects/Github/projecthydra/hydra-head/hydra-core/app/controllers/concerns/hydra/controller/download_behavior.rb:113:in `send_file_contents'
     # /Users/awead/Projects/Github/projecthydra/hydra-head/hydra-core/app/controllers/concerns/hydra/controller/download_behavior.rb:70:in `send_content'
     # /Users/awead/Projects/Github/projecthydra/hydra-head/hydra-core/app/controllers/concerns/hydra/controller/download_behavior.rb:16:in `show'
jcoyne commented 9 years ago

This doesn't seem to be an issue anymore.