web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / PowerPages - webfiles ...
Power Pages
Suggested Answer

PowerPages - webfiles - System.NullReferenceException

(1) ShareShare
ReportReport
Posted on by 1,992 Super User 2025 Season 1
Hello All,
 
I am trying to edit Power Page code with VSCode - in the process setup the VSCode environment - able to connect and authenticate with Power Page environment. But when I try to download the Power page files using below command received an exception. please let me know if you faced the issue or know the resolution. 
 
Thanks
 
Executed a command - similar to -> pac paportal download --path c:\pac-portals\downloads -id d44574f9-acc3-4ccc-8d8d-85cf5b7ad141 --modelVersion 2
Downloading - webfiles
Downloading - powerpagesite
Downloading - powerpagesitelanguage
Downloading - powerpagecomponent
Downloaded - powerpagesite
Downloaded - powerpagesitelanguage
Downloaded - powerpagecomponent
Downloaded - webfiles
Sorry, the app encountered a non recoverable error and will need to terminate. The exception details have been captured and will be forwarded to the development team, if telemetry has been enabled. Session Id: 91d13074-bc8e-464a-a7b8-2de8cf0ab1ec, Exception Type: System.NullReferenceException
 
Exception stack trace 
2024-09-05 15:10:50.6520 | FTL | bolt.Session :: Object reference not set to an instance of an object.|EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object.
   at bolt.module.paportal.core.download.CoreEntityDownloader.<>c__DisplayClass16_0.<GroupRecordsByComponentType>b__2(IGrouping`2 g)
   at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
   at bolt.module.paportal.core.download.CoreEntityDownloader.GroupRecordsByComponentType(IDictionary`2 rawRecords, XmlDocument targetSchema)
   at bolt.module.paportal.core.download.CoreEntityDownloader.ExportDownloadedRecords(IDictionary`2 rawRecords, String tempRootFolder)
   at bolt.module.paportal.core.download.CoreEntityDownloader.ExportDataForAllEntities(String tempRootFolder)
   at bolt.module.paportal.PortalDataExporter.ExportDataForCoreEntities(String exportFolder, CliExecutionContext cliInfra, DownloadContext downloadContext)
   at bolt.module.paportal.PortalDataExporter.ExportDataForAllEntities(AuthProfile authProfile, String exportFolder)
   at bolt.module.paportal.PortalDataExporter.DownloadData(AuthProfile authProfile)
   at bolt.module.paportal.verbs.PAPortalDownloadVerb.<ExecuteAsync>d__16.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
2024-09-05 15:10:50.6756 | ERR | bolt.Session ::    at bolt.module.paportal.core.download.CoreEntityDownloader.<>c__DisplayClass16_0.<GroupRecordsByComponentType>b__2(IGrouping`2 g)
   at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
   at bolt.module.paportal.core.download.CoreEntityDownloader.GroupRecordsByComponentType(IDictionary`2 rawRecords, XmlDocument targetSchema)
   at bolt.module.paportal.core.download.CoreEntityDownloader.ExportDownloadedRecords(IDictionary`2 rawRecords, String tempRootFolder)
   at bolt.module.paportal.core.download.CoreEntityDownloader.ExportDataForAllEntities(String tempRootFolder)
   at bolt.module.paportal.PortalDataExporter.ExportDataForCoreEntities(String exportFolder, CliExecutionContext cliInfra, DownloadContext downloadContext)
   at bolt.module.paportal.PortalDataExporter.ExportDataForAllEntities(AuthProfile authProfile, String exportFolder)
   at bolt.module.paportal.PortalDataExporter.DownloadData(AuthProfile authProfile)
   at bolt.module.paportal.verbs.PAPortalDownloadVerb.<ExecuteAsync>d__16.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Categories:
I have the same question (0)
  • Suggested answer
    sannavajjala87 Profile Picture
    744 Super User 2026 Season 1 on at
    Hi,
     
    It looks like the download process is successfully retrieving the portal metadata, but then fails during the export phase when the PAC CLI tries to group components. The NullReferenceException in CoreEntityDownloader.GroupRecordsByComponentType is typically caused by a portal component or record that has missing, orphaned, or unexpected metadata that the CLI doesn't handle correctly.
    A few things I'd check:
    1. Verify your PAC CLI version and update to the latest available version. There have been several fixes over time related to Power Pages download/export operations.
    2. Try downloading with a different model version if supported by your portal. Some users have encountered issues with specific model versions while another version completed successfully.
    3. Review recently added Power Pages components, especially:
      • Web Templates
      • Content Snippets
      • Page Templates
      • Web Files
      • Custom components created through solutions
    An orphaned record or missing reference can trigger this type of exception.
    1. Run the command against another Power Pages site (if available). If another site downloads successfully, that helps confirm the issue is specific to metadata in this portal rather than the PAC CLI installation.
    2. Since the download reaches:
      • webfiles
      • powerpagesite
      • powerpagesitelanguage
      • powerpagecomponent
    before failing, I'd focus on custom Power Pages components and related configuration records that may contain incomplete data.
    1. Check whether there are any unmanaged customizations, deleted references, or solution import issues in the environment. I've seen PAC CLI fail when portal records reference components that no longer exist.
    If you're still blocked, please share:
    • PAC CLI version (pac --version)
    • Whether this is an enhanced data model or standard portal
    • Whether the issue occurs for all sites or just this specific Power Pages site
    That information will help narrow down whether this is a known PAC CLI bug or a metadata inconsistency within the portal configuration itself.
     
    Thanks,
    Manoj Annavajjala
    www.powerplatformengineer.com

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
sannavajjala87 Profile Picture

sannavajjala87 42 Super User 2026 Season 1

#2
Valantis Profile Picture

Valantis 35

#3
Fubar Profile Picture

Fubar 29 Super User 2026 Season 1

Last 30 days Overall leaderboard