Page MenuHomePhabricator

Parsoid 0.1.15 generates 500 errors when editing pages
Closed, DeclinedPublic

Description

This site, https://wiki.transitionnetwork.org/ is running on amd64 Debian Wheezy with Parsoid installed using apt as per the instructions at https://www.mediawiki.org/wiki/Parsoid/Setup#Ubuntu_.2F_Debian_on_amd64

Today the new GPG siging key was installed and Parsoid updated (see https://trac.transitionnetwork.org/trac/ticket/692#comment:103 ) to version 0.1.15 and this has caused all edits using the VisualEditor to generate 500 errors, this is what is logged when you try to save a page:

[info][localhost/Sandbox2?oldid=946] started parsing
[fatal/request][localhost/Sandbox2?oldid=946] undefined is not a function
TypeError: undefined is not a function
    at TreeBuilder.resetState (/usr/lib/parsoid/src/lib/mediawiki.HTML5TreeBuilder.node.js:61:17)
    at new TreeBuilder (/usr/lib/parsoid/src/lib/mediawiki.HTML5TreeBuilder.node.js:28:7)
    at ParserPipelineFactory.makePipeline (/usr/lib/parsoid/src/lib/mediawiki.parser.js:231:17)
    at ParserPipelineFactory.makePipeline (/usr/lib/parsoid/src/lib/mediawiki.parser.js:227:17)
    at ParserPipelineFactory.getPipeline (/usr/lib/parsoid/src/lib/mediawiki.parser.js:363:15)
    at ParserPipelineFactory.parse (/usr/lib/parsoid/src/lib/mediawiki.parser.js:311:20)
    at /usr/lib/parsoid/node_modules/prfun/lib/index.js:436:24
    at new Promise (/usr/lib/parsoid/src/node_modules/es6-shim/es6-shim.js:1228:11)
    at /usr/lib/parsoid/node_modules/prfun/lib/index.js:419:14
    at /usr/lib/parsoid/src/api/routes.js:152:62

The error presented to editors is:

Error loading data from server: parsoidserver-http-bad-status: 500. Would you like to retry?

I have reverted to the old version of parsoid to get around this issue:

apt-get install parsoid=0.1.12

There are some more details on this ticket https://trac.transitionnetwork.org/trac/ticket/799


Version: unspecified
Severity: major
OS: Linux

Details

Reference
bz72304

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:53 AM
bzimport added a project: Parsoid.
bzimport set Reference to bz72304.

This sounds like it's caused by the silently-breaking-change made by one of the upstream npm modules – Parsoid team, could you advise?

Yes, looks to me like a conflict with the html5 library. I don't know much about our Debian packaging though.

gwicke: Any clue about the published debian package? Is this just a matter of updating the debian package?

Arlolra renamed this task from Parsoid 0.1.15 generates 500 errors when editing pages to Parsoid 0.1.12 generates 500 errors when editing pages.Nov 25 2014, 11:28 PM
Arlolra set Security to None.
Arlolra renamed this task from Parsoid 0.1.12 generates 500 errors when editing pages to Parsoid 0.1.15 generates 500 errors when editing pages.Nov 25 2014, 11:43 PM

The HTML5 library was updated in the deploy repo at the end of August, which was after the 0.1.12 deb release. I'm not sure if the deb packages that (@GWicke?) but did you try running npm install?

Arlolra triaged this task as High priority.

We just released v0.2.0 to both npm and the Debian repository. Could you check if this issue is fixed?

No change, switched to the latest version and when I tried to edit a page I got:

"Error loading data from server: parsoidserver-http-bad-status: 500. Would you like to retry?"

So I have reverted to the old version.

Is there anything else I could do to help debug this?

I built & tested the 0.2.0 package on sid. Could this perhaps be a wheezy-specific issue? Which node version are you running? There are 0.10 package available in backports: https://packages.debian.org/wheezy-backports/nodejs

We are generally running 0.10 these days, but used to support 0.8 until fairly recently.

This is with 0.10.29~dfsg-1~bpo70+1 on Wheezy, with nodejs/wheezy-backports and nodejs-legacy/wheezy-backports:

cat /etc/debian_version 
7.7

aptitude search node | grep ^i
i A nodejs                          - evented I/O for V8 javascript             
i   nodejs-legacy                   - evented I/O for V8 javascript (legacy syml

dpkg --print-avail nodejs
Package: nodejs
Priority: optional
Section: web
Installed-Size: 2811
Maintainer: Debian Javascript Maintainers <pkg-javascript-devel@lists.alioth.debian.org>
Architecture: amd64
Version: 0.10.29~dfsg-1~bpo70+1
Depends: libc-ares2 (>= 1.8.0), libc6 (>= 2.4), libgcc1 (>= 1:4.1.1), libssl1.0.0 (>= 1.0.1), libstdc++6 (>= 4.1.1), libv8-3.14.5, zlib1g (>= 1:1.1.4)
Size: 900744
Description: evented I/O for V8 javascript
 Node.js is a platform built on Chrome's JavaScript runtime for easily
 building fast, scalable network applications. Node.js uses an
 event-driven, non-blocking I/O model that makes it lightweight and
 efficient, perfect for data-intensive real-time applications that run
 across distributed devices.
 .
 Node.js is bundled with several useful libraries to handle server
 tasks:
 .
 System, Events, Standard I/O, Modules, Timers, Child Processes, POSIX,
 HTTP, Multipart Parsing, TCP, DNS, Assert, Path, URL, Query Strings.
Homepage: http://nodejs.org/

dpkg --print-avail nodejs-legacy
Package: nodejs-legacy
Priority: extra
Section: web
Installed-Size: 101
Maintainer: Debian Javascript Maintainers <pkg-javascript-devel@lists.alioth.debian.org>
Architecture: all
Source: nodejs
Version: 0.10.29~dfsg-1~bpo70+1
Depends: nodejs (>= 0.6.19~dfsg1-3~)
Conflicts: node
Size: 80428
Description: evented I/O for V8 javascript (legacy symlink)
 Node.js is a platform built on Chrome's JavaScript runtime for easily
 building fast, scalable network applications. Node.js uses an
 event-driven, non-blocking I/O model that makes it lightweight and
 efficient, perfect for data-intensive real-time applications that run
 across distributed devices.
 .
 This package contains a symlink for legacy Node.js code requiring
 binary to be /usr/bin/node (not /usr/bin/nodejs as provided in Debian).
 .
 No other Debian packages should depend on this package.  For more
 information, see
 <http://lists.debian.org/debian-devel-announce/2012/07/msg00002.html>
Homepage: http://nodejs.org/

dpkg -L nodejs | grep bin/
/usr/bin/nodejs

dpkg -L nodejs-legacy | grep bin/
/usr/bin/node

ls -lah /usr/bin/node
lrwxrwxrwx 1 root root 6 Aug  3 02:41 /usr/bin/node -> nodejs

ps -lA | grep node
5 S     0  2738     1  0  80   0 - 12885 -      ?        00:13:29 munin-node
0 S   110 28296 28294  0  80   0 - 150789 -     ?        00:00:00 nodejs
0 S   110 28298 28296  0  80   0 - 184463 -     ?        00:00:02 nodejs
0 S   110 28299 28296  0  80   0 - 163198 -     ?        00:00:00 nodejs

@ChrisC Is the error message still the same after a apt-get remove --purge parsoid followed by apt-get install parsoid?

Yes, I tried that and it didn't make a difference I'm afraid, anything else I could try?

ssastry lowered the priority of this task from High to Medium.Jan 31 2015, 1:19 AM

@ChrisC, I'm sadly a bit out of ideas. I haven't been able to reproduce this so far (but am running sid), and it seems to be working fine for most users. I would just put it down to wheezy, except that it's a JS error that would be specific to running old JS code.

Is your sources.list line matching the one recommended at https://www.mediawiki.org/wiki/Parsoid/Setup#Ubuntu_.2F_Debian_on_amd64 ?