This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-03-26
Channels
- # announcements (9)
- # babashka (36)
- # beginners (13)
- # biff (24)
- # calva (12)
- # clj-kondo (18)
- # clojure (65)
- # clojure-brasil (1)
- # clojure-europe (11)
- # clojure-nl (1)
- # clojure-norway (87)
- # clojure-uk (4)
- # clojurescript (28)
- # datahike (25)
- # fulcro (12)
- # hyperfiddle (16)
- # malli (74)
- # missionary (1)
- # music (2)
- # off-topic (24)
- # polylith (4)
- # releases (3)
- # tools-deps (23)
I am getting an error (`org.postgresql.util.PSQLException: SSL error: Remote host terminated the handshake` ) when deploying to http://fly.io using postgres. What could I be missing?
{:store {:backend :jdbc :dbtype "postgresql" :jdbcUrl "…."}}
deps are io.replikativ/datahike-jdbc {:mvn/version "0.3.47"}
, org.postgresql/postgresql {:mvn/version "42.7.3"}
, com.github.seancorfield/next.jdbc {:mvn/version "1.3.925"}
Things where working fine when using in-memory.
the build also logs Reflection warning, konserve_jdbc/core.clj:317:3 - reference to field close can't be resolved.
is that the issue?
Thanks in advance
Hey @U010L3S1XHS, that looks like an issue with your postgresql libs. You should probably try to connect to the fly.io-postgresql on the repl. This is not an obvious issue with datahike.
@U010L3S1XHS sometimes the provider requires SSL and the driver doesn't do so by default. A few years back I had a similar issue with DigitalOcean. Adding ?ssl-mode=REQUIRED
to the connection string helped me.
Thanks for your answer @U8KKDKPG8. I tried ssl-mode required and sslmode=disable
as set by http://fly.io but the same error still occurs.
@U4GEXTNGZ @U8KKDKPG8 do you know a way of using a connection pool like HikariDataSource with datahike-jdbc
?
http://fly.io seems to only support sslmode=disabled. adding a connection-pool without ssl might solve the problem, unless I misunderstand where the ssl error comes from.
Looking at the error there it seems to use c3p0 as connection pool and in datahike-jdbc it is a dependency: https://github.com/replikativ/konserve-jdbc/blob/main/deps.edn#L8
@U4GEXTNGZ yes good catch. thanks.
konserve-jdbc uses connection/uri->db-spec
internally which seems to ignore ?sslmode=disable
from the :jdbcUrl
. Can’t see how to propagate down this setting to disable ssl
@U010L3S1XHS lemme look into it. And cut you a new release
@U8KKDKPG8 amazing, thanks. please let me know what you find. happy to help.
I attached the standard postgres in my http://fly.io app during fly launch
. Do you mean that?
Yeah. Could you send me the simplest setup to get that started. I tried yesterday and I didn't see a click to deploy postgres
yes their cli. then fly auth signup
and fly launch
and they set you up, then fly deploy
. you can then do (System/getenv "DATABASE_URL")
to get the :jdbcUrl
https://fly.io/docs/hands-on/install-flyctl/
If needed I can send you my Dockerfile and build.clj, but no special magic should be needed.
Could you rather just send me the url to your instance? I went through all the steps but now to deploy I need to give add my cc and pay $5 and it's not pro-rata for my usage
@U8KKDKPG8 I message you
@U4GEXTNGZ here's the pull request when you're back from holiday: https://github.com/replikativ/konserve-jdbc/pull/21
Calling db-with
(or with
) sometimes breaks query on fresh db from @conn
, such as:
(d/q
'[:find [?e ...]
:where [?e :ts-entity.smith/id]]
@dev/db-conn)
; => [22 28 34 31 23 26 24 33 32 27 30 29 25]
(dh/db-with @dev/db-conn
[{:trade/id
"ts-entity.smith-bill-detail/128790"}])
(d/q
'[:find [?e ...]
:where [?e :ts-entity.smith/id]]
@dev/db-conn)
; => []
The example is from the system I'm working on; I'm still trying to isolate the problem on a fresh REPL but couldn't produce it so far. If I do release
and connect new conn
the query would work again. Not all tx-data to db-with
breaks it... Trying to see if anyone have any clue and can point me somewhere...These work for some reason...
(d/q
'[:find [?e ...]
:where
[?e ?a]
[?e :ts-entity.smith/id]]
@dev/db-conn)
;; => [22 28 34 31 23 26 24 33 32 27 30 29 25]
(d/q
'[:find [?e ...]
:where
[?e :ts-entity.smith/id]]
(map seq (d/datoms @dev/db-conn :eavt)))
;; => [22 28 34 31 23 26 24 33 32 27 30 29 25]
Hey @U02T2PJHNP4, never seen that problem. Thanks for posting. Maybe someone has an idea...
Thanks for reporting! That is strange and should not happen. Feel free to open an issue @U02T2PJHNP4.