You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
XLSX ingest fails when first worksheet row has no spans attribute #12856
Dataverse 6.11 fails to ingest an otherwise valid XLSX file when the first worksheet row does not contain the optional spans attribute (file may have been exported?).
The original XLSX fails to ingest. Opening the same file in Microsoft Excel and saving it as a new XLSX causes it to ingest successfully. Saving it as CSV also works. The column names and data do not appear to be the problem.
Error
Null r attribute in the first row element!
Null spans attribute in the first row element!
Ingest failure (IO Exception): Could not parse Excel/XLSX spreadsheet.
Cannot invoke "String.indexOf(int)" because "spansAttribute" is null.
Cause
The original worksheet XML contains a first row like:
<row r="1">
It does not contain a spans attribute such as:
<row r="1" spans="1:12">
The spans attribute is optional in XLSX/SpreadsheetML. XLSXFileReader checks whether it is null but then calls spansAttribute.indexOf(':'), resulting in the exception.
Steps to reproduce
Create or upload an XLSX whose first worksheet row omits the spans attribute.
Upload it to a dataset and allow tabular ingest to run.
Observe that ingest fails with the exception above.
Open the same file in Microsoft Excel, save it as a new XLSX, and upload it again.
Observe that the rewritten XLSX ingests successfully.
Environment
Dataverse 6.11
I did look through open issues and I don't think this one is mentioned yet, but I could have missed it.
I looked at XLSXFileReader.startElement and the cause is visible in the code.
When the spans attribute is missing, the code logs Null spans attribute in the first row element! and then still calls spansAttribute.indexOf(':') on the next statement. That call is outside the try block, so a NullPointerException is thrown before the existing check that throws a SAXException ("Could not establish column count...") can run.
A null guard stops the crash, but varCount then has to come from somewhere. I see three options: (1) throw that existing SAXException with a clearer message, (2) count the <c> elements in the first row, (3) read the dimension reference of the sheet. Which would you like? I can send a PR with a test using a small XLSX whose first row has no spans attribute.
AI disclosure: an AI assistant (Claude) helped me investigate this and draft this comment. The code references were checked against the current default branch.
Activity
adityaanikam commentedon Oct 28, 2026
I looked at
XLSXFileReader.startElementand the cause is visible in the code.When the
spansattribute is missing, the code logsNull spans attribute in the first row element!and then still callsspansAttribute.indexOf(':')on the next statement. That call is outside thetryblock, so aNullPointerExceptionis thrown before the existing check that throws aSAXException("Could not establish column count...") can run.A null guard stops the crash, but
varCountthen has to come from somewhere. I see three options: (1) throw that existingSAXExceptionwith a clearer message, (2) count the<c>elements in the first row, (3) read thedimensionreference of the sheet. Which would you like? I can send a PR with a test using a small XLSX whose first row has nospansattribute.AI disclosure: an AI assistant (Claude) helped me investigate this and draft this comment. The code references were checked against the current default branch.