kaui with postgresql

462 views
Skip to first unread message

sirrush su

unread,
May 18, 2021, 5:37:29 AM5/18/21
to Kill Bill users mailing-list

Hey.

I'm having trouble connecting kaui with postgresql.
I've tried to set everything up with mariadb and it worked fine.
Then we decided to test killbill and kaui with postgresql and it looks like killbill part is working but kaui is having a bad time. It throws 500 error with the following message:

No such file to load -- java.lang.StackOverflowError: null.rb from org/jruby/RubyKernel.java:956

What could be the reason for such behavior?

I'm using CentOS 7.9.2009, apache-tomcat-8.5.66, kaui-standalone-2.0.5, killbill-profiles-killbill-0.22.21.

Pierre-Alexandre Meyer

unread,
May 18, 2021, 8:22:55 AM5/18/21
to sirrush su, Kill Bill users mailing-list
Hello,

Make sure to set -Dkaui.db.adapter=postgresql (KAUI_CONFIG_DAO_ADAPTER=postgresql in Docker) to enable PostgreSQL support in Kaui.

Hope this helps,

--
You received this message because you are subscribed to the Google Groups "Kill Bill users mailing-list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to killbilling-us...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/killbilling-users/fa7f66bd-c177-4bb6-9444-7967152bdfd5n%40googlegroups.com.


--
Pierre

sirrush su

unread,
May 18, 2021, 10:31:41 AM5/18/21
to Kill Bill users mailing-list
Hello.

I've added kaui.db.adapter=postgresql to my config file and then I was able to get the authentication dialog. However, when I entered default credentials, I've got "We're sorry, but something went wrong." error.
There are some errors in kaui.out, in particular this one:

