Unexpected token < in JSON at position 0

GVM versions

gsad: Greenbone Security Assistant 21.04.0~git-bc227c95b-master

gvmd: Greenbone Vulnerability Manager 21.4.0~dev1~git-2cf31ef28-master

openvas-scanner: OpenVAS 21.4.0~dev1~git-8befd17e-master

gvm-libs:
git-cloned from GitHub’s repo gvm-libs-20.08

Environment

Operating system: CentOS 8
Kernel: Linux vscan01 4.18.0-193.19.1.el8_2.x86_64 #1 SMP Mon Sep 14 14:37:00 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Installation method / source: From Source

Hi all,

I followed the instructions described here (thanks for this @caseybea)

but when I try to access GSAD, I get this error message:

Unexpected token < in JSON at position 0

Oddly enough, /opt/gvm/var/log/gvm/gsad.log shows:

gsad gmp:MESSAGE:2020-10-23 09h03.52 utc:223946: Authentication success for ‘admin’ from 1.2.3.4

Doing some research I found this article:

and they said that it was possible to login using version 20.08, which is the one I supposedly have used to do the installation on a fresh CentOS 8 server…

Am I overseeing the obvious?

Thanks in advance!

Best,
Martin

I just have to quote my answer from the linked discussion

1 Like

You have build the development / master versions, not the stable GVM-20.08 releases so the following comment should be valid as well:

Something must be wrong with links like this:

https://github.com/greenbone/gvm-libs/archive/v20.8.0.tar.gz

I specifically downloaded those… no idea as to why my GVM stuff shows 21.4.0 …

how can I clone the 20.08 branch then?

$ git clone --branch 20.08 https://github.com/greenbone/gvm-libs.git
Cloning into ‘gvm-libs’…
fatal: Remote branch 20.08 not found in upstream origin

At least that link is providing the correct gvm-libs-20.08 version and i highly doubt that github is shipping the wrong branches for such automatic generated archives.

It might be also possible that you had installed the gvm-21.04 components previously and if installing gvm-20.08 over the existing versions the 21.04 ones take precedence.

The correct branch is gvm-libs-20.08, not 20.08. See here for example:

https://github.com/greenbone/gvm-libs/branches

Hope this helps with installing the correct stable / non-development branches.

Sorry but you can’t have downloaded the release tarballs because your version includes a sha1 sum of a git commit. This won’t happen when build from a tarball.

Either clone the full repo and use git branch -r or check the branches URLs at GitHub e.g. Branches · greenbone/gsa · GitHub

1 Like

I took special care and downloaded each and every component following the same procedure so I ended up with several tar.gz files. I assumed that the contents were right and GVM etc would compile to the 20.08 version and not 21.4.0 …

Nope. This is a fresh server I create/destroy with Terraform and some Ansible playbooks, so there is no trace of GVM when I start the installation.

Thanks for the hint. I will try the whole process again using those branches now… wish me luck and patience :slight_smile:

FYI - in fact, using the 20.08 branch fixes the issue and it is possible now to access the GSAD web GUI.

Thanks and regards

1 Like