Can't login into gsad ("Network error: Unexpected token < in JSON at position 0")

GVM versions

gsa: Greenbone Security Assistant 20.08+alpha~git
gvm: Greenbone Vulnerability Manager 21.04+alpha
openvas-scanner: OpenVAS 21.4+beta1
gvm-libs: gvm-libs 21.4+beta1

Environment

Operating system: Debian 10.4
Kernel: Linux scannerM01 4.19.0-9-amd64 #1 SMP Debian 4.19.118-2 (2020-04-29) x86_64 GNU/Linux
Installation method / source: latest from repo, compiled and installed over previous versions. db migrated.

When I try to login into gsad I get failure with the mentioned message. Guessed the server is returning an error to the browser instead of the JSON.

Launched it with:

/opt/gvmb/sbin/gsad --listen 0.0.0.0 --port 8080 --http-only --drop-privileges=gvm --munix-socket=/opt/gvm/var/run/gvmd.sock

stracing it I got:

[pid 23083] recvfrom(6, “POST /selene/graphql/ HTTP/1.1\r\nHost: 195.22.17.13:8080\r\nConnection: keep-alive\r\nContent-Length: 281\r\naccept: /\r\nDNT: 1\r\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36\r\ncontent-type: application/json\r\nOrigin: http://195.22.17.13:8080\r\nReferer: http://195.22.17.13:8080/login\r\nAccept-Encoding: gzip, deflate\r\nAccept-Language: en,en-GB;q=0.9,en-US;q=0.8,pt-PT;q=0.7,pt;q=0.6,es;q=0.5,fr;q=0.4\r\nCookie: GSAD_SID=4d34cf27-8cf0-40e7-a75d-a52e05dab2b3\r\n\r\n{“operationName”:“login”,“variables”:{“username”:“admin”,“password”:”*********"},“query”:“mutation login($username: String!, $password: String!) {\n login(username: $username, password: $password) {\n ok\n locale\n sessionTimeout\n timezone\n __typename\n }\n}\n”}", 16384, 0, NULL, NULL) = 812
[pid 23083] setsockopt(6, SOL_TCP, TCP_NODELAY, [0], 4) = 0
[pid 23083] setsockopt(6, SOL_TCP, TCP_CORK, [1], 4) = 0
[pid 23083] sendto(6, “HTTP/1.1 406 Not Acceptable\r\nConnection: close\r\nContent-Length: 38\r\nContent-Security-Policy: default-src ‘self’ ‘unsafe-inline’; img-src ‘self’ blob:; frame-ancestors ‘self’\r\nX-Frame-Options: SAMEORIGIN\r\nPragma: no-cache\r\nCache-Control: no-cache, no-store\r\nExpires: -1\r\nContent-Type: text/html; charset=utf-8\r\nDate: Tue, 28 Jul 2020 14:00:47 GMT\r\n\r\n”, 349, MSG_NOSIGNAL, NULL, 0) = 349

So, the server isn’t liking something. Any ideas?
Before I upgraded my 7.0/11.0/9.0 installation I updated everything before gsad and it connected to gvmd without problems.

Sorry… just noticed myself I pulled the master branches
With the 20.08 I only get these warnings:

root@scannerM01:/opt/stage/gsa-gsa-20.08/build# make
Scanning dependencies of target gsa
[  5%] Install gsa js dependencies
yarn install v1.22.4
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info fsevents@2.1.2: The platform "linux" is incompatible with this module.
info "fsevents@2.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@1.2.9: The platform "linux" is incompatible with this module.
info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning " > babel-loader@8.1.0" has unmet peer dependency "webpack@>=2".
warning "react-scripts > @typescript-eslint/eslint-plugin > tsutils@3.17.1" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
warning " > eslint-config-prettier@6.11.0" has unmet peer dependency "eslint@>=3.14.1".
[5/5] Building fresh packages...
Done in 48.91s.
[ 11%] Build gsa install files
yarn run v1.22.4
$ react-scripts build
Creating an optimized production build...
Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade`
Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade`
Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade`

Yet, login works now.

I am also getting this error with ‘yarn upgrade’.

Which error do you mean?

can be ignored. And the initial error of this topic is caused by using the master branch of GSA. You should never use a development (e.g. master) branch. These branches aren’t stable and may break everytime.

1 Like