snpr icon indicating copy to clipboard operation
snpr copied to clipboard

Zipgenotypingfiles fails when the file is missing

Open tsujigiri opened this issue 7 years ago • 3 comments

What do we do? Delete the Genotype record and notify the user?

https://sentry.io/opensnp/opensnp/issues/436275621/

Errno::ENOENT: No such file or directory @ rb_file_s_lstat - /home/app/snpr/public/data/4979.genes-for-good.3516
  app/workers/zipgenotypingfiles.rb:27:in `block (2 levels) in perform'
    zipfile.add('user' + gen_file.user_id.to_s + '_file' + gen_file.id.to_s + '_yearofbirth' + gen_file.user.yearofbirth + '_sex' + gen_file.user.sex + '.' + gen_file.filetype + '.txt', ::Rails.root.to_s + '/public/data/' + gen_file.fs_filename)
  app/workers/zipgenotypingfiles.rb:26:in `each'
    @genotyping_files.each do |gen_file|
  app/workers/zipgenotypingfiles.rb:26:in `block in perform'
    @genotyping_files.each do |gen_file|
  app/workers/zipgenotypingfiles.rb:25:in `perform'
    Zip::File.open(::Rails.root.to_s + '/public/data/zip/' + phenotype_id.to_s + '.' + @time.to_s.gsub(' ', '_') + '.zip', Zip::File::CREATE) do |zipfile|
...
(31 additional frame(s) were not displayed)

No such file or directory @ rb_file_s_lstat - /home/app/snpr/public/data/4979.genes-for-good.3516

tsujigiri avatar Apr 03 '18 08:04 tsujigiri

How does this happen in the first place? Does this particular user/genotyping not exist anymore, but for some reason teh DB entry is there?

philippbayer avatar Apr 03 '18 08:04 philippbayer

That's what it is. No clue on how it happened. Maybe the deleting job failed and managed to delete the file but not the record...

tsujigiri avatar Apr 03 '18 08:04 tsujigiri

It seems there are some of these in the latest uploads, one user complained via email about this phenomenon too.

gedankenstuecke avatar Apr 03 '18 15:04 gedankenstuecke