Skip to content
This repository has been archived by the owner on Apr 7, 2024. It is now read-only.

Latest commit

 

History

History
executable file
·
44 lines (28 loc) · 1.85 KB

DEBUG_INVALID_JSON.md

File metadata and controls

executable file
·
44 lines (28 loc) · 1.85 KB

Important

⚠ This is a public archive and the active project has been renamed to NetAlertX and moved: jokob.sk/NetAlertX

  • To differentiate from the upstream stale project
  • To differentiate from other active forks
  • To indicate this is not a Raspberry Pi-specific tool anymore

How to debug the Invalid JSON response error

Check the the HTTP response of the failing backend call by following these steps:

  • Open developer console in your browser (usually, e. g. for Chrome, key F12 on the keyboard).
  • Follow the steps in this screenshot:

F12DeveloperConsole

  • Copy the URL causing the error and enter it in the address bar of your browser directly and hit enter. The copied URLs could look something like this (notice the query strings at the end):

    • http://<pialert URL>:20211/api/table_devices.json?nocache=1704141103121
    • http://<pialert URL>:20211/php/server/devices.php?action=getDevicesTotals
    • http://<pialert URL>:20211/php/server/devices.php?action=getDevicesList&status=all
  • Post the error response in the existing issue thread on GitHub or create a new issue and include the redacted response of the failing query.

For reference, the above queries should return results in the following format:

First URL:

  • Should yield a valid JSON file

Second URL:

array

Third URL:

json

You can copy and paste any JSON result (result of the First and Third query) into an online JSON checker, such as this one to check if it's valid.