SequenceServer bug - ArgumentError pops up when downloading a fasta file

Hello,
I enountered an argumenterror on SequenceServer, the version that we are using is 1.0.14.

I was blasting a protein sequence against a protein database (which was succesfuly created with sequenceserver -m)
The error shows up when I want to download a fasta file of one of the blast results.

Here is full error message:

ArgumentError - invalid byte sequence in UTF-8:
/var/lib/gems/2.7.0/gems/sequenceserver-1.0.14/lib/sequenceserver/sequence.rb:197:in split' /var/lib/gems/2.7.0/gems/sequenceserver-1.0.14/lib/sequenceserver/sequence.rb:197:in block in run’
/var/lib/gems/2.7.0/gems/sequenceserver-1.0.14/lib/sequenceserver/sequence.rb:196:in each_line' /var/lib/gems/2.7.0/gems/sequenceserver-1.0.14/lib/sequenceserver/sequence.rb:196:in each’
/var/lib/gems/2.7.0/gems/sequenceserver-1.0.14/lib/sequenceserver/sequence.rb:196:in map' /var/lib/gems/2.7.0/gems/sequenceserver-1.0.14/lib/sequenceserver/sequence.rb:196:in run’
/var/lib/gems/2.7.0/gems/sequenceserver-1.0.14/lib/sequenceserver/sequence.rb:172:in initialize' /var/lib/gems/2.7.0/gems/sequenceserver-1.0.14/lib/sequenceserver/routes.rb:152:in new’
/var/lib/gems/2.7.0/gems/sequenceserver-1.0.14/lib/sequenceserver/routes.rb:152:in block in <class:Routes>' /var/lib/gems/2.7.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1611:in call’
/var/lib/gems/2.7.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1611:in block in compile!' /var/lib/gems/2.7.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:975:in block (3 levels) in route!’
/var/lib/gems/2.7.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:994:in route_eval' /var/lib/gems/2.7.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:975:in block (2 levels) in route!’
/var/lib/gems/2.7.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1015:in block in process_route' /var/lib/gems/2.7.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1013:in catch’
/var/lib/gems/2.7.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1013:in process_route' /var/lib/gems/2.7.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:973:in block in route!’
/var/lib/gems/2.7.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:972:in each' /var/lib/gems/2.7.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:972:in route!’
/var/lib/gems/2.7.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1085:in block in dispatch!' /var/lib/gems/2.7.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in block in invoke’
/var/lib/gems/2.7.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in catch' /var/lib/gems/2.7.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in invoke’
/var/lib/gems/2.7.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1082:in dispatch!' /var/lib/gems/2.7.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:907:in block in call!’
/var/lib/gems/2.7.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in block in invoke' /var/lib/gems/2.7.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in catch’
/var/lib/gems/2.7.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in invoke' /var/lib/gems/2.7.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:907:in call!’
/var/lib/gems/2.7.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:895:in call' /var/lib/gems/2.7.0/gems/rack-1.6.13/lib/rack/head.rb:13:in call’
/var/lib/gems/2.7.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:182:in call' /var/lib/gems/2.7.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:2013:in call’
/var/lib/gems/2.7.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1487:in block in call' /var/lib/gems/2.7.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1787:in synchronize’
/var/lib/gems/2.7.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1487:in call' /var/lib/gems/2.7.0/gems/sequenceserver-1.0.14/lib/sequenceserver.rb:96:in call’
/var/lib/gems/2.7.0/gems/rack-1.6.13/lib/rack/handler/webrick.rb:88:in service' /usr/lib/ruby/2.7.0/webrick/httpserver.rb:140:in service’
/usr/lib/ruby/2.7.0/webrick/httpserver.rb:96:in run' /usr/lib/ruby/2.7.0/webrick/server.rb:307:in block in start_thread’

Any help is appreciated.
Best regards
Tereza

Hi Tereza,

“invalid byte sequence in UTF-8” suggests that there is a strange character - perhaps in the identifier or the description of that BLAST hit.

I would suggest:

  • run the database FASTA through seqtk seq -a or similar and check that there are no non-standard characters (sometimes these are invisible)
  • use a more recent version of BLAST and SequenceServer (BLAST has become more strict with its error-checking, and SequenceServer 2.0 uses several options during database formatting that are able to detect database issues before you deploy them).

Kind regards,
Yannick