tt_irc installation

I’ve been trying to install tt_irc for quite some time without success.

  • postgresql is up and running on port 5432 of 127.0.0.1
  • db was imported
  • postgresql user and password are valid
  • redis service is running
  • daemon-1.1.jar was compiled correctly and the config triple checked, but throws an error when executed:

java -jar /home/user/public_html/irc/daemon/target/daemon-1.1.jar

Data saved. Please use -configure to change it later.
May 05, 2020 8:24:21 PM org.fox.ttirc.Master lock
INFO: Lock acquired successfully (master.lock).
May 05, 2020 8:24:21 PM org.fox.ttirc.Master <init>
INFO: Establishing database connection (jdbc:postgresql://127.0.0.1:5432/ttirc_db)...
May 05, 2020 8:24:22 PM org.fox.ttirc.Master <init>
SEVERE: error: Couldn't connect to database.
org.postgresql.util.PSQLException: FATAL: Ident authentication failed for user "myvaliduser"
        at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:520)
        at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:141)
        at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:192)
        at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
        at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:195)
        at org.postgresql.Driver.makeConnection(Driver.java:458)
        at org.postgresql.Driver.connect(Driver.java:260)
        at java.sql.DriverManager.getConnection(DriverManager.java:664)
        at java.sql.DriverManager.getConnection(DriverManager.java:247)
        at org.fox.ttirc.Master.initConnection(Master.java:83)
        at org.fox.ttirc.Master.<init>(Master.java:222)
        at org.fox.ttirc.Master.main(Master.java:46)
        Suppressed: org.postgresql.util.PSQLException: FATAL: Ident authentication failed for user "myvaliduser"
                at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:520)
                at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:141)

Any idea of what can possible be wrong?

Thank you.

I am going to do with: you could not connect to the database because Ident authentication failed for user “myvaliduser”…

Maybe make sure that user can actually connect?

@Kierun, Yes, after struggling with PostgreSQL daunting authentication, I finally connected to the DB. I’m sure there must be easier ways to setup tt_irc. Thank you for point me on the right direction.

UPDATE: after installing everything and log in, I found tt_irc extremely disappointing:

  • Users cannot communicate with each other on the same room
  • Whatever you type is only visible after refreshing the page.

I love tt_rss but tt_irc is definitively a no go.

if there’s any interest i can probably cook up a docker-compose for tt-irc. host installation is absolutely unfriendly, no arguing with that.

at least you don’t have to run java on top of the whole thing now :slight_smile:

you’re likely running into eventstream-related issues, most probably caching. check for any errors in F12 console, especially when you type something in the channel.

e: fwiw i only ever tested eventstream with nginx, that is if you’re still using apache for some reason.

tt-irc is a no go for many reasons, mostly because you won’t be able to force normal people into using a self hosted chat instead of something like discord or facebook, but on the technical side everything that’s mentioned on tt-irc frontpage is implemented and does work, if you set it up correctly. i’m using it daily to chat with my friends.

@fox I appreciate your comment and I never meant to minimize your work, which I consider of high quality judging by tt_rss. I guess my expectations were high after using tt_rss and I felt a bit disappointed with tt_irc, nothing to serious and life goes on… Keep up with a good work :ok_hand: !

i’ve never bothered with making tt-irc easy to install because i know pretty much everyone who uses it personally so there really wasn’t any reason to :slight_smile:

if someone wants to take a look at how it works, i have a dev instance (in a VM) forwarded to the outside here: home.fakecake.org/tt-irc (login as test, ndjJ2kT6, channel #wtf)

and the important part in passing event streams through nginx is disabling its caches:

   location /tt-irc {
         proxy_set_header Host $host;
         proxy_pass  http://a.b.c.d:8080/tt-irc;

         proxy_buffering off;
         proxy_cache off;
   }

@fox I’ve used the vm instance of tt-irc and it work well, tks.
I’m using apache and not nginx. Is there a similar config that I can use on apache to disable cache?

i haven’t used apache for years so i dunno about that.

MDN doesn’t mention anything specific about server configuration, it seems they think that header("Cache-Control: no-cache"); (that tt-irc sets) should be enough.

there’s definitely one more thing needed for nginx (X-Accel-Buffering: no) so maybe there’s something for apache too.

A quick look at the developer console shows:

GET - /emoticons/emoticons.json.gz -> 404
POST - /backend.php -> 200:

  • {"status":"OK"}
  • [{"duplicate":true},[],{"duplicate":true},{"duplicate":true}]
    On both cases, what was typed isn’t displayed, only on page refresh.

The following XHR GET request takes a long time to complete and normally timeout:

  • /backend.php?op=evtsource&last_id=33&uniqid=5eb243a1c463d&bufsize=128

I’ve setup a test connection to freenode and the problem remains:

  • whatever I type needs a page refresh to be displayed.

I’ll make some changes to apache cache settings an I’ll post the result after. Tks!

UPDATE: The messages sent/received are displayed, but they take approximately 15 seconds to appear. Any idea how to reduce this latency?

yep that’s how event stream works, it runs on the server and pushes events as they arrive. ideally you allow it to idle for several minutes at a time (via PHP max_execution_time etc) to further decrease chat latency, i think my “production” setup has it at ~5 minutes or so.

there shouldn’t be any major latency even with an actual IRC connection. maybe 1 second or so. on instance (i.e. channels in Local) chats there should be no visible latency at all.

anyway,

  • if this happens on both local chats and freenode - you’re still running into Apache caching issues. i can’t help you with those, i’m afraid. you can try googling something like “server sent events apache caching” to maybe find the solution, if you do, please post it here. nobody uses apache these days though so unless you have a really specific legacy setup you might be better off switching to nginx anyway…

  • if this only happens with your freenode connection (and local chat works instantly), it could be something wrong with the java daemon specifically.

we don’t really use the java part (i’ve implemented local chatting specifically because we were all tired of IRC-specific limitations and unfixable - if minor - lag) but it should work. i’ve used it for a while recently with bitlbee, successfully.

e: try comparing developer console with the test instance i’ve linked above, you should see eventstream immediately pushing events to you as you send something to chat: