Documentation

Import Fails with Invalid JSON

Resolve invalid JSON import errors caused by wrong files, broken exports, or server error pages.

Import Fails with Invalid JSON

If an import fails with an invalid JSON message, the uploaded file may not be a valid GoshLinks export file, or the server may have returned an HTML error page instead of JSON.

Check the File Type

GoshLinks imports use JSON files. Make sure the file you selected ends with .json.

Check the File Source

The file should come from one of these sources:

  • A GoshLinks export.
  • The GoshLinks YOURLS exporter plugin.

Check Whether the File Opens as JSON

Open the file in a text editor. A valid JSON file usually starts with { or [.

If it starts with HTML such as <p> or <html>, the file is not a valid export. It is probably an error page that was saved instead of JSON.

Upload Again

Go back to GoshLinks > Settings > Import and upload the file again.

The Import tab cleans up old temporary import files when opened, so starting fresh can help after an abandoned or failed upload.

Check Export Sections

If the file is a GoshLinks export, check that it contains the sections you want to import, such as links, clicks, settings, or help notes.

Common Causes

  • The wrong file was uploaded.
  • The export failed and downloaded an error page.
  • The file was edited and the JSON structure was broken.
  • The file was truncated during download or upload.