r-dbi / r-dbi/RPostgres

Error in dbConnect(): linux socket location moved

Open
#564 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
343
Forks
82
Avg merge
11h 26m
Merged PRs (30d)
9

Description

I'm running Postgres 15 and the current CRAN RPostgres on debian 12.
When I do:

> con <- dbConnect(Postgres())

I get the following:

Error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such file or directory
        Is the server running locally and accepting connections on that socket?

I confirmed via psql that the database is running and accessible with current user.
Some poking around:
$ netstat -nlp | grep 5432
shows the socket at /var/run/postgresql/.s.PGSQL.5432

I was able to get a successful dbConnect() after doing:
$ ln -s /var/run/postgresql/.s.PGSQL.5432 /tmp

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the dbConnect(Postgres()) entry point and inspect how the default PostgreSQL Unix-socket location is selected on Debian 12. Reproduce with PostgreSQL 15 and compare the configured socket path with /var/run/postgresql; done means dbConnect(Postgres()) succeeds without creating a /tmp symlink.

Written by the indexing model from the issue text.

Assessment

Tech stack
debian, postgresql, r
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.