360 Sync Error Blog: Index was out of range
August 5, 2022
One of the more common errors our customers get revolves around an “Index was out of range” error. This blog will teach you what the error means & how to fix it.
What does an “Index was out of range” error mean?
Here’s what the typical “Index was out of range” error looks like in our 360 Sync logs:
2022-08-03 18:16:44,301 ERROR - An unexpected or unknown error occurred in the mapping.
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Usually, what happens when you see an “Index was out of range” error, it’s because (1) your root folder was deleted or changed names, (2) there is already a folder or a file name in the destination location & there can’t be 2 files or folders with the same name, (3) the file or folder name contains a restricted character (like < > ^ \ / ), or in some rare cases, (4) a folder was inadvertently uploaded as a file.
Problem 1 - Folder or file name changed
You may get this error if the name of the root folder, or the main folder that you’re uploading files to, has changed since the last time 360 Sync has run. Take a look at the image below – it shows that the folder name in Docs doesn’t match up with the folder name in 360 Sync. This could happen in any of our connections & is not an error specific to Autodesk or Windows.
Solution: Either re-map 360 Sync to the newly named folder or change the folder name back.
Problem 2 - Duplicate File or Folder name
Another time this error has occurred is if there is already a file or folder with the same exact name in the destination location. Usually, this occurs if you are trying to copy 2 different folders from one place into the same folder in the destination.
For example, you are copying the HVAC Submittals folder & the Plumbing Submittals folder from your server to the Submittals folder in SharePoint. Inside both folders is the a folder titled “Approved Submittals.” When you sync the first folder, the “Approved Submittals” folder is created, but then when the second folder syncs, the “Index was out of Range” error occurs.
Solution: Create new folders in the destination location for the 2 folders you’re trying to sync. This will ensure that the folder causing the problem will not be duplicated by 360 Sync & instead will be created in the correct subfolder.
Problem 3 – the File or folder name contains a restricted character
This particular error occurs most when Procore is the destination location in 360 Sync because when Procore sees a restricted character (like slashes or greater than less than signs), Procore automatically changes the file name to a name that has an allowed character. Then, when 360 Sync runs the second time, Procore tries to rename the file again, but the file name is already taken & the “Index was out of range” error occurs.
Example: Name of File in SharePoint – ½” Anchor Bolts Submittal.pdf
360 Sync runs for first time
Procore finds illegal characters, changes name to: 1-2_Anchor Bolts Submittal.pdf
360 Sync runs a second time
Procore finds illegal character, tries to change name to: 1-2_Anchor Bolts Submittal.pdf
Procore recognizes that the name is already taken
“Index was out of range” error occurs
Solution: Best practice is not to use funky characters in your file names. Don’t use the following: < > / \ | and also don’t use multiple spaces, underscores, or put multiple spaces, underscores, periods or other punctuation at the end of the file name.
Problem 4 - the folder was inadvertently uploaded as a file
This error has only occurred a few times. In fact, it’s so rare that we don’t have a picture of the occurrence even happening. We have seen this happen when syncing between Viewpoint, SharePoint, BIM 360 or Windows. Usually, this error occurs in 360 Sync version 3.4.0.xx or earlier.Here is what happens – the file or folder has a period in the middle of the name & 360 Sync accidentally reads that period as the file suffix. Then, 360 Sync uploads a broken file or folder. Then, when 360 Sync runs again, it tries to find the folder or file, and is unable to do so. Then, the user gets the “Index was out of range” error.
Solution: To fix this error, upgrade 360 Sync to the most recent version download here.