xTuple.com xTupleU Blog & News Customer Support

Project Accounting Issue

We recently upgraded from xTuple Manufacturing edition 3.8.3 to 4.4.0. In addition to this, we are also using an older version of the Project Accounting add-on (1.1.0). After the upgrade, we have been having 2 issues with the Project Accounting add on. When we go to tie an invoice to a project number, we would get an error whenever we tried to post an invoice. This issue was corrected by upgrading the Project Accounting package (now on 1.3.2).

However, we still had one outstanding issue. Whenever we try to look at project activity (CRM -> Reports -> Order Activity by Project…), we pick our project and hit query, and then get the following SQL error in the error log:

Thu Jun 21 11:08:31 2018 ERROR: schema “te” does not exist
LINE 123: LEFT OUTER JOIN te.teprjtask ON (prjtask_id = teprjtask_pr…
QPSQL: Unable to create query

In our database, this “te” schema does not exist, just as the above error indicates. When I restored a copy of the quickstart 4.4.0 database from xtuple.org, to my surprise, I noticed that this “te” schema actually existed already in the quickstart db. I went back to the earliest database copy i could find (3.8.4) and restored it, and found the same to be true there as well. I noticed there were other existing schemas that we do not have as well, but for what we need right now, the “te” schema is the important one. In our test environment, i went ahead and created the “te” schema, as well as all of it’s tables, functions, and other associated objects. When i did this, the error was resolved and Project Accounting was working as expected. My questions now are:

  1. Could there be a reason the “te” schema was not included with our xTuple install?

  2. Is simply creating the te schema, as well as its associated db objects the ideal solution to solve this?

There has got to be a reason that we don’t have this schema already, and I was just wondering if anyone had any insight as to why this could be. Thank you in advance!

It seems that the project accounting package makes an assumption about time & expense being installed. That schema is created by our T&E package. You can install it using our Updater application and the te-2.4.6.gz archive from here: https://github.com/xtuple/xtte/releases/tag/v2.4.6

Hi David, thanks for your reply. When I went to install the T&E package compatible with our version of xTuple (2.3.0) I received the following error:

I received the same error when I tried to install an earlier version as well. I was hoping maybe that it was an error in the install package itself, but that didn’t seem to be the case.

I also noticed that error value seems to increment up by a value of one each time i attempt to run the installer. I’m not sure what’s going on behind the scenes during this package install, but hopefully that’s a clue as to what could be going wrong here.

You are officially the second time I have seen this in the wild. Eventually the OID PostgreSQL generates for the new schema we try to create is larger than a standard integer could hold, and we had to update that function to support it. Apply this SQL to your database and it will deploy the fixed function, afterwards you should be able to install the T&E package.

Link to updated db function: https://raw.githubusercontent.com/xtuple/xtuple/1f7508c16a7afaa8bc9d2f71e60c75045843667e/foundation-database/public/functions/createpkgschema.sql

Sure enough, that did the trick! Once I updated the function, the T&E package installed without issue. Thank you for your assistance!