🏠 back to Observable

Local database connexion terminated unexpectedly

I’m testing the database connexion from a private notebook.

I’m new to postgrep but I think my db setup is ok since I can query the db locally without problem using a user account created for the occasion (observable) .

I installed yarn and the data-base proxy as suggested in https://observablehq.com/@observablehq/self-hosted-database-proxies and executed the following two cells client = DatabaseClient("obsdb") and names = client.query(``select * from courses``) with and without the ;.
Those instructions are from https://observablehq.com/@observablehq/connecting-to-databases?collection=@observablehq/introduction

The proxy is started but I get this error log

Error: Connection terminated unexpectedly
    at Connection.con.once (/home/observable/.config/yarn/global/node_modules/pg/lib/client.js:255:9)
    at Object.onceWrapper (events.js:277:13)
    at Connection.emit (events.js:189:13)
    at Connection.EventEmitter.emit (domain.js:441:20)
    at Socket.<anonymous> (/home/observable/.config/yarn/global/node_modules/pg/lib/connection.js:139:10)
    at Socket.emit (events.js:194:15)
    at Socket.EventEmitter.emit (domain.js:441:20)
    at endReadableNT (_stream_readable.js:1103:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)

Look’s like a js error. Maybe the proxy ? or my parameters ? How can I know ?
I running an up to date ubuntu 19.10

I already checked:

  • my postgrep password,
  • the my observable db settings.
  • the postgrep url postgresql://observable:password@127.0.0.1:2899/obsdb
  • the browser, I’m using chromium-browser… I have a doubt here…

maybe I need to open some ports localy…

Hi @maliky I am facing the same issue; did you finally get it solved?