OpenDataServices / flatten-tool

Tools for generating CSV and other flat versions of the structured data
http://flatten-tool.readthedocs.io/en/latest/
MIT License
101 stars 18 forks source link

Error in openpyxl — IndexError: list index out of range #331

Open sentry-io[bot] opened 4 years ago

sentry-io[bot] commented 4 years ago

This only affects certain files, but does seem to keep recurring.

Sentry Issue: COVE-E5

IndexError: list index out of range
(8 additional frame(s) were not displayed)
...
  File "openpyxl/descriptors/serialisable.py", line 104, in from_tree
    return cls(**attrib)
  File "openpyxl/styles/stylesheet.py", line 93, in __init__
    self.named_styles = self._merge_named_styles()
  File "openpyxl/styles/stylesheet.py", line 113, in _merge_named_styles
    self._expand_named_style(style)
  File "openpyxl/styles/stylesheet.py", line 123, in _expand_named_style
    xf = self.cellStyleXfs[named_style.xfId]
  File "openpyxl/styles/cell_style.py", line 186, in __getitem__
    return self.xf[idx]

list index out of range
Bjwebb commented 4 years ago

CoVE 500 error due to problem in openpyxl or flatten-tool

Bjwebb commented 4 years ago

The error looks like this in CoVE: Screenshot from 2019-12-10 15-06-29

I'm not sure who this is affecting. I checked one of the files, and it looks like sample data. @KDuerden @drkane Have you run into this?

KDuerden commented 4 years ago

Yes it happens a lot. Usually fixed by copy and pasting the data into a new file. Recently had it occur with a template with hashComments too - but not had a chance to see what fixes it. I can supply examples if that is helpful.

Bjwebb commented 4 years ago

Yes, examples would be useful. I can go check the last 7 days myself, but not any earlier, and your extra context is probably useful.

Upload files to this issue if they can be public, otherwise to a plan.io issue.

KDuerden commented 4 years ago

Here is conversion template which gives the error message: https://dataquality.threesixtygiving.org/data/ae72a03a-059f-4936-a142-d7f93e4e2516

I've just recopied this all into a new file (same content & formulas/structure) and it passes: https://dataquality.threesixtygiving.org/data/e34008f3-f7ab-453d-8f32-fd27e8a77105

Example 360 conversion template 2019_notworkinginCove.xlsx

Template for testing Cove_works in Cove.xlsx

I've seen examples of this happening with publisher data which are just single sheets, so not sure if the tabs/hash is significant or not.

ETA files

Bjwebb commented 4 years ago

Example_360_conversion_template_2019_notworkinginCove.xlsx Template_for_testing_Cove_works_in_Cove.xlsx

sentry-io[bot] commented 4 years ago

New Sentry issue: COVE-EV