Skip to main content
All CollectionsKnowledge BaseEndpoint and SaaS AppsTroubleshooting - Endpoint and SaaS Apps
Resolving Exchange Online Backup Error : AttributeError: 'NoneType' object has no attribute 'startswith'
Resolving Exchange Online Backup Error : AttributeError: 'NoneType' object has no attribute 'startswith'

Resolving Exchange Online Backup Error : AttributeError: 'NoneType' object has no attribute 'startswith'

Updated this week

Issue

When backing up Exchange Online mailboxes, the process fails, and the user debug log shows the following error:

AttributeError: 'NoneType' object has no attribute 'startswith'

This article provides a resolution for this issue.


Cause

This error can occur if there are folders inside the user’s archived folder or primary mailbox with empty display names. Such situations may arise when a folder originally had a name, but during mailbox migration using a tool, the name was not retained from the source to the destination.


Diagnostics

Download the user debug logs with the help of this article: https://help.druva.com/en/articles/8702891-download-insync-user-log-files

Check the Exchange online logs and the logs will have the below traceback:

[2021-07-13 18:16:42,159] [ERROR] Error while parsing archive mailbox folders for folder_id: archivemsgfolderroot, dpath: /In-Place Archive, user: user@druvabackup . Error: 'NoneType' object has no attribute 'startswith'[2021-07-13 18:16:42,161] [ERROR] Error <type 'exceptions.AttributeError'>:'NoneType' object has no attribute 'startswith'. Traceback -Traceback (most recent call last):  File "/opt/Druva/inSync/active/src/drcloud/Lib/O365ExchangeAgent.py", line 339, in __parse_folders    folder['dpath']         = posixpath.join(dpath, folder['dname'])  File "/usr/local/pyenv/versions/2.7.18/lib/python2.7/posixpath.py", line 68, in join    if b.startswith('/'):AttributeError: 'NoneType' object has no attribute 'startswith'

To diagnose the issue, you need to be a Global Administrator in Microsoft 365. Follow these steps:

  1. Connect to Office 365 using a Global Administrator account via PowerShell.

  2. Create a directory C:\DruvaLogs to store the diagnostic logs.

  3. Run the following commands in PowerShell:

Start-Transcript -Path C:\DruvaLogs\Output.txtGet-Mailbox -Identity user@druvabackup.com | FL DisplayName,UserPrincipalName, *archive*Get-Mailbox -Identity user@druvabackup.com | FLGet-Mailbox -Identity user@druvabackup -Archive | FLGet-MailboxFolderStatistics -Identity user@druvabackup | Select Name,FolderPath,FolderAndSubfolderSize,VisibleItemsInFolder,HiddenItemsInFolder | Export-Csv -Path C:\DruvaLogs\MailboxFolderStatistics.csvGet-MailboxFolderStatistics -Identity user@druvabackup -Archive | Select Name,FolderPath,FolderAndSubfolderSize,VisibleItemsInFolder,HiddenItemsInFolder | Export-Csv -Path C:\DruvaLogs\MailboxFolderStatistics-Archive.csvStop-Transcript


4. Navigate to C:\DruvaLogs. You should find the following files:

  • MailboxFolderStatistics.csv

  • MailboxFolderStatistics-Archive.csv

  • Output.txt

5. Analyze these files to check for folders with empty display names. For example, in MailboxFolderStatistics-Archive.csv, a row with a missing folder name will appear as a gap. Below is a sample image for reference:


Resolution

  1. Open Outlook Client and locate the folder with no title.

  2. If the folder contains emails or other content, it will be displayed on the reading pane once clicked on the empty patch between subfolders.Rename the folder in the Outlook Client to a meaningful name.

Here is an example image illustrating the folder renaming process:

3. After renaming the folder(s), retry the backup process.


Contact Support

If the issue persists after renaming the folders, please contact Druva Support for further assistance.

Did this answer your question?