• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FI 2.5.1 windows problem
#1
H_i 
,
I've one problem on a client running FI 2.5.1 on windows 10 1809.

I'm able to install the client but the agent dont sent any data to the server. 

If I manually run fusinintentory-agent.bat --dubug in a command prompt in admin mode I got:

C:\Program Files\FusionInventory-Agent\perl\bin>perl fusioninventory-agent --debug

Invalid string: [\xEF\xBF\xBD\xEF\xBF\xBD] before < ? x m l   v e r s i o n = " 1 . 0 "   e n c o d i n g = " u t f - 1 6 "   s t a n d a l o n e = " y e s " ? > at C:\Program Files\FusionInventory-Agent/perl/agent/FusionInventory/Agent/Task/Inventory/Win32/Softwares.pm line 478.

I've already reinstalled the sagent several tima and lowered the uac to the minimum level.

L.
  Reply
#2
Hi Lupick,

this seems to be a bug in our _getAppxPackages API which retrieves UWP/windows Store installed packages.

We apparently tries to read an appxmanifest.xml file encoded in UTF-16 and this fails while we tries to parse it on a stange first line.

We need this file to find how to by-pass this issue.

You should run the same Powershell script than the one run by the agent in an administrative shell:
Code:
[Windows.Management.Deployment.PackageManager,Windows.Management.Deployment,ContentType=WindowsRuntime] >$null

$packages = New-Object Windows.Management.Deployment.PackageManager

foreach ( $package in $packages.FindPackages() )
{
    # Check install state for each user and break if an installation is found
    $state = "Installed"
    foreach ( $user in $packages.FindUsers($package.Id.FullName) )
    {
        $state = $user.InstallState
        if ($user.InstallState -Like "Installed") {
            break
            $p = $packages.FindPackageForUser($user.UserSecurityId, $package.Id.FullName)
            if ($p.InstalledLocation.DateCreated -NotLike "") {
                $installedDate = $p.InstalledLocation.DateCreated
                break
            }
        }
    }
    if ($state -NotLike "Installed") { continue }

    # Use installeddate if found otherwise use installation folder creation date
    $installedDate = ""
    if ($package.InstalledDate -NotLike "") {
        $installedDate = $package.InstalledDate
    } elseif ($package.InstalledLocation.DateCreated -NotLike "") {
        $installedDate = $package.InstalledLocation.DateCreated
    }

    Write-host "NAME: $($package.Id.Name)"
    Write-host "PACKAGE: $($package.Id.FullName)"
    Write-host "ARCH: $($package.Id.Architecture.ToString().ToLowerInvariant())"
    Write-host "VERSION: $($package.Id.Version.Major).$($package.Id.Version.Minor).$($package.Id.Version.Build).$($package.Id.Version.Revision)"
    Write-host "FOLDER: $($package.InstalledLocation.Path)"
    if ($installedDate -NotLike "") {
        Write-host "INSTALLDATE: $($installedDate)"
    }
    Write-host "PUBLISHER: $($package.Id.Publisher)"
    Write-host "PUBLISHERID: $($package.Id.PublisherId)"
    Write-host "SYSTEM_CATEGORY: $($package.SignatureKind.ToString().ToLowerInvariant())"
    Write-Host
}

This will give you an output with some "Folder: xxx" entries. You need then to check any "appxmanifest.xml" file found on these paths. And then you should attach here the one starting with the text shown by the reported error.

If the related package is not used, you can firstly remove it to fix your problem. But we definitively need it to fix the issue in our code.
  Reply
#3
(2019-09-26, 12:41:08)gbougard Wrote: Hi Lupick,

this seems to be a bug in our _getAppxPackages API which retrieves UWP/windows Store installed packages....
 The client is a windows 10 LTSB and it doesnt have the UWP/store. I'll try to run the powershell and reprot the result.
  Reply
#4
I was able to run the script in powershell - admin mode and I got all installed app:

E.g

