System Error after installation of Web Client on clean machine


fetchtech25's picture


I'm currently attempting to evaluate PostBooks in our Soap Box environment. I used xtuple-admin-utility to setup PostBooks on a clean Ubuntu 14.04.05 Server in VMWare Workstation Player.

After I provisioned installpg93, provisioncluster, initdb, demodb, I was able to login using Windows GUI client and got prompted for Registration Key (we're still waiting for our key from the Key Master).

However, after I provisioned WebClient, I received a System Error (please see attached picture). I installed version 4.10 of the Demo database and used version 4.10 of the Windows GUI client.

"A System Error occured at login2.cpp::507:

Error: ReferenceError: XT is not defined

Detail: geteffectiveuser() LINE 7: if (!XT.username) {

CONTEXT: SQL statement "SELECT usr_id, userCanLogin(usr_username) AS usr_active

FROM usr

  WHERE (usr_username=getEffectiveXtUser())"

PL/pgSQL function login(boolean) line 26 at SQL statement


Are we required to activate registration key prior to provisioning for WebClient?

Please advise. Thanks.



xtuple-systemerror.jpg57.1 KB
fetchtech25's picture
Joined: 04/11/2017
FYI, we've received a

FYI, we've received a registration key from Key Master and we were able to login using the version of VM without WebClient setup. At this point, we're unsure what would happen if we do provision the box for WebClient.

ptyler's picture
Joined: 12/10/2008
Known plv8 bug


It looks like you're running into a known issue with the latest version of plv8 (ver. 1.4.9), which was released with this bug in it. The plv8 folks have fixed the bug and already issued a replacement version 1.4.10. You can either go back to plv8 version 1.4.8 or move on to 1.4.10, which appears to be available now.

To get the latest plv8 version, run

sudo apt-get update

sudo apt-get upgrade

Let us know if that fixes it for you.

Best regards,


ned's picture
Joined: 10/20/2008
Re: the web client

I've just written a tl;dr blog post that talks a bit about our technology journey... since you're the sort of person who seems to enjoy working with pre-release admin tools, you might find a few useful nuggets in there, especially as relates to the web client.



fetchtech25's picture
Joined: 04/11/2017
Thanks, Pierce and Ned for

Thanks, Pierce and Ned for your responses.

I've performed the apt-get update and upgrade, however, at this point in the repository, it appears that 1.4.9 is still the latest.

How would your suggestion be for me to either downgrade or upgrade to 1.4.8 or 1.4.10?

I tried specifying the version, but it says that the version was not found.

apt-get install postgresql-plv8=1.4.8


apt-cache showpkg postgresql-9.3-plv8 

...shows two versions, 1.4.9 and 1.4.0.

Is it acceptable to go back to 1.4.0? Thanks.

davidbeauchamp's picture
Joined: 07/20/2008
Package was added but not pushed to the apt database yet

Seems like they added the packages but have not updated the repo database yet. You can manually install 1.4.10 for now using one of the two commands, depending on if you are running 14.04 or 16.04:

Ubuntu 14.04:

wget "" && sudo dpkg -i "postgresql-9.3-plv8_1.4.10.ds-1.pgdg14.04+1_amd64.deb"

Ubuntu 16.04:

wget "" && sudo dpkg -i "postgresql-9.3-plv8_1.4.10.ds-1.pgdg16.04+1_amd64.deb"


fetchtech25's picture
Joined: 04/11/2017
David, thank you! I got

David, thank you! I got 1.4.10 installed and now it's working! 

Thanks again everyone for your help.

Best regards,


fetchtech25's picture
Joined: 04/11/2017
FYI, during Demo database

FYI, during Demo database restore, I noticed the following output in the console.

pg_restore: WARNING:  failed to find js function function "xt.js_init()" does not exist

I did not see such warning in the video that Mike Atherton posted here.

Also, I wanted to mention that the video must have been based on for the admin utility which does not assume values for variables such as:


Since the later version of defaulted the values above, I did not get prompted for those values.

Also, even after I cleared PGPASSWORD, I also did not get prompted to set postgres user password. Thus, I had to manually do it trough the menu in the tool.

Best regards,


bthompson's picture
Joined: 03/15/2012
Calvin, It is expected to see


It is expected to see that warning the first time you restore a database into an empty database. Your postgresql.conf file is configured to look for and execute that function. The first time you restore, that function does not exist, so you see the error. It is one of the first few functions created as the database is restored. Once it is there, the warning will go away.


fetchtech25's picture
Joined: 04/11/2017
Ben, Thank you for the


Thank you for the clarification!

Also, just curious, is it possible to run the web client without HTTPS? Just for giggles, I wanted to see the interaction between the client and server using Wireshark just to see how the GET/POST requests are posted to the server and how the server responds.

My attempt to get this done so far involved......

Modifying foundation.js to require "http": 

X.http         = require("http");

Modifying main.js to createServer using "http" and without sslOptions:

var server = X.http.createServer(app),

Modifying config.js to set the port to something other than 8443:

port: 3000,

Hitting the web client on the browser without using Nginx reverse proxy took me to the login page without HTTPS. Unfortunately, upon login, it simple looped me back to the login page. Perhaps the rest of server expected the protocol to be HTTPS?