Uploaded image for project: 'translate5'
  1. translate5
  2. TRANSLATE-3882

Export of Project Fails due to XML Parser Problems

    XMLWordPrintable

Details

    • Critical
    • FIX: BUG with XML-Parser during Export

    Description

      The Export of a Task crashes, see https://jira.translate5.net/projects/TS/queues/custom/2/TS-3372 (URGENT!!)

       

      The Error presumably is caused because it is attempted to parse a segment (= fragment) with a file-parser, the Error in the Log says

       

      E1024 editor_Models_Import_FileParser_InvalidXMLException: Invalid XML: expected closing "ins" tag, but got tag "g".

       

      The Stack Trace for the Error is:

      File:
      /var/www/instances-local/instance-1021/application/modules/editor/Models/Import/FileParser/XmlParser.php (677)
      Request:
      https://translate5m.transline.de  cli://localhost/editor/index
      Trace:
      #0 /var/www/instances-local/instance-1021/application/modules/editor/Models/Import/FileParser/XmlParser.php(185): editor_Models_Import_FileParser_XmlParser->handleElementEnd()
      #1 /var/www/instances-local/instance-1021/application/modules/editor/Models/Import/FileParser/XmlParser.php(159): editor_Models_Import_FileParser_XmlParser->parseList()
      #2 /var/www/instances-local/instance-1021/application/modules/editor/Models/Export/FileParser/Sdlxliff.php(124): editor_Models_Import_FileParser_XmlParser->parse()
      #3 /var/www/instances-local/instance-1021/application/modules/editor/Models/Export/FileParser.php(358): editor_Models_Export_FileParser_Sdlxliff->parseSegment()
      #4 /var/www/instances-local/instance-1021/application/modules/editor/Models/Export/FileParser.php(252): editor_Models_Export_FileParser->getSegmentContent()
      #5 /var/www/instances-local/instance-1021/application/modules/editor/Models/Export/FileParser.php(196): editor_Models_Export_FileParser->parse()
      #6 /var/www/instances-local/instance-1021/application/modules/editor/Models/Export/FileParser/Sdlxliff.php(262): editor_Models_Export_FileParser->getFile()
      #7 /var/www/instances-local/instance-1021/application/modules/editor/Models/Export/FileParser.php(201): editor_Models_Export_FileParser_Sdlxliff->getFile()
      #8 /var/www/instances-local/instance-1021/application/modules/editor/Models/Export.php(136): editor_Models_Export_FileParser->saveFile()
      #9 /var/www/instances-local/instance-1021/application/modules/editor/Models/Export/Worker.php(123): editor_Models_Export->export()
      #10 /var/www/instances-local/instance-1021/library/ZfExtended/Worker/Abstract.php(386): editor_Models_Export_Worker->work()
      #11 /var/www/instances-local/instance-1021/library/ZfExtended/Worker/Abstract.php(330): ZfExtended_Worker_Abstract->_run()
      #12 /var/www/instances-local/instance-1021/Translate5/MaintenanceCli/Command/WorkerRunCommand.php(98): ZfExtended_Worker_Abstract->runQueued()
      #13 /var/www/instances-local/instance-1021/vendor/symfony/console/Command/Command.php(298): Translate5\MaintenanceCli\Command\WorkerRunCommand->execute()
      #14 /var/www/instances-local/instance-1021/vendor/symfony/console/Application.php(1040): Symfony\Component\Console\Command\Command->run()
      #15 /var/www/instances-local/instance-1021/vendor/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand()
      #16 /var/www/instances-local/instance-1021/vendor/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun()
      #17 /var/www/instances-local/instance-1021/Translate5/maintenance-cli.php(227): Symfony\Component\Console\Application->run()
      #18 {main}
       
      Extra:
      {
        "closingTag": "ins",
        "receivedTag": "g",
        "openingTag": Array
          (
              [openerKey] => 3
              [tag] => ins
              [attributes] => Array
              (
                  [class] => "trackchanges ownttip"
                  [data-usertrackingid] => 68324
                  [data-usercssnr] => "usernr1"
                  [data-workflowstep] => "reviewing1"
                  [data-timestamp] => "2024-04-10T22:56:24+02:00"
              )
              [isSingle] => 
              [preserveWhitespace] => 
          ),
          "parseStack": Array
          (
              [0] => Array
              (
                  [openerKey] => 1
                  [tag] => "g"
                  [attributes] => Array
                  (
                      [id] => 8946
                  )
                  [isSingle] => 
                  [preserveWhitespace] => 
              )
              [1] => Array
              (
                  [openerKey] => 3
                  [tag] => "ins"
                  [attributes] => Array
                  (
                      [class] => "trackchanges ownttip"
                      [data-usertrackingid] => 68324
                      [data-usercssnr] => "usernr1"
                      [data-workflowstep] => "reviewing1"
                      [data-timestamp] => "2024-04-10T22:56:24+02:00"
                  )
                  [isSingle] => 
                  [preserveWhitespace] => 
              )
          )
      } 

       

      According the captured Extra-Data the affected Segments are those two:

       segment id 29456096 

       <div class="open 672069643d223839343622 internal-tag ownttip"><span class="short" title="&lt;Highlight&gt;">&lt;1&gt;</span><span class="full" data-originalid="8946" data-length="-1">&lt;Highlight&gt;</span></div>Regolazione in <div class="term preferredTerm exact" title="" data-tbxid="2052633">funzione</div> della temperatura <ins class="trackchanges ownttip" data-usertrackingid="68324" data-usercssnr="usernr1" data-workflowstep="reviewing1" data-timestamp="2024-04-10T22:56:24+02:00">per singolo locale<div class="close 2f67 internal-tag ownttip"><span class="short" title="&lt;/Highlight&gt;">&lt;/1&gt;</span><span class="full" data-originalid="8946" data-length="-1">&lt;/Highlight&gt;</span></div></ins><del class="trackchanges ownttip deleted" data-usertrackingid="68324" data-usercssnr="usernr1" data-workflowstep="reviewing1" data-timestamp="2024-04-10T22:56:24+02:00">ambiente<div class="close 2f67 internal-tag ownttip"><span class="short" title="&lt;/Highlight&gt;">&lt;/1&gt;</span><span class="full" data-originalid="8946" data-length="-1">&lt;/Highlight&gt;</span></div> indipendente</del> e possibilità di impostare un <div class="open 672069643d223839343722 internal-tag ownttip"><span class="short" title="&lt;Highlight&gt;">&lt;2&gt;</span><span class="full" data-originalid="8947" data-length="-1">&lt;Highlight&gt;</span></div><div class="term preferredTerm exact" title="" data-tbxid="737384">programma orario</div> per ogni locale<div class="close 2f67 internal-tag ownttip"><span class="short" title="&lt;/Highlight&gt;">&lt;/2&gt;</span><span class="full" data-originalid="8947" data-length="-1">&lt;/Highlight&gt;</span></div> (richiede <div class="term preferredTerm stemmed" title="" data-tbxid="770363">l'app</div> <div class="single 782069643d226c6f636b6564313238353522207869643d226c6f636b54555f36663437393866362d343665622d343837322d393931322d653234383635346364323230222f internal-tag ownttip"><span class="short" title="&lt;g id=&quot;8948&quot;&gt;&lt;x id=&quot;8949&quot;/&gt;&lt;/g&gt;">&lt;locked3/&gt;</span><span class="full" data-originalid="locked12855" data-length="-1">&lt;g id=&quot;8948&quot;&gt;&lt;x id=&quot;8949&quot;/&gt;&lt;/g&gt;</span></div>) 

       

        segment id 29457528 

       <div class="open 672069643d223838373322 internal-tag ownttip"><span class="short" title="&lt;Highlight&gt;">&lt;1&gt;</span><span class="full" data-originalid="8873" data-length="-1">&lt;Highlight&gt;</span></div>Regolazione in <div class="term preferredTerm exact" title="" data-tbxid="2052633">funzione</div> della temperatura <ins class="trackchanges ownttip" data-usertrackingid="68324" data-usercssnr="usernr1" data-workflowstep="reviewing1" data-timestamp="2024-04-10T22:56:24+02:00">per singolo locale<div class="close 2f67 internal-tag ownttip"><span class="short" title="&lt;/Highlight&gt;">&lt;/1&gt;</span><span class="full" data-originalid="8873" data-length="-1">&lt;/Highlight&gt;</span></div></ins><del class="trackchanges ownttip deleted" data-usertrackingid="68324" data-usercssnr="usernr1" data-workflowstep="reviewing1" data-timestamp="2024-04-10T22:56:24+02:00">ambiente<div class="close 2f67 internal-tag ownttip"><span class="short" title="&lt;/Highlight&gt;">&lt;/1&gt;</span><span class="full" data-originalid="8946" data-length="-1">&lt;/Highlight&gt;</span></div> indipendente</del> e possibilità di impostare un <div class="open 672069643d223838373422 internal-tag ownttip"><span class="short" title="&lt;Highlight&gt;">&lt;2&gt;</span><span class="full" data-originalid="8874" data-length="-1">&lt;Highlight&gt;</span></div><div class="term preferredTerm exact" title="" data-tbxid="737384">programma orario</div> per ogni locale<div class="close 2f67 internal-tag ownttip"><span class="short" title="&lt;/Highlight&gt;">&lt;/2&gt;</span><span class="full" data-originalid="8874" data-length="-1">&lt;/Highlight&gt;</span></div> (richiede <div class="term preferredTerm stemmed" title="" data-tbxid="770363">l'app</div> <div class="single 782069643d226c6f636b6564313238333022207869643d226c6f636b54555f30356530393965352d623562342d343239612d626136312d346435636238303863636539222f internal-tag ownttip"><span class="short" title="&lt;g id=&quot;8875&quot;&gt;&lt;x id=&quot;8876&quot;/&gt;&lt;/g&gt;">&lt;locked3/&gt;</span><span class="full" data-originalid="locked12830" data-length="-1">&lt;g id=&quot;8875&quot;&gt;&lt;x id=&quot;8876&quot;/&gt;&lt;/g&gt;</span></div>) 

       

      To Export the Task, I had to remove all Trackchanges, I created a backup-table for the original segment-data, here is the executed SQL:

      CREATE TABLE `LEK_segment_data_task21671` LIKE `LEK_segment_data`;
      
      INSERT INTO `LEK_segment_data_task21671` (SELECT * FROM `LEK_segment_data` WHERE taskGuid = '{1ede5f51-d0ad-41b9-b91e-01a7a9c868a4}');
      
      UPDATE `LEK_segment_data` SET `edited` = REGEXP_REPLACE(REPLACE(`edited`, '</ins>', ''), '<ins[^>]*>', '') WHERE taskGuid = '{1ede5f51-d0ad-41b9-b91e-01a7a9c868a4}';
      
      UPDATE `LEK_segment_data` SET `edited` = REGEXP_REPLACE(`edited`, '<del.+?</del>', '') WHERE taskGuid = '{1ede5f51-d0ad-41b9-b91e-01a7a9c868a4}';
      

       

       

      Attachments

        Issue Links

          Activity

            People

              sanya@mittagqi.com Sanya Mikhliaiev
              axelbecher Axel Becher
              Axel Becher
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: