CodeForPhilly / CodeForPhilly/balancer-main

Add comment with workaround for PostgreSQL crash with pgvector v0.6.1 on ARM64

Open
#382 1 comment 0 reactions 1 assignee Claimed by @sahilds1 View on GitHub
Bug
Dominant language
TypeScript
Stars
21
Forks
19
PR merge metrics
No merged PRs in 30d

Description

# Bug Report: PostgreSQL Segmentation Fault with pgvector v0.6.1 on ARM64

## Summary
PostgreSQL crashes with segmentation fault when executing vector similarity queries using pgvector v0.6.1 on ARM64 architecture causing chatbot functionality to fail.

## Environment
- **OS**: Linux (Docker container)
- **Architecture**: aarch64 (ARM64)
- **PostgreSQL Version**: 15.14
- **pgvector Version**: v0.6.1
- **Application**: Django backend with RAG embeddings feature

## Issue Description
The PostgreSQL database process terminates with signal 11 (segmentation fault) when executing vector similarity searches using the `<->` operator on embedding vectors.

## Error Details
```
2025-08-19 23:58:53.756 UTC [1] LOG: server process (PID 65) was terminated by signal 11: Segmentation fault
2025-08-19 23:58:53.756 UTC [1] DETAIL: Failed process was running: SELECT "api_embeddings"."id", ... ("api_embeddings"."embedding_sentence_transformers" <-> '[vector_data...]') AS "distance" FROM "api_embeddings"
```

## Reproduction Steps
1. Build custom PostgreSQL Docker image with pgvector v0.6.1 on ARM64
2. Execute vector similarity query using `<->` operator
3. Database crashes with segmentation fault

## Build Configuration
**Dockerfile**:
```dockerfile
FROM postgres:15
RUN apt-get update && apt-get install -y ca-certificates git build-essential postgresql-server-dev-15
RUN cd /tmp && git clone --branch v0.6.1 https://github.com/pgvector/pgvector.git && cd pgvector && make && make install
```

## Additional Context
- ARM64 compatibility warning observed: `Can't read MIDR_EL1 sysfs entry`
- PostgreSQL automatically recovers after crash
- Issue is specific to ARM64 architecture
- No issues reported on x86_64

## Root Cause
pgvector v0.6.1 has known stability issues with ARM64 processors, particularly affecting vector similarity operations.

## Solution
Replace custom PostgreSQL build with official pgvector image:

```yaml
services:
db:
image: pgvector/pgvector:pg15
# ... rest of configuration
```

## Status
**RESOLVED** - Using official pgvector Docker image eliminates segmentation faults and restores full functionality.

## Impact
- **Severity**: High (database crashes)
- **Scope**: ARM64 deployments using custom pgvector builds
- **Workaround**: Use official pgvector/pgvector:pg15 Docker image
- **Alternative**: Downgrade to pgvector v0.5.1 for custom builds

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.