microsoft / microsoft/vscode-pgsql

Cannot log in through socket

Open
#34 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement needs-verify
Dominant language
No language data
Stars
395
Forks
33
Avg merge
1h 46m
Merged PRs (30d)
3

Description

Describe the bug

Connecting through sockets allows for easy user-based authentication on shared servers. There is currently no documented way of connecting to a socket with the extension.

To Reproduce

Steps to reproduce the behavior:

  1. Configure posgres with socket authentication locally, e.g. the default on Ubuntu
  2. Create a new connection in the VS code extension
  3. Set the host to /var/run/postgresql, or set the connection string to "psql -h /var/run/postgresql/.s.PGSQL.5432"
  4. Click 'test'
  5. See error

Expected behavior

Connects locally through the socket found in /var/run/postgresql/.s.PGSQL.$port_number

Screenshots

Image

Error says: Connection error: connection is bad: could not parse network address "/var/run/postgresql": Name or service not known

VS Code version

Version: 1.100.2
Commit: 848b80aeb52026648a8ff9f7c45a9b0a80641e2e
Date: 2025-05-14T21:47:40.416Z (1 wk ago)
Electron: 34.5.1
ElectronBuildId: 11369351
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.5.0

Extension Logs

2025-05-23 15:57:50,986 INFO _ _ _
2025-05-23 15:57:50,986 INFO _ __ __ _ ___ __ | | | | ___ ___ | |___
2025-05-23 15:57:50,986 INFO | '_ \ / / __|/ _ | |_____| __/ _ \ / _ | / __|
2025-05-23 15:57:50,986 INFO | |
) | (| _ \ (| | |_____| || () | () | _ \
2025-05-23 15:57:50,986 INFO | ./ _, |/_, || __/ _/||/
2025-05-23 15:57:50,986 INFO |
| |
/ ||
2025-05-23 15:57:50,988 INFO Initialized ConnectionManager
2025-05-23 15:57:50,988 INFO Admin service successfully initialized
2025-05-23 15:57:50,988 INFO Language Service Operations Queue starting...
2025-05-23 15:57:50,988 INFO Metadata service successfully initialized
2025-05-23 15:57:50,988 INFO Object Explorer service successfully initialized
2025-05-23 15:57:50,988 INFO Query execution service successfully initialized
2025-05-23 15:57:50,988 INFO Scripting service successfully initialized
2025-05-23 15:57:50,988 INFO Edit data service successfully initialized
2025-05-23 15:57:50,989 INFO Chat service successfully initialized
2025-05-23 15:57:50,989 INFO tools successfully initialized
2025-05-23 15:57:50,989 INFO Schema Editor service successfully initialized
2025-05-23 15:57:50,989 INFO Starting JSONRPC message server.
2025-05-23 15:57:50,989 INFO JSONRPC input thread started.
2025-05-23 15:57:50,989 INFO JSONRPC output thread started.
2025-05-23 15:57:50,990 INFO Received request id=0 method=initialize
2025-05-23 15:57:50,994 INFO ResponseSuccess message sent id=0 method=None
2025-05-23 15:57:50,998 INFO Received notification method=initialized
2025-05-23 15:57:50,998 WARNING Notification method initialized is unsupported
2025-05-23 15:57:50,999 INFO Received notification method=workspace/didChangeConfiguration
2025-05-23 15:57:56,613 INFO Received notification method=$/setTraceNotification
2025-05-23 15:57:56,614 WARNING Notification method $/setTraceNotification is unsupported
2025-05-23 15:57:56,614 INFO Received notification method=workspace/didChangeConfiguration
2025-05-23 15:57:56,615 INFO Received request id=1 method=capabilities/list
2025-05-23 15:57:56,626 INFO ResponseSuccess message sent id=1 method=None
2025-05-23 16:01:06,558 INFO Received request id=2 method=connection/connect
2025-05-23 16:01:06,565 INFO Attempting to connect: owner_uri=[snipped]
2025-05-23 16:01:06,565 INFO Creating new connection pool for details_hash=9169922887297585895
2025-05-23 16:01:06,565 INFO ResponseSuccess message sent id=2 method=None

2025-05-23 16:24:53,017 ERROR Connection error for host=/var/run/postgresql/.s.PGSQL.5432 dbname=test user=test password=***** hostaddr=/var/run/postgresql connect_timeout=15 client_encoding=utf8 options='-h /var/run/postgresql' sslmode=disable port=5432: connection is bad: could not parse network address "/var/run/postgresql": Name or service not known

Add any other context about the problem here.

I'm using a remote connection from macOS to a server running Ubuntu

Contributor guide

No contributing guide indexed for this repository

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 by tracing the connection/connect request and connection-string handling shown in the extension logs. Reproduce the Ubuntu PostgreSQL socket case using /var/run/postgresql and the .s.PGSQL.5432 socket path. Done means the VS Code extension can test and establish a local socket-authenticated connection; no source file or test is named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, vscode
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.