You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2023-06-16 14:32:06

ComLu
Member
Registered: 2020-01-28
Posts: 65

"[error] [http client] Can't decode JSON content, starting with:"

GLPI 10.0.7
GLPI plugin 1.2.1
GLPI Agent 1.4

I'm getting:

[Fri Jun 16 14:06:47 2023][info] running task Deploy
[Fri Jun 16 14:06:47 2023][debug2] http:// glpi.mydomain.com/plugins/glpiinventory?action=getConfig&task[Deploy]=2.10&machineid=PC-USERNAME-2023-05-26-14-34-35
[Fri Jun 16 14:06:47 2023][error] [http client] Can't decode JSON content, starting with:
         

<!DOCTYPE html>
<html lang="it" >
<head>
   <title>Autenticazione - GLPI</title>

   <meta charset="utf-8" />
...


"Autenticazione - GLPI" is "GLPI - Authentication" so it's the login page.

p.s. I had to add a space after http:// because I can't post links

Last edited by ComLu (2023-06-16 14:32:54)

Offline

#2 2023-06-16 18:16:57

gbougard
Moderator
From: Montpellier, France
Registered: 2021-07-21
Posts: 537
Website

Re: "[error] [http client] Can't decode JSON content, starting with:"

Hi ComLu,

if you installed the GLPIInventory plugin from the marketplace, replace "plugins" by "marketplace" in your URL.


GLPI-Agent developer from Teclib' and GLPI-Network team
Previously FusionInventory-Agent maintainer

Offline

#3 2023-06-19 14:50:34

ComLu
Member
Registered: 2020-01-28
Posts: 65

Re: "[error] [http client] Can't decode JSON content, starting with:"

I didn't installed GLPIInventory from the markeplace, but I upgraded from the marketplace some other plugins that was not installed from the marketplace.

In any case I tried to change server key value to: http:// glpi.mydomain.com/marketplace/glpiinventory

but I'm still getting:

[Mon Jun 19 14:44:44 2023][debug2] http:// glpi.mydomain.com/marketplace/glpiinventory?action=getConfig&task[Collect]=2.8&machineid=PC-USERNAME-2023-05-26-14-34-35
[Mon Jun 19 14:44:44 2023][error] [http client] Can't decode JSON content, starting with: 
         

<!DOCTYPE html>
<html lang="it" >
<head>
   <title>Autenticazione - GLPI</title>

   <meta charset="utf-8" />
...

I have to try to install GLPI Inventory plugin 1.2.1 over the actual 1.2.1? of uninstall and re-install it? I'm going to lose configurations like, deploy packages, tasks, static/dynamic groups, etc?

Offline

#4 2023-06-19 16:10:51

gbougard
Moderator
From: Montpellier, France
Registered: 2021-07-21
Posts: 537
Website

Re: "[error] [http client] Can't decode JSON content, starting with:"

That's okay to use /plugins/glpiinventory in the server url if you installed the plugin manually in /plugins folder.

You should have a misconfiguration on http server side which prevent that URL to be served as expected. Check your Apache configuration.


GLPI-Agent developer from Teclib' and GLPI-Network team
Previously FusionInventory-Agent maintainer

Offline

#5 2023-06-21 14:25:35

ComLu
Member
Registered: 2020-01-28
Posts: 65

Re: "[error] [http client] Can't decode JSON content, starting with:"

Sysadmin is going to check file permissions and apache configuration.

Meanwhile my question is:
If we install GLPI Inventory plugin 1.2.1 over the actual 1.2.1? or uninstall and re-install it?
We are going to lose configurations like, deploy packages, tasks, static/dynamic groups, etc?

Offline

#6 2023-06-21 15:49:45

gbougard
Moderator
From: Montpellier, France
Registered: 2021-07-21
Posts: 537
Website

Re: "[error] [http client] Can't decode JSON content, starting with:"

As far I know:
- never uninstall the plugin or you will loose datas
- make a backup of /plugins/glpiinventory folder (just in case something goes wrong)
- move /plugins/glpiinventory folder under /marketplace folder

Or you can wait next release and install it from marketplace

Last edited by gbougard (2023-06-21 15:50:05)


GLPI-Agent developer from Teclib' and GLPI-Network team
Previously FusionInventory-Agent maintainer

Offline

#7 2023-06-22 11:58:32

ComLu
Member
Registered: 2020-01-28
Posts: 65

Re: "[error] [http client] Can't decode JSON content, starting with:"

Thank you gbougard,

installing the next release from the marketplace is going to break the connection with agents o it take care of the old server url "plugins" and redirect automatically to "marketplace"?
or we have to first deploy a registry change to the server registry key value?

Offline

#8 2023-06-22 12:24:46

gbougard
Moderator
From: Montpellier, France
Registered: 2021-07-21
Posts: 537
Website

Re: "[error] [http client] Can't decode JSON content, starting with:"

No, this is not automatically handled. So you'll have to update URL on agents after you move the folder from plugins to marketplace.
If you deploy a registry update, you'll have to wait the deploy job has been handled by all agents before switching the folder on server side. But you should probably reinstall agents using GPO with the final URL.


GLPI-Agent developer from Teclib' and GLPI-Network team
Previously FusionInventory-Agent maintainer

Offline

#9 2023-06-22 14:54:36

