S
Supabase6h ago
uri

Can't link my local project to cloud, help me troubleshoot

I'm trying to link my local project to supabase cloud but in this process I faced, and still facing, multiple issues: 1- I created my project in supabase cloud and successfully linked to my local project, but when I started the migration it complained a table had multiple primary keys (which it hadn't). I couldn't get how to solve it so I removed all migration files and generated one single migration file again. Tried again but complained "remote migrations versions not found in local migrations directory". So I decided to create a new project in supabase cloud and start fresh. 2- I create a new project in supabase cloud, in the germany server. Unlinked local supabase to the previous project and when trying to link to the new project I got this error:
failed to connect as temp role: failed to connect to `host=aws-1-eu-central-1.pooler.supabase.com user=cli_login_postgres.<my project id> database=postgres`: dial error (dial tcp 3.65.151.229:6543: connect: connection refused)
failed to connect as temp role: failed to connect to `host=aws-1-eu-central-1.pooler.supabase.com user=cli_login_postgres.<my project id> database=postgres`: dial error (dial tcp 3.65.151.229:6543: connect: connection refused)
tried multiple times in the span of an hour but nothing worked. Then I thought my login credentials might be wrong (since the connection is being refused), so with:
npx supabase login
npx supabase login
opened a new browser, introduced the code, and got a 404 error in the CLI. At this point I feel helpless and whatever I try supabase does not work.
5 Replies
LazyTitan
LazyTitan6h ago
Regarding the creating a new project, could be caused by their capacity issues: https://status.supabase.com/
Supabase Status
Welcome to Supabase's home for real-time and historical data on system performance.
garyaustin
garyaustin5h ago
So you seem to be using direct database connections with the supabase pooler. It is saying your user/role is named temp. Did you create such a postgres role as a login user? If not try with the postgres user role. Also when using the the pooler connections you have to use user.instanceid as the user name. See the connection guide at top of you project.
uri
uriOP4h ago
now it's not giving 404 and I can log in again thanks you for the reply.
Actually I'm a bit confused I was just trying to :
npx supabase link --project-ref myProjectId
npx supabase link --project-ref myProjectId
after being successfully logged (so the token is created) and since I was able to link with the previous project I assumed that the login step was enough. So I didn't create any user. I don't understand why I would need to createe a new user to use the cli, the connection guide refers to connecting directly to postgresql or connect my app to supabase which is not what I'm trying
garyaustin
garyaustin4h ago
Sorry, I thought you were linking a local project as in your app to your cloud project. You don't deal with the user in the CLI. Have to see if someone using CLI comes along with some ideas.
Can you use the dashboard for that project? Check the database status on the main project page.
uri
uriOP4h ago
Well somehow creating a new project in a US server worked and I could link the project without issue. Since I'm using this as a testing environment is not an issue and I guess my issue was related to the EU outage. However it might be an issue in the future when I move the project to prod. I'll mark the issue as solved, thank you for your assistance.

Did you find this page helpful?