Share via

Microsoft.Azure.Mobile.Client PullAsync “unexpected character encountered while parsing value: <. Path”

Kam M 31 Reputation points
2022-12-23T07:14:22.227+00:00

Hi,

This week, I started getting this error on the azure mobile services which is very odd. It doesn't fetch all the data or partially! I found the following link that someone else asked similar question but there aren't any solution.

https://social.msdn.microsoft.com/Forums/sharepoint/en-US/4500e06e-9a24-478d-8fc1-9d398f09f074/microsoftazuremobileclient-pullasync-8220unexpected-character-encountered-while-parsing-value?forum=windowsazurewebsitespreview

Does anyone have any thought of why this happens? The mobile application is in production.

Kind regards,
Kamal

Azure SQL Database
Azure App Service
Azure App Service

Azure App Service is a service used to create and deploy scalable, mission-critical web apps.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Kam M 31 Reputation points
    2023-06-23T03:07:55.5+00:00

    Hi,

    I upgraded the xamarin forms project to xamarin maui. It compiles fine. However, when I try to use the app, a similar error occurs when I try to do a table.pullasync.

    It is very odd. It happens at this line:

      await Table.PullAsync(
                             Guid.NewGuid(), MemberTable.CreateQuery(), pullOptions);
    
    at Newtonsoft.Json.JsonTextReader.ParseValue()
       at Newtonsoft.Json.JsonTextReader.Read()
       at Newtonsoft.Json.JsonReader.ReadAndMoveToContent()
       at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
       at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
       at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
       at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
       at Newtonsoft.Json.JsonConvert.DeserializeObject[JToken](String value, JsonSerializerSettings settings)
       at System.StringExtensions.ParseToJToken(String content, JsonSerializerSettings settings)
       at Microsoft.WindowsAzure.MobileServices.Query.QueryResult.Parse(MobileServiceHttpResponse httpResponse, JsonSerializerSettings serializerSettings, Boolean validate)
       at Microsoft.WindowsAzure.MobileServices.MobileServiceTable.ReadAsync(String uriString, MobileServiceFeatures features)
       at Microsoft.WindowsAzure.MobileServices.Sync.PullAction.FollowNextLinks(QueryResult result)
       at Microsoft.WindowsAzure.MobileServices.Sync.PullAction.ProcessTableAsync()
       at Microsoft.WindowsAzure.MobileServices.Sync.TableAction.ExecuteAsync()
       at Microsoft.WindowsAzure.MobileServices.Sync.MobileServiceSyncContext.ExecuteSyncAction(SyncAction action)
       at Microsoft.WindowsAzure.MobileServices.Sync.MobileServiceSyncContext.PullAsync(String tableName, MobileServiceTableKind tableKind, String queryId, String query, MobileServiceRemoteTableOptions options, IDictionary`2 parameters, IEnumerable`1 relatedTables, MobileServiceObjectReader reader, CancellationToken cancellationToken, PullOptions pullOptions)
    

    Any solution?

    Thanks.

    Kamal

    Was this answer helpful?

    0 comments No comments

  2. Kam M 31 Reputation points
    2022-12-27T03:22:46.48+00:00

    Thank you for your response and suggestion.

    I was able to fix the problem, which was very weird and strange to kick in suddenly.

    There were not any code changes to the database layer prior to the incident. To solve the issue, I added PullOption and didn't get the error message, all data was retrieved as expected.

                    **PullOptions pullOptions = new PullOptions();  
                    pullOptions.MaxPageSize = 1000;**  
    
                    await Client.SyncContext.PushAsync().ConfigureAwait(false);  
                    await MemberTable.PullAsync(  
                         "xx" + Guid.NewGuid(), MemberTable.CreateQuery(), **pullOptions**).ConfigureAwait(false);  
    

    The above solution may help someone.

    Was this answer helpful?


  3. Ajay Kumar N 28,266 Reputation points Microsoft Employee Moderator
    2022-12-26T12:59:39.367+00:00

    Kamal, Apologies for the delay from over the weekend.

    As I understand the issue started happening randomly this week. Just to clarify, were there any changes prior to this? When exactly do you receive this error? Could you please share more details about your mobile app?

    If haven’t done this already, in Visual Studio, right-click the solution > Manage NuGet Packages for Solution..., then search for and install the Microsoft.Azure.Mobile.Client.SQLiteStore NuGet package for all projects in the solution.

    Review the Synchronize an Offline Table.

    The v4.2.0 library version is superseded by the v5.0.0 library. You may also try upgrading to latest (v5.0) edition of the Microsoft Datasync Framework.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.