Uploaded image for project: 'MusicBrainz Server'
  1. MusicBrainz Server
  2. MBS-6041

html5 validation: truncated json response

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • Beta
    • None
    • None
    • LWP 6.04, IO 1.25, Net-HTTP 6.05, perl 5.14.2

      With

      sub HTML_VALIDATOR = { 'http://html5.valdiator.nu/?out=json }
      

      in lib/DBDefs.pm (or another working validator.nu instance)

      Running

      SAVE_HTML=1 carton exec -Ilib -- prove -v t/tests.t :: --tests 'MusicBrainz::Server::Controller::Artist::Edit$'
      

      in my MusicBrainz VM (and also on rika) I get

      unexpected end of string while parsing JSON string,
      at character offset 24576 (before "(end of string)") at lib/MusicBrainz/Server/Test/HTML5.pm line 215.
      

      So that is at decode_json

      Using save_html to also save the json we get from http://html5.validator.nu/?out=json
      I can see that the file is only one line (normal for json) and it is indeed 24576 characters (a bit more bytes) long and stopping in the middle of a string.

      Using curl to post the html file I also saved works:

      curl -X POST -d @error115.html http://html5.validator.nu/?out=json --header "Content-Type: text/html"
      

      That gives a complete and valid json file (32 kB).

      EDIT:
      I forgot something important: On jenkins (ci.musicbrainz.org) HTML_VALIDATOR is set to "" (disabled), so this test is skipped. Otherwise this would possibly also fail on jenkins.

        1. error115.json
          24 kB
        2. error115.html
          32 kB
        3. error115_browser.json
          31 kB
        4. chunked.pl
          1 kB

            Unassigned Unassigned
            jonnyjd Johannes Dewender
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                Version Package