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

Can't Run sqlx migrate run "permission denied" #268

Open
currenthandle opened this issue Oct 23, 2024 · 4 comments
Open

Can't Run sqlx migrate run "permission denied" #268

currenthandle opened this issue Oct 23, 2024 · 4 comments

Comments

@currenthandle
Copy link

5.4.6 One Last Push (zero2prod_20240903.pdf)

>  DATABASE_URL=MY-DIGITAL-OCEAN-DB-CONNECTION-STRING sqlx migrate run

error: while executing migrations: error returned from database: permission denied for schema public

My spec.yaml, essentially the same as the book and your repo.

It seems that the newsletter db user doesn't have the permissions to run the run a migration.

I'm also considered connecting to the db as doadmin or root but I don't have a password for doadmin or see anyway to (re)set it on Digital Ocean.

Any ideas why the newletter db user doesn't have the permissions to run a migration and how to resolve? Thanks!

@currenthandle currenthandle changed the title Error Running sqlx migrate run Can't Run sqlx migrate run "permission denied" Oct 24, 2024
@maciejSzcz
Copy link

I faced the same issue while completing this chapter, and what worked for me is downgrading the database to postgresql 14 (I had to destroy the old database on DigitalOceans platform before reapplying the spec.json)

@currenthandle
Copy link
Author

currenthandle commented Oct 25, 2024

@maciejSzcz thanks for your reply. Yeah I tried the same thing after referencing @LukeMathWalker 's spec.yaml in the root-chapter-5 branch.

spec.json? Do you mean spec.yaml? Would you mind linking me to your repo?

@maciejSzcz
Copy link

@currenthandle You are obviously right, js brain took over. https://github.com/maciejSzcz/rs-mailer here is my repo, but your spec seems to be the same

@currenthandle
Copy link
Author

Thanks! The only difference I see you and and the book have region: fra I have region: sfo3. Hard to believe this could be the issue, but maybe I should give France a try :)

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