flatpak / flatpak

Linux application sandboxing and distribution framework
https://flatpak.org
GNU Lesser General Public License v2.1
4.27k stars 406 forks source link

[Bug]: "Could not parse XML data: Entity: line 1: parser error" when "flatpak search" #5897

Open stairclimber opened 3 months ago

stairclimber commented 3 months ago

Checklist

Flatpak version

1.14.6

What Linux distribution are you using?

Ubuntu

Linux distribution version

24.04 LTS (Noble Numbat)

What architecture are you using?

x86_64

How to reproduce

  1. flatpak search chrome
  2. you can see the error message as shown below
: Could not parse XML data: Entity: line 1: parser error : Start tag expected, '<' not found
�
^

找不到匹配项

Expected Behavior

search successfully

Actual Behavior

there are some error while searching.

Additional Information

No response

iconoclasthero commented 2 months ago
$ which flatpak; type flatpak; \flatpak search haproxy; \flatpak --version
/usr/bin/flatpak
/bin/flatpak
flatpak is hashed (/usr/bin/flatpak)
F: Could not parse XML data: Entity: line 252224: parser error : Input is not proper UTF-8, indicate encoding !
Bytes: 0xF0 0xA7 0xB0 0x20
      <p>Cheese এ আপোনা
                                   ^
Entity: line 252225: parser error : Char 0x0 out of allowed range
ৰস্ট অৱস্থা0ব্
                                      ^
Entity: line 252225: parser error : PCDATA invalid Char value 0
ৰস্ট অৱস্থা0ব্
                                      ^
Entity: line 252225: parser error : PCDATA invalid Char value 16
Ц
  ^
Entity: line 252225: parser error : PCDATA invalid Char value 16
     <p.অভ্যনЧ
^
Entity: line 252225: parser error : error parsing attribute name
     <p.অভ্যনЧ
                          ^
Entity: line 252225: parser error : internal error: xmlParseStartTag: problem parsing attributes

     <p.অভ্যনЧ
                          ^
Entity: line 252225: parser error : Couldn't find end of Start Tag p.অভ্যনЧ�তৠীকතাৱে line 252225
     <p.অভ্যনЧ
                          ^
Entity: line 252225: parser error : EntityRef: expecting ';'
     <p.অভ্যনЧ
                          ^
Entity: line 252225: parser error : PCDATA invalid Char value 27
     <p.অভ্যনЧ
                          ^
Entity: line 252225: parser error : Char 0x0 out of allowed range
Ц
  ^
Entity: line 252225: parser error : PCDATA invalid Char value 0
Ц
  ^
Entity: line 252225: parser error : Char 0x0 out of allowed range
Ц
  ^
Entity: line 252225: parser error : PCDATA invalid Char value 0
Ц
  ^
Entity: line 252225: parser error : Opening and ending tag mismatch: description line 252223 and p
যৰ সৈতে অংশীদাৰী কৰিব পাৰিব।</p>
                                                                               ^
Entity: line 252226: parser error : Opening and ending tag mismatch: component line 252033 and description
    </description>
                  ^
Entity: line 252229: parser error : PCDATA invalid Char value 16
     <pCheese 
^
Entity: line 252229: parser error : Couldn't find end of Start Tag p line 252229
     <pCheese 
        ^
Entity: line 252229: parser error : PCDATA invalid Char value 30
     <pCheese 
        ^
Entity: line 252229: parser error : StartTag: invalid element name
годНа, і дзял
                       ^
Entity: line 252229: parser error : PCDATA invalid Char value 15
годНа, і дзял
                       ^
Entity: line 252229: parser error : PCDATA invalid Char value 28
    /descri@tion>
    ^
Entity: line 252231: parser error : Char 0x0 out of allowed range
специални ефекти към тях и да ги споделите с
                                                                               ^
Entity: line 252231: parser error : PCDATA invalid Char value 0
специални ефекти към тях и да ги споделите с
                                                                               ^
Entity: line 252232: parser error : Specification mandates value for attribute ре�има0
0     <p.С ре
                ^
Entity: line 252232: parser error : attributes construct error
0     <p.С ре
                ^
Entity: line 252232: parser error : Couldn't find end of Start Tag p.С line 252232
0     <p.С ре
                ^
Entity: line 252232: parser error : PCDATA invalid Char value 16
ояване, Ча да имате вр
                                       ^
Entity: line 252232: parser error : ParsePI: PI p space expected
ме да за
              ^
Entity: line 252233: parser error : Char 0x0 out of allowed range

    ^
Entity: line 252233: parser error : ParsePI: PI p never end ...

    ^
Entity: line 252233: parser error : Char 0x0 out of allowed range

    ^
Entity: line 252233: parser error : PCDATA invalid Char value 0

    ^
Entity: line 252233: parser error : Char 0x0 out of allowed range
Reamer За пр
                ^
Entity: line 252233: parser error : PCDATA invalid Char value 0
Reamer За пр
                ^
Entity: line 252233: parser error : StartTag: invalid element name
шните си любимци — въобще каквото0ви щ
                                                                      ^
Entity: line 252233: parser error : Char 0x0 out of allowed range

^
Entity: line 252233: parser error : PCDATA invalid Char value 0

^
Entity: line 252233: parser error : expected '>'

^
Entity: line 252233: parser error : Opening and ending tag mismatch: description line 252230 and deCcriptio

^
Entity: line 252235: parser error : Char 0x0 out of allowed range

  ^
Entity: line 252235: parser error : PCDATA invalid Char value 0

  ^
Entity: line 252235: parser error : PCDATA invalid Char value 16
 জন
       ^
Entity: line 252235: parser error : expected '>'
ল
      ^
Entity: line 252235: parser error : PCDATA invalid Char value 30
ল
      ^
Entity: line 253093: parser error : Opening and ending tag mismatch: description line 252227 and component
  </component><component type="desktop-application">
              ^

No matches found
Flatpak 1.14.10
Rhino Linux rolling release based on 
OS: Rhino Linux 2024.2 (server) x86_64 
Kernel: Linux 6.10.7-061007-generic 
ItsAllPeachy commented 3 days ago

I had the same error, but i was able to find a fix. In my case, the problem was caused by the XDG_DATA_DIRS environment variable.

How i fixed it was: I tried searching flatpak through the kitty terminal, when it didn't work i tried it in the TTY. I noticed it worked flawlessly in the TTY. So i tried other terminals, and realised It also worked flawlessly in XTerm and Alacritty.

so in my case, i fixed it by adding this line to my kitty.conf file: env XDG_DATA_DIRS=$XDG_DATA_DIRS:/home/rosenrot/.local/share/flatpak/exports/share

If you have the same error in another terminal, then adding this line to your ~/.zshrc or ~/.bashrc file should do the trick: export XDG_DATA_DIRS=$XDG_DATA_DIRS:/home/rosenrot/.local/share/flatpak/exports/share

Hope this saves you some tears and trouble, have a great day!