Forum Discussion

barnesgc's avatar
barnesgc
New member | Level 2
8 years ago

Unexpected character encountered while parsing value: <.Path

I have a VB.NET application that has been successfully using the .NET API to get a list of available files and download any that are missing in our local data share.  It has been running once a day, without any issues, for several weeks.

 

This morning, it is intermitently failing.  I've gotten it to work twice, but on most occasions it thows an exception when it attempts to retrieve the list of all of the files available on Dropbox.  The exception message that I get is, "Unexpected character encountered while parsing value: <.Path".  Nothing has changed about this code in the last few weeks.  So it worked just fine for a while, but has suddenly stopped working today.

 

The VB.NET code is encased in a class, with the following code:

 

Friend Class clsDropbox

   Private m_Dropbox As DropboxClient

   Friend Sub New(token As String)

      m_Dropbox = New DropboxClient(token)

   End Sub

   Friend Function ListGpsFiles() As List(Of clsGpsFileZip)

      Dim lstReturn As New List(Of clsGpsFileZip)
      Dim strError As String
      Dim gfz As clsGpsFileZip
      Dim lst As Files.ListFolderResult
      Dim fmd As Files.Metadata

      Try

         lst = m_Dropbox.Files.ListFolderAsync("/Apps/GPSLogger for Android/").Result

      Catch ex As Exception

         strError = "Falied to retrieve file list from Dropbox.  "

         If Not ex.InnerException.Message Is Nothing Then
            strError = strError + ex.InnerException.Message + "."
         Else
            strError = strError + ex.Message + "."
         End If

         Call MsgBox(strError)
         Application.Exit()

      End Try

      For Each fmd In lst.Entries

         If fmd.IsFile Then

            gfz = New clsGpsFileZip(fmd.Name)

            If gfz.IsGpsFile Then
               gfz.Path = fmd.PathLower
               lstReturn.Add(gfz)
            End If

         End If

      Next

      Return lstReturn

   End Function

End Class

As I say, everything worked fine until this morning, and the code has not changed in the past few weeks.  Any advice?

 

3 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    8 years ago
    Thanks for the report! Based on the error message, it looks like the JSON parsing is failing because the response didn't contain valid JSON (e.g., it has "<").

    That could happen due to intermittent server issues on our side. I can't reproduce the issue right now. Are you still seeing it?
  • barnesgc's avatar
    barnesgc
    New member | Level 2
    8 years ago

    Everything worked correctly this morning.  It's a daily process, so if I encouter it again I will post here.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    8 years ago
    Thanks! Server issues can happen occasionally, so it may be helpful to add some automatic retries for failures like this.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!