jwills / buenavista

A Postgres Proxy Server in Python
Apache License 2.0
201 stars 20 forks source link

duckdb server example has startup issue: cannot drop entry "pg_database" because it is an internal system entry #2

Closed mskyttner closed 1 year ago

mskyttner commented 1 year ago

A container (see Dockerfile below) with official python 3.11.1 and buenavista installed complains with this message when started:

Using in-memory DuckDB database
Traceback (most recent call last):
  File "/src/buenavista/examples/duckdb_server.py", line 202, in <module>
    db.execute(
duckdb.CatalogException: Catalog Error: Cannot drop entry "pg_database" because it is an internal system entry

This issue can be replicated with this Dockerfile and running docker build -t buenavista . && docker run --rm buenavista:

# syntax=docker/dockerfile:1.4
FROM docker.io/python:3.11.1

ENV TZ=Europe/Stockholm
ENV DEBIAN_FRONTEND=noninteractive
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apt-get update -y && apt-get install -y --no-install-recommends \
    git

WORKDIR /src

# these seem to be requirements
RUN pip install duckdb pyarrow

RUN git clone --depth=1 https://github.com/jwills/buenavista.git 

WORKDIR /src/buenavista

CMD PYTHONPATH=. python3 examples/duckdb_server.py
jwills commented 1 year ago

Ah, some of my upstream changes have made their way into 0.6.1! Okay, will get it fixed up