ComLu
Member
Registered: 2020-01-28
Posts: 65

Re: "[error] [http client] Can't decode JSON content, starting with:"

The main problem is that we don't have the possibility to deploy with GPO (no Active Directory), so in the first place we need to solve the deploy "[error] [http client] Can't decode JSON content, starting with:" issue.

I'm going to update this topic once resolved.

Offline

#10 2023-06-22 15:24:35

ComLu
Member
Registered: 2020-01-28
Posts: 65

Re: "[error] [http client] Can't decode JSON content, starting with:"

In our installation I can see in the dashboard:
"Web server root directory configuration is not safe as it permits access to non-public files. See installation documentation for more details."
is it possibile that this can prevent agents to do deploy?

AFAIK this warning is only about giving to much access and not restric it.

Offline

#11 2023-06-23 11:34:08

ComLu
Member
Registered: 2020-01-28
Posts: 65

Re: "[error] [http client] Can't decode JSON content, starting with:"

We noticed that if we call by web browser:

http://glpi/plugins/glpiinventory/index.php?action=getConfig&task[Collect]=2.8&machineid=PC-USERNAME-2023-05-26-14-34-35

expliciting index.php the browser replies with the json instead of the html login page.

So it seams that apache is not serving http://glpi/plugins/glpiinventory/ as http://glpi/plugins/glpiinventory/index.php

The strange thing is that the inventory is working without problem, only deploy doesn't.

our vhost config is:

<Directory "/var/www/htdocs/glpi">
   Options FollowSymLinks Includes
   Require all granted
   RewriteEngine On
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteRule ^(.*)$ index.php [QSA,L]
</Directory>

FollowSymLinks is needed for old fusion agents pointing to fusioninventory directory, as soon as the deploy is back to working we are going to change the server url in them.

With index.php explicited in "server" value the log is a bit different:

[Thu Jun 22 15:54:39 2023][debug] new thread 13 to handle task Deploy
[Thu Jun 22 15:54:39 2023][info] running task Deploy
[Thu Jun 22 15:54:39 2023][debug2] http://glpi/plugins/glpiinventory/index.php?action=getConfig&task[Deploy]=2.10&machineid=PC-USERNAME-2023-05-26-14-34-35
[Thu Jun 22 15:54:40 2023][debug] [http server] GET request /status from client 127.0.0.1
[Thu Jun 22 15:54:40 2023][debug] [http server] response status 200
[Thu Jun 22 15:54:40 2023][debug2] http://glpi/plugins/glpiinventory/b/deploy/?action=getJobs&machineid=PC-USERNAME-2023-05-26-14-34-35&version=2.10
[Thu Jun 22 15:54:40 2023][error] [http client] Can't decode JSON content, starting with: 
         

<!DOCTYPE html>
<html lang="it" >
<head>
   <title>Autenticazione - GLPI</title>

   <meta charset="utf-8" />
...
[Thu Jun 22 15:54:40 2023][debug] bad JSON: No answer from server.
[Thu Jun 22 15:54:40 2023][info] No Deploy job found in server jobs list.
[Thu Jun 22 15:54:41 2023][info] target server0: next run: Fri Jun 23 03:47:29 2023 - http://glpi/plugins/glpiinventory/index.php

as you can see the first call to http://glpi/plugins/glpiinventory/ (the one with getConfig) includes index.php the second one (with getJobs) is not and it gives the same error.

Last edited by ComLu (2023-06-23 11:35:35)

Offline

#12 2023-06-23 11:46:58

gbougard
Moderator
From: Montpellier, France
Registered: 2021-07-21
Posts: 537
Website

Re: "[error] [http client] Can't decode JSON content, starting with:"

Hi ComLu,

your problem here is you're forcing to insert index.php with the "RewriteRule ^(.*)$ index.php [QSA,L]" when the URL is not pointing to a file. Why using such a rule ? And where did you get it ?

If you want to keep it, you can add a condition to check if the url is not containing /plugins/glpiinventory and then reuse the server url as before as server configuration on agent side.

Last edited by gbougard (2023-06-23 11:48:39)


GLPI-Agent developer from Teclib' and GLPI-Network team
Previously FusionInventory-Agent maintainer

Offline

#13 2023-06-23 12:44:04

ComLu
Member
Registered: 2020-01-28
Posts: 65

Re: "[error] [http client] Can't decode JSON content, starting with:"

Isn't the configuration suggested here?
glpi-install.readthedocs.io/en/latest/prerequisites.html#apache-configuration

Offline

#14 2023-06-23 19:52:12

gbougard
Moderator
From: Montpellier, France
Registered: 2021-07-21
Posts: 537
Website

Re: "[error] [http client] Can't decode JSON content, starting with:"

This is a sample when using a public folder. And your configuration doesn't.
You probably can use it, but you'll probably have to tune it when using GlpiInventory plugin as it expects a less generic behavior from Apache.


GLPI-Agent developer from Teclib' and GLPI-Network team
Previously FusionInventory-Agent maintainer

Offline

#15 2023-07-13 14:20:56

ComLu
Member
Registered: 2020-01-28
Posts: 65

Re: "[error] [http client] Can't decode JSON content, starting with:"

sysadmin moved glpi to public folder and set htaccess accordly
problem solved

thank you gbougard

Offline

Board footer

Powered by FluxBB