NAME: Microsoft.Todos
PACKAGE: Microsoft.Todos_2.1.22622.0_x64__8wekyb3d8bbwe
ARCH: x64
VERSION: 2.1.22622.0
FOLDER: C:\Program Files\WindowsApps\Microsoft.Todos_2.1.22622.0_x64__8wekyb3d8bbwe
INSTALLDATE: 09/26/2019 14:38:37 +02:00
PUBLISHER: CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
PUBLISHERID: 8wekyb3d8bbwe
SYSTEM_CATEGORY: store

NAME: Microsoft.Windows.Photos
PACKAGE: Microsoft.Windows.Photos_2019.19071.17920.0_x64__8wekyb3d8bbwe
ARCH: x64
VERSION: 2019.19071.17920.0
FOLDER: C:\Program Files\WindowsApps\Microsoft.Windows.Photos_2019.19071.17920.0_x64__8wekyb3d8bbwe
INSTALLDATE: 09/27/2019 07:52:44 +02:00
PUBLISHER: CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
PUBLISHERID: 8wekyb3d8bbwe
SYSTEM_CATEGORY: store

How I can redirect the output to a file?
  Reply
#5
Did you try to add the ">appx-list.txt" syntax at the end of the command launching the script ?

Btw, you should check for all appxmanifest.xml files in "C:\Program Files\WindowsApps" sub-folders which start by "<?xml version="1.0" encoding="utf-16" standalone="yes"?>". If you can attach one here, I'll be able to analyse how to handle it nicely in the code.
  Reply
#6
(2019-10-01, 07:47:11)gbougard Wrote: Did you try to add the ">appx-list.txt" syntax at the end of the command launching the script ?

Btw, you should check for all appxmanifest.xml files in "C:\Program Files\WindowsApps" sub-folders which start by "<?xml version="1.0" encoding="utf-16" standalone="yes"?>". If you can attach one here, I'll be able to analyse how to handle it nicely in the code.

I've already tried to run .\test.ps1 > test.txt 

the file is created empty (and the output is on the screen).

I've also trried 
.\test.ps1 2>&1> test.txt with the same problem
  Reply
#7
Then try:
Code:
.\test.ps1 > test.txt 2>&1
The redirections order is important.
  Reply
#8
(2019-10-03, 08:01:17)gbougard Wrote: Then try:
Code:
.\test.ps1 > test.txt 2>&1
The redirections order is important.
Unfortunally I got the same result:

 .\test.ps1 > test.txt 2>&1


but test.txt is still empty
  Reply
#9
Re-try after reading this powershell doc about redirection.
  Reply
#10
(2019-10-07, 13:25:20)gbougard Wrote: Re-try after reading this powershell doc about redirection.

Redirection problem solved 
test.ps1 *> test.txt 

did the trick

please take a look to the attached file.


Attached Files
.txt   test.txt (Size: 116.97 KB / Downloads: 4)
  Reply
#11
Your file is in UTF-16, this is not a problem as I manage to read it. But this suggests me maybe your computer has some language configuration involving some system files are encoded in UTF-16. What is your language configuration on the system ?

Can you check for "appxmanifest.xml" files under the FOLDERs reported in test.txt file ? Are they mostly in UTF-16 ? Can you attach one here so I can use it as test ?
  Reply
#12
(2019-10-14, 08:14:13)gbougard Wrote: Su archivo está en UTF-16, esto no es un problema ya que logré leerlo. Pero esto me indica qué tal vez su computadora tiene alguna configuración de idioma que involucra algunos archivos del sistema codificados en UTF-16. ¿Cuál es su configuración de idioma en el sistema?

¿Puede verificar si hay archivos "appxmanifest.xml" en las CARPETAS informadas en el archivo test.txt? ¿Están principalmente en UTF-16? ¿Puedes adjuntar uno aquí para que puedas usarlo como prueba?
Hola me pasa el mismo error solucionó solucionarlo, en mi caso el archivo muestra solo esta información:




En línea: 1 Carácter: 1

+. \ fusioninventory-agent.bat *> prueba.txt

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo: NotSpecified: (Cadena no válida: ... es.pm line 478.:String) [], RemoteException

    + FullyQualifiedErrorId: NativeCommandError


Carácter ancho en la impresión en C: \ Archivos de programa \ FusionInventory-Agent / perl / agent / FusionInventory / Agent / Logger / File.pm línea 58.