KillBillClient::API::InternalServerError (<!doctype html><html lang="en"><head><title>HTTP Status 500 – Internal Server Error</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 500 – Internal Server Error</h1><hr class="line" /><p><b>Type</b> Exception Report</p><p><b>Message</b> org.skife.jdbi.v2.exceptions.UnableToExecuteStatementException: org.postgresql.util.PSQLException: ERROR: permission denied for sequence sessions_record_id_seq [statement:"create", located:"insert into sessions (</p><p><b>Description</b> The server encountered an unexpected condition that prevented it from fulfilling the request.</p><p><b>Exception</b></p><pre>javax.servlet.ServletException: org.skife.jdbi.v2.exceptions.UnableToExecuteStatementException: org.postgresql.util.PSQLException: ERROR: permission denied for sequence sessions_record_id_seq [statement:"create", located:"insert into sessions (
  id
, start_timestamp
, last_access_time
, timeout
, host
, session_data
) values (
  :id
, :startTimestamp
, :lastAccessTime
, :timeout
, :host
, :sessionData
);", rewritten:"insert into sessions (
  id
, start_timestamp
, last_access_time
, timeout
, host
, session_data
) values (
  ?
, ?
, ?
, ?
, ?
, ?
);", arguments:{ positional:{}, named:{recordId:null,sessionData:[-84, -19, 0, 5, 115, 114, 0, 17, 106, 97, 118, 97, 46, 117, 116, 105, 108, 46, 72, 97, 115, 104, 77, 97, 112, 5, 7, -38, -63, -61, 22, 96, -47, 3, 0, 2, 70, 0, 10, 108, 111, 97, 100, 70, 97, 99, 116, 111, 114, 73, 0, 9, 116, 104, 114, 101, 115, 104, 111, 108, 100, 120, 112, 63, 64, 0, 0, 0, 0, 0, 0, 119, 8, 0, 0, 0, 16, 0, 0, 0, 0, 120],lastAccessTime:DateTimeArgument{value=2021-05-18T14:23:49.210Z},host:'127.0.0.1',id:'524e57fc-4fb5-4b2f-b2dc-d91d40e2ca5c',class:class org.killbill.billing.util.security.shiro.dao.SessionModelDao,startTimestamp:DateTimeArgument{value=2021-05-18T14:23:49.210Z},timeout:3600000}, finder:[]}]

Is there something wrong with my postgresql configuration?

sirrush su

unread,
May 18, 2021, 11:23:41 AM5/18/21
to Kill Bill users mailing-list
Seems like I was able to fix this with extra "GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA killbillschema TO killbilluser;" on both killbill and kaui databases.
Thanks for your help.

Reshma Bidikar

unread,
May 18, 2021, 11:46:44 PM5/18/21
to Kill Bill users mailing-list
Hello Sirrush,

The steps for setting up PostgreSQL are explained in our development document - https://docs.killbill.io/latest/development.html#_configuring_the_database. Could you please try setting up the database using the steps given here and let us know if you are still facing issues?

Regards,
Reshma

sirrush su

unread,
May 19, 2021, 5:05:13 AM5/19/21
to Kill Bill users mailing-list
Hello Reshma,

But those steps are for the killbill. At first glance it looked like killbill and postgresql were working alright. At least it gave me the landing page (:8080/index.html one), I didn't try to use an actual api though. My problem was with the UI part.

I haven't found the part for postgresql and kaui explicitly so I just did everything like in the killbill + postgresql steps but replaced the database name with kaui like it was in the docs for mysql. However there was no mentioning of kaui.db.adapter=postgresql parameter, at least I haven't been able to find one. I also had to grant the same privileges on sequences as the ones that were granted  on tables in the docs for both killbill and kaui databases.

Just to clear things up, the setup with postgresql, killbill and kaui is working now after those extra bits I've described above.

Thank you for the help.

Reshma Bidikar

unread,
May 19, 2021, 11:46:28 PM5/19/21
to Kill Bill users mailing-list
Hello Sirrush,

Thanks for pointing this out. We will update the documents accordingly.

Regards,
Reshma

Franz Schöning

unread,
Apr 25, 2022, 6:07:03 AM4/25/22
to Kill Bill users mailing-list
Hi,

I am having similar problems. The postgres documentation is not yet updated for kaui use.

The first problem I had was that when creating all the tables in the killbillschema sql errors occurred when starting up the killbill container. The sql showed that the killbillschema was not being referenced, i.e. "SELECT table_name ..." was used and not "SELECT killbillschema.table_name ...". Once I loaded the tables into the public schema the error goes away.

There is no documentation that I could find on how to use postgres with kaui. I figured out the following steps through guesswork and reading this forum:
1. Execute the same ddl-postgres.sql file that was documented for the killbill database.
2. Then use the ddl.sql file from the mysql documentation to create the kaui database (also in the public schema).
3. The the magic sauce: for docker set 'KAUI_CONFIG_DAO_ADAPTER=postgresql' otherwise kaui looks for a mysql database.

At this point I am able to log into kaui with admin/password and create a new tenant user. I have not tried anything further to see if there are further problems yet.

@Reshma, it would be great of you could update the documentation as it is not at all clear and a lot of time wastage could be avoided for the next person trying this.

Thx,
Franz

Reshma Bidikar

unread,
Apr 25, 2022, 7:49:23 AM4/25/22
to Kill Bill users mailing-list
Hi Franz,

Thanks a lot for bringing this to our notice. We will update the docs at the earliest.

Regards,
Reshma

ibrahim dewaswala

unread,
May 24, 2022, 9:53:00 AM5/24/22
to Kill Bill users mailing-list
Hi Reshma,

By when can we expect updated docs?

Regards,
Ibrahim

Reshma Bidikar

unread,
May 25, 2022, 2:54:54 AM5/25/22
to Kill Bill users mailing-list
Hi Ibrahim,

Unfortunately, I do not have a timeline yet as to by when the docs will be updated, but I will post a message in this thread once they are updated. Meanwhile, could you follow the steps provided by some of the other users in this thread and see if that helps?

Regards,
Reshma

karan bansal

unread,
Jun 27, 2022, 1:32:35 PM6/27/22
to Kill Bill users mailing-list
Hi Ibrahim,

We have added the documentation for configuring PostgreSQL db with Killbill/Kaui here https://docs.killbill.io/latest/PostgreSQL.html

Please let me know if this helps.

Regards
Karan

Reply all
Reply to author
Forward
Message has been deleted
0 new messages