Forums

Forums / Bugs & Issues / PrePortalUserRoleDelete plugin error - Data at the root level is invalid

PrePortalUserRoleDelete plugin error - Data at the root level is invalid

4 posts, 0 answered
  1. Richard Watt
    Richard Watt avatar
    4 posts
    Registered:
    12 May 2021
    18 Jun 2023
    Link to this post
    Hi

    I have a crm plugin that is modifying the Portal User Roles. It deletes all portal user roles and re-adds them based on a custom permission field on the contact. This has been working successfully.

    However in our UAT environment, the TPC plugin that triggers from the Portal User Role delete now gives an error. It appears to be a xml parsing error

    this is the plugin error trace log:

    pavliks.PortalConnector.Plugins.PrePortalUserRoleDelete is firing for Entity: pav_portaluserrole, Message: Delete, Correlation Id: 5fef023c-1444-4bd9-8286-a963af52d2db, Initiating User: 7b20c998-25e9-e811-a96c-000d3ad05e15
    The Portal Connector - Cache Helper Acquire Portal Records: Querying all Portal Records.
    The Portal Connector - Cache Helper Acquire Portal Records: All portals queried successfully.
    The Portal Connector - Cache Helper Acquire Portal Record: Retrieved portal with id c6c8f0e0-d200-ed11-82e6-00224894471e from cache.
    Portal Record Id: c6c8f0e0-d200-ed11-82e6-00224894471e Name: xxx Url: https://xxxx.xxx.xx
    Error Message: Data at the root level is invalid. Line 1, position 1. Stack Trace:    at System.Xml.XmlTextReaderImpl.Throw(Exception e)
       at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
       at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
       at System.Xml.XmlReader.MoveToContent()
       at System.Xml.Linq.XElement.Load(XmlReader reader, LoadOptions options)
       at System.Xml.Linq.XElement.Parse(String text, LoadOptions options)
       at pavliks.PortalConnector.Plugins.PrePortalUserRoleDelete.ExecutePrePortalUserRoleDelete(IServiceProvider serviceProvider)
    Exiting pavliks.PortalConnector.Plugins.PrePortalUserRoleDelete.Execute(), Correlation Id: 5fef023c-1444-4bd9-8286-a963af52d2db, Initiating User: 7b20c998-25e9-e811-a96c-000d3ad05e15

    I compared the XML unsecure config on the plugin step to another step and they are identical incase that had become corrupted somehow.

    we are on TPC version 6.1

    Regards
    Richard
  2. Richard Watt
    Richard Watt avatar
    4 posts
    Registered:
    12 May 2021
    19 Jun 2023 in reply to Richard Watt
    Link to this post
    Some extra info. 

    The mention of my other plugin should not be relevant, as the error occurs if deleting via the UI too.

    I manually disabled the plugin and I was able to delete the Portal User Roles ok via the UI. And the roles could be added back ok - it just seems to be the delete plugin having the error.

    I triggered the 'Install CRM Solution' again from the TPC config page and it installed the 6.1 solution again, but it didn't fix the issue.

    Any suggestions?

  3. Rawdon Edghill
    Rawdon Edghill avatar
    76 posts
    Registered:
    16 Dec 2020
    20 Jun 2023
    Link to this post
    Hi Richard,

    Thank you for your question.

    Can you confirm if this is a custom plugin being used? 

    Also, I would recommend reaching out to tpcsupport@sylogist.com to have a case open so that a developer can work with you one on one to solve this issue.

    Regards,
    Rawdon
  4. Richard Watt
    Richard Watt avatar
    4 posts
    Registered:
    12 May 2021
    20 Jun 2023 in reply to Rawdon Edghill
    Link to this post
    Hi Rawdon

    There is a custom plugin involved, but upon further checking I can produce the error through the UI so I cannot see that this is part of the problem. Also there is no error in PROD, and it did previously work in UAT where this error now occurs. 

    Also, I have found I get the same error on another TPC plugin - PrePortalUserUpdate.

    I am pretty sure this is xml parsing code where the error occurs. There cannot be many places the plugin needs to do that.  A plugin will read the secure config that contains xml, but this looks fine. Also that would normally occur in the plugin constructor, so would be an immediate error, rather than one after doing some work as can be seen by the error trace.

    So what other xml do the plugins read?

    Regards
    Richard
4 posts, 0 answered