Attached Files
.txt   error.txt (Size: 1.4 KB / Downloads: 2)
  Reply
#13
I really need one of the "appxmanifest.xml" starting with a "<?xml version="1.0" encoding="utf-16" standalone="yes"?>" line so I can reproduce the problem and fix it in the right way.

You can also open an issue on our github repository to be sure we don't forget this case in the forum.
  Reply
#14
(2019-11-06, 08:46:15)gbougard Wrote: Realmente necesito una de las "appxmanifest.xml" comenzando con una línea "<? xml version =" 1.0 "encoding =" utf-16 "standalone =" yes "?>" para poder reproducir el problema y solucionarlo la direccion correcta.

También puede abrir un problema en nuestro repositorio de github para asegurarse de que no olvidemos este caso en el foro.
No tengo ningun archivo con esas lineas y todas estan en "utf-8".
  Reply
#15
Hola ya encontré uno de los archivos con la línea "<? Xml version =" 1.0 "encoding =" utf-16 "standalone =" yes "?>" Te agradezco mucho tu tiempo aca dejo el archivo si me puedes ayudar te lo agradeceria.

no me deja subir el archivo con "xml" por lo tanto lo cambie a "txt" para que sepas. Gracias


Attached Files
.txt   AppxManifest.txt (Size: 4.84 KB / Downloads: 6)
  Reply
#16
Is this the raw XML ? I mean did you copy/paste the content in a another text file or did you attach the file directly ?
The file seems to me to be valid and I don't have any error while parsing it.
I really need the raw file as I think it can contain specific encoding which make the parsing failing.
  Reply
#17
(2019-11-07, 09:54:49)gbougard Wrote: ¿Es este el XML sin procesar? Quiero decir, ¿copió / pegó el contenido en otro archivo de texto o adjuntó el archivo directamente?
El archivo me parece válido y no tengo ningún error al analizarlo.
Realmente necesito el archivo sin procesar, ya que creo que puede contener una codificación específica que hace que el análisis falle.
No me dejo adjuntar el archivo directamente, y si lo copie y pegue en un archivo de texto para poder subirlo al forum. (En la captura se muestra el mensaje cuando intento subir el AppxManifest.xml)
Yo ejecute el Script en powerShell y me de devolvio las carpetas en las cuales fui buscando uno a uno hasta encontrar el "AppxManifest.xml con el linea que mostraba el error", no entiendo como puedo sacar el XML sin procesar  Sad


Attached Files Thumbnail(s)
   
  Reply
#18
Did you try to put the file in a zip archive and attach the zip file ?
  Reply
#19
(2019-11-07, 17:46:22)gbougard Wrote: Did you try to put the file in a zip archive and attach the zip file ?
Logre adjuntarlo en una carpeta con el archivo XMl espero esta te sirva. nuevamente gracias por tu tiempo


Attached Files
.zip   AppxManifest.zip (Size: 2.27 KB / Downloads: 2)
  Reply
#20
Hi Lupick and Jhair Diaz,

can you try the following installer which is a 2.5.2 preview including a patch to fix your problem ?
fusioninventory-agent_windows-x64_2.5.x-develop-108.exe

As soon as you test and validate it I'll be able to include the patch for the coming 2.5.2 agent.

Thank you in advance.
  Reply
#21
Hi Lupick and Jhair Diaz,

did you make a test with fusioninventory-agent_windows-x64_2.5.x-develop-108.exe installer ?

Thank you
  Reply
#22
(2019-11-26, 13:42:46)gbougard Wrote: Hi Lupick and Jhair Diaz,

did you make a test with fusioninventory-agent_windows-x64_2.5.x-develop-108.exe installer ?

Thank you

Hi,

I had the same issue as above, tried the developer preview and it fixed it. I'm guessing you changed the default encoding to UTF-16 (?).

Cheers!
  Reply
#23
Hi Gungeonkeeper,

thank you for your feedback ! That's a good news someone confirm the problem is fixed.

And no, I didn't changed any default encoding. I found changing the used XML library involved a better XML support. That other library detects the file encoding and handle it as expected.
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)