hipstas / AudiAnnotate

Workflows for generating AV editions and exhibits using IIIF manifests by HiPSTAS and Brumfield Labs.
https://hipstas.github.io/AudiAnnotate/
Apache License 2.0
15 stars 8 forks source link

process_annotation_file error #258

Open teddiebrock opened 1 year ago

teddiebrock commented 1 year ago

Describe the bug The following error message occurs after processing an annotation file (have tested with .txt .csv and .tsv)

ArgumentError in ItemsController#process_annotation_file comparison of NilClass with String failed

Extracted source (around line #105): layers[layer] = csv[start_row..] else labels = csv[start_row..].map{|row| row[config[:layer_col]]}.sort.uniq labels.each do |label|

find each subset of rows

    target_rows = csv.dup.keep_if{|row| row[config[:layer_col]] == label}

Rails.root: /home/audiannotate/audi-annotate/AudiAnnotateWeb Application Trace | Framework Trace | Full Trace app/models/annotation_file.rb:105:in sort' app/models/annotation_file.rb:105:insave' app/controllers/items_controller.rb:111:in `process_annotation_file'

Request

Parameters:

{"authenticity_token"=>"N5yoTb+fdd6kohe2TR5P2uuCCJhUIcl4xKCegzw63jWbtGs9J9j/pqhUzD1Mqqq3SRqz0SCubX3Ioha2vKn7cQ==", "headers"=>"1", "start_time"=>"0", "end_time"=>"1", "annotation"=>"2", "has_layer_column"=>"Yes", "layer_column"=>"3", "item"=>{"layer_label"=>"", "label"=>"Side A", "repo_name"=>"sfu-poetry-panel", "user_name"=>"teddiebrock"}, "has_index_column"=>"Yes", "index_column"=>"4", "annotation_file_basename"=>"20221202022512_annotations-sideA - Sheet1(1).tsv", "commit"=>"Process", "user_name"=>"teddiebrock", "repo_name"=>"sfu-poetry-panel", "slug"=>"side-a"}

Response

Headers: None

To Reproduce Steps to reproduce the behavior:

  1. Under 'Add annotation file,' clicked 'Add'
  2. Annotation columns and data appear to be correctly formatted
  3. Filled out Column, Layer, and Index Configuration (tried both toggling Header on and off to see if that was the issue)
  4. Clicked 'Process'

Expected behavior To return to the Annotations landing page and see updated data/columns.

Screenshots Image of an example .txt file. I've removed spaces and separated my index terms with a period, which seems to have given me the smoothest results on the final page.

Screen Shot 2022-12-01 at 6 35 45 PM Screen Shot 2022-12-01 at 6 41 04 PM

Additional context I was having difficulty with removing layers and index terms from the Annotations page before so I tried to manually deleting these files directly from my repository, which had so far appeared to be successful. I'm not sure if that has at all contributed to this current bug, though.

I am also getting an "Errored" message (in the Building/Ready status icon) whenever I create a new project (not the Item Manifest, just the project). To see if there was something wrong with my repository specifically, I set up a new GitHub account but I still get the same message.

teddiebrock commented 1 year ago
Screen Shot 2022-12-06 at 1 43 18 PM

Here is a recent bug that occurs when I click on my page (the link under "Audiovisual Items and Pages") that should bring me to the annotation files/editing page. Here I had created a new test project on a separate GitHub account to check if the problem was isolated somehow to my old repository.

benwbrum commented 1 year ago

I'm taking a look at this now. @teddiebrock, stay tuned -- I might need some more information from you.