Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

postgres in docker: column "limits_overrides" does not exist at character 142 #1756

Open
Henry-Gao-2004 opened this issue Jan 4, 2025 · 4 comments

Comments

@Henry-Gao-2004
Copy link

Describe the bug
I was running the newest version (built from the current source code), and the log in r2r postgres docker container says "column "limits_overrides" does not exist at character 142".

To Reproduce
Steps to reproduce the behavior:

  1. Change line 40 in compose.yaml to " image: r2r/new-release:latest"
  2. git clone the repo
  3. In cmd, "cd py"
  4. In cmd, "poetry install --all-extras"
  5. In cmd, "docker build -t r2r/new-release ."
  6. In cmd, "poetry run r2r serve --docker --config-name=local_llm"
  7. See error in Docker Desktop (r2r-postgres-1)

Expected behavior
Successfully start the r2r server

Log
2025-01-04 19:01:23 2025-01-04 11:01:23.163 UTC [6626] ERROR: column "limits_overrides" does not exist at character 142
2025-01-04 19:01:23 2025-01-04 11:01:23.163 UTC [6626] STATEMENT: SELECT id, email, hashed_password, is_superuser, is_active, is_verified, created_at, updated_at, name, profile_picture, bio, collection_ids, limits_overrides FROM r2r_default.users WHERE email = $1
2025-01-04 19:01:59 2025-01-04 11:01:59.394 UTC [6661] ERROR: column "limits_overrides" does not exist at character 142
2025-01-04 19:01:59 2025-01-04 11:01:59.394 UTC [6661] STATEMENT: SELECT id, email, hashed_password, is_superuser, is_active, is_verified, created_at, updated_at, name, profile_picture, bio, collection_ids, limits_overrides FROM r2r_default.users WHERE email = $1
2025-01-04 19:02:52 2025-01-04 11:02:52.469 UTC [6712] ERROR: column "limits_overrides" does not exist at character 142
2025-01-04 19:02:52 2025-01-04 11:02:52.469 UTC [6712] STATEMENT: SELECT id, email, hashed_password, is_superuser, is_active, is_verified, created_at, updated_at, name, profile_picture, bio, collection_ids, limits_overrides FROM r2r_default.users WHERE email = $1
2025-01-04 19:10:51 2025-01-04 11:10:51.003 UTC [6772] ERROR: column "limits_overrides" does not exist at character 142
2025-01-04 19:10:51 2025-01-04 11:10:51.003 UTC [6772] STATEMENT: SELECT id, email, hashed_password, is_superuser, is_active, is_verified, created_at, updated_at, name, profile_picture, bio, collection_ids, limits_overrides FROM r2r_default.users WHERE email = $1
2025-01-04 19:11:35 2025-01-04 11:11:35.287 UTC [6824] ERROR: column "limits_overrides" does not exist at character 142
2025-01-04 19:11:35 2025-01-04 11:11:35.287 UTC [6824] STATEMENT: SELECT id, email, hashed_password, is_superuser, is_active, is_verified, created_at, updated_at, name, profile_picture, bio, collection_ids, limits_overrides FROM r2r_default.users WHERE email = $1
2025-01-04 19:12:15 2025-01-04 11:12:15.255 UTC [6858] ERROR: column "limits_overrides" does not exist at character 142
2025-01-04 19:12:15 2025-01-04 11:12:15.255 UTC [6858] STATEMENT: SELECT id, email, hashed_password, is_superuser, is_active, is_verified, created_at, updated_at, name, profile_picture, bio, collection_ids, limits_overrides FROM r2r_default.users WHERE email = $1
2025-01-04 19:12:55 2025-01-04 11:12:55.246 UTC [6901] ERROR: column "limits_overrides" does not exist at character 142
2025-01-04 19:12:55 2025-01-04 11:12:55.246 UTC [6901] STATEMENT: SELECT id, email, hashed_password, is_superuser, is_active, is_verified, created_at, updated_at, name, profile_picture, bio, collection_ids, limits_overrides FROM r2r_default.users WHERE email = $1
2025-01-04 19:13:20 2025-01-04 11:13:20.767 UTC [27] LOG: checkpoint starting: time
2025-01-04 19:13:22 2025-01-04 11:13:22.428 UTC [27] LOG: checkpoint complete: wrote 17 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=1.610 s, sync=0.012 s, total=1.661 s; sync files=10, longest=0.007 s, average=0.002 s; distance=106 kB, estimate=149 kB; lsn=0/4FEC2320, redo lsn=0/4FEC22E8

Desktop (please complete the following information):

  • OS:Windows 11
@NolanTrem
Copy link
Collaborator

There's a migration script that needs to be run, there should some warnings that were raised, but you'll need to run r2r db upgrade

@Henry-Gao-2004
Copy link
Author

Thank you! Because I am running r2r on docker, postgres starts with r2r inside docker. If I run r2r db upgrade without r2r serve --docker, it says postgres is not running. After I do r2r serve --docker, the log says,
"Running database upgrade for schema default...
Using value for R2R_POSTGRES_HOST: localhost
Using value for R2R_POSTGRES_PORT: 5432
Using value for R2R_POSTGRES_DBNAME: postgres
Using value for R2R_POSTGRES_USER: postgres
Using value for R2R_POSTGRES_PASSWORD: postgres
Using value for R2R_PROJECT_NAME: r2r_default

Running command for schema: r2r_default
INFO [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO [alembic.runtime.migration] Will assume transactional DDL.
Error running migration command: Environment variable R2R_PROJECT_NAME must be provided migrate, it should be set equal to the value of project_name in your r2r.toml.
Database upgrade failed."

I checked r2r.toml and project_name is set to "r2r-default" (I cloned from git without change), so I am confused what goes wrong.

Thank you for your help!

@NolanTrem
Copy link
Collaborator

This process sounds correct—you'll want to start the docker as you have, and it's ok that the R2R container is failing for now.

You'll just need to export an environment variable equal to that which is in your config file.

'export R2R_PROJECT_NAME=r2r_default'

And then run the migration command again. There might be another variable you have the set, but the process is the same. Once the migration runs, the server will launch successfully. Let me know if that works!

@Henry-Gao-2004
Copy link
Author

Henry-Gao-2004 commented Jan 5, 2025

Thank you! It looks like setting the environment variable does not change the output.

Here is the log:
(venv) C:\User\tanzhen\R2R\py>setx R2R_PROJECT_NAME r2r_default

SUCCESS: Specified value was saved.

(venv) C:\User\tanzhen\R2R\py>poetry run r2r db upgrade
Running database upgrade for schema default...
Using value for R2R_POSTGRES_HOST: localhost
Using value for R2R_POSTGRES_PORT: 5432
Using value for R2R_POSTGRES_DBNAME: postgres
Using value for R2R_POSTGRES_USER: postgres
Using value for R2R_POSTGRES_PASSWORD: postgres
Using value for R2R_PROJECT_NAME: r2r_default

Running command for schema: r2r_default
INFO [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO [alembic.runtime.migration] Will assume transactional DDL.
Error running migration command: Environment variable R2R_PROJECT_NAME must be provided migrate, it should be set equal to the value of project_name in your r2r.toml.
Database upgrade failed.

I checked the environment variable and it is already updated.
image

Edit:
After setting the environment variable manually inside docker r2r-postgres-1, I run r2r db upgrade and the same error appears.
image
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants