Forum Discussion

Sibrulotte's avatar
Sibrulotte
Helper IV
5 years ago
Solved

JSON File: reached end of buffer

Hi, 

I have a JSON file retrieved from a POST call in Postman. This JSON file was parsed successfully once in my main file, and I was a happy camper.

 

Unfortunatly, the next day, I refreshed the POST call in Postman, saved the response to my JSON file again overwriting it. The minute I tried to refresh the query using that file there was an errror message: We reached the end of the buffer ...

 

I tried openeing the file from another Power Bi document, fresh, with all windows around closed, and alas, same message.

 

What would be the issue you think?

  • Well I have been able to locate the problem:

    The POST call returns an incomplete response thus incomplete JSON file is saved. 

    It seems to be an issue with my data provider.

     

    So moral of the story is: incorrect JSON format will give an end of buffer memory error.

     

    Thank your for your time.

     

10 Replies

  • Sibrulotte not sure why you get this buffer error, can you share a sample pbix file? What kind of transformation are you doing if any? Do you happen to know how many records are in the file?

    • Sibrulotte's avatar
      Sibrulotte
      Helper IV

      Well I have been able to locate the problem:

      The POST call returns an incomplete response thus incomplete JSON file is saved. 

      It seems to be an issue with my data provider.

       

      So moral of the story is: incorrect JSON format will give an end of buffer memory error.

       

      Thank your for your time.

       

      • PhilipTreacy's avatar
        PhilipTreacy
        Super User

        Hi Sibrulotte 

        For what it's worth, is the reponse incomplete because the request was invalid or was the request valid but the returned data was badly formatted or truncated JSON?

        If a request is invalid and the expected returned data should be JSON, then what happens is you actually get a HTTP response back (which isn't JSON) and any attempt to parse JSON fails.

        It's always best to check what response is actually received rather than assume you get what you asked for.

        I know you said that your first request worked, so it would look like your request is properly formed. However you can still get an error returned if there's a problem with the service you are connecing to (perhaps a 404 Not Found or a 500 Internal Server Error).

        Anyway, just thought that might be useful to bear in mind for the future.

        regards

        Phil

  • nvprasad's avatar
    nvprasad
    Solution Sage

    Hi,

     

    Kindly check the json file might have no records ( Blank file).

     

    Appreciate a Kudos! 🙂
    If this helps and resolves the issue, please mark it as a Solution! 🙂

    Regards,
    N V Durga Prasad

  • you for the support. 

    The file currently is 1.1M in size, and has all the data I need with the same parsing format that the initial file had.

    • Sibrulotte's avatar
      Sibrulotte
      Helper IV

      I see 6K to 14k users.

      amitchandak parry2k PhilipTreacy mahoneypat  MFelix 

      You guys seem to be the all star.

      Is my question far fetched or impossible to adress?

      Should I just figure out a way to make the REST API connector work? cause that was a deadend rather quickly too for me.

  • Sibrulotte glad to hear you found the solution and thanks for sharing it here. I'm sure it will be helpful to others. This is what makes this community great. Cheers!!

     

    Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.