Skip to content

update_metrics fails with "permission denied for table ticket" even after importing trac.sql #2359

@ahmedasar00

Description

@ahmedasar00

Hi team,

I'm trying to set up the djangoproject.com project locally for development. After following the setup instructions, I successfully:

  • Created the code.djangoproject PostgreSQL database

  • Imported the Trac schema using:

                              psql -d code.djangoproject < tracdb/trac.sql
    
  • Configured secrets.json with valid credentials for both djangoproject and code.djangoproject database users

  • Verified that the ticket table exists in the code.djangoproject databa

    python manage.py update_metrics

Then i get the following error:

                   django.db.utils.ProgrammingError: permission denied for table ticket

I also tried granting explicit permissions to the database user:

                               GRANT SELECT ON TABLE ticket TO "code.djangoproject";

…but the issue persists.

The migrate command runs successfully with "No migrations to apply", so I believe the Django-side setup is correct.

Environment:

- OS: [e.g., Ubuntu 22.04]
- Python: 3.12
- PostgreSQL: [e.g., 14.12]

Could you please clarify:

  • What database user should be used for the trac database connection?
  • Are there additional permission steps needed after importing trac.sql?

Thanks for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions