Supabase CLI error

when I try running this command npx supabase link --project-ref xxxxxxxxxxxx (I am using WSL) I get the following errors: Unknown config field: [db.enabled] Unknown config field: [realtime.port] Unknown config field: [storage.port] Unknown config field: [auth.port] Unknown config field: [auth.enable_email_confirmations] Unknown config field: [auth.enable_sms_confirmations] Unknown config field: [auth.enable_phone_signup] Unknown config field: [storage.s3] Unknown config field: [storage.s3.enabled] Unknown config field: [storage.s3.bucket] WARN: no seed files matched pattern: supabase/seed.sql failed to retrieve remote project status: Get "https://api.supabase.com/v1/projects/zne: failed to dial native: dial tcp [2606:4700:10::6814:1b91]:443: connect: network is unreachable and I couldnt login even tho I set the SUPABASE_ACCESS_TOKEN environment variable and tried loggining in from the web also I tried different supabase cli versions (>2) and that did not work
76 Replies
ihm40
ihm4022h ago
what version of the cli are you using? Also might be worth seeing which directory you are running npx supabase link --project-ref from as a previous user seemed to face the issue after running from the wrong directory
Elias Benmalti
Elias BenmaltiOP11h ago
idk which supabase cli version is compatible with mysupabase/config.toml file since it was generated by lovable I tried these versions: latest, 2.0, 2.2, 1.7, 1.9 I was able to link the project when i tried using the older versions but I am still getting these messages: Unknown config fields: [db.enabled realtime.port realtime.max_header_length storage.port auth.port auth.enable_email_confirmations auth.enable_sms_confirmations auth.enable_phone_signup storage.s3 storage.s3.enabled storage.s3.bucket] nter your database password (or leave blank to skip): Finished supabase link. Local config differs from linked project. Try updating supabase/config.toml [api] enabled = true port = 54321 schemas = ["public", "graphql_public"] extra_search_path = ["public", "extensions"] max_rows = 1000
inder
inder11h ago
The latest version is 2.48.3
Elias Benmalti
Elias BenmaltiOP11h ago
here is the config.toml file: project_id = "" [api] enabled = true port = 54321 schemas = ["public", "storage", "graphql_public"] extra_search_path = ["public", "extensions"] max_rows = 1000 [db] enabled = true port = 54322 shadow_port = 54320 major_version = 15 [db.pooler] enabled = false port = 54329 pool_mode = "transaction" default_pool_size = 20 max_client_conn = 100 [realtime] enabled = true ip_version = "IPv6" port = 54323 max_header_length = 4096 [studio] enabled = true port = 54323 api_url = "http://localhost:54321" [inbucket] enabled = true port = 54324 smtp_port = 54325 pop3_port = 54326 [storage] enabled = true port = 54327 file_size_limit = "50MiB" [auth] enabled = true port = 54328 site_url = "http://localhost:3000" additional_redirect_urls = ["https://localhost:3000"] jwt_expiry = 3600 enable_signup = true enable_email_confirmations = false enable_sms_confirmations = false enable_phone_signup = false [auth.email] enable_signup = true double_confirm_changes = true enable_confirmations = false # Configure S3 to use MinIO [storage.s3] enabled = false bucket = "stub" # Below are the default values # region = "local" # endpoint = "http://localhost:54327" # path_style = "http://l7/storage/v1/s3" # access_key_id = # secret_access_key = " [functions.generate-monthly-salaries] verify_jwt = false I know I tried it but I couldnt login
inder
inder11h ago
let me try and get back to you
inder
inder11h ago
I'm able to login. Tried on wsl
No description
Elias Benmalti
Elias BenmaltiOP11h ago
this is what I am getting: ~/algerian-essence-erp$ npx supabase@latest login Need to install the following packages: supabase@2.48.3 Ok to proceed? (y) y Hello from Supabase! Press Enter to open browser and login automatically. Enter your verification code: 8b9a021c failed to execute http request: Get "https://api.supabase.com/platform/cli/login/835d087f-9227-40da-a83e-739644706074?device_code=8b9a021c": dial tcp [2606:4700:10::ac42:95f6]:443: connect: network is unreachable Retry (1/2): Enter your verification code: 8b9a021c
inder
inder11h ago
For some reason its trying to use ipv6 address. Have you tried with SUPABASE_ACCESS_TOKEN env?
Elias Benmalti
Elias BenmaltiOP11h ago
i tried it,I will show you the results wait a sec its not picking it up for some reason I have it in my .env file SUPABASE_ACCESS_TOKEN="xxxxxxxxxxxxxxxxxxxx"
inder
inder11h ago
I don't think npx reads env file by default. Try running this way
SUPABASE_ACCESS_TOKEN=<YOUR_TOKEN_HERE> npx supabase link --project-ref
SUPABASE_ACCESS_TOKEN=<YOUR_TOKEN_HERE> npx supabase link --project-ref
Elias Benmalti
Elias BenmaltiOP11h ago
like this: npx supabase@latest link --project-ref ?
inder
inder11h ago
No, the entire command
No description
inder
inder11h ago
make sure to add your project ref at the end
Elias Benmalti
Elias BenmaltiOP11h ago
I get this error: failed to parse config: decoding failed due to the following error(s):
'db' has invalid keys: enabled 'realtime' has invalid keys: port 'storage' has invalid keys: port, s3 'auth' has invalid keys: enable_email_confirmations, enable_phone_signup, enable_sms_confirmations, port
inder
inder11h ago
do you have some supabase version installed locally in your node_modules folder? try adding @latest after supabase
Elias Benmalti
Elias BenmaltiOP11h ago
yeah I did , I have supabase version 2.0 in my package.json
inder
inder11h ago
yeah so its using that one
Elias Benmalti
Elias BenmaltiOP11h ago
but I used @latest
inder
inder11h ago
Not sure why its resorting to local package then. Try setting version to 2.48.3 in your package.json
Elias Benmalti
Elias BenmaltiOP11h ago
I tried version 1.99 and was able to login npx supabase@1.99 login Need to install the following packages: supabase@1.99.11 Ok to proceed? (y) y You can generate an access token from https://supabase.com/dashboard/account/tokens Enter your access token: Finished supabase login.
inder
inder11h ago
No need to use older versions. Try with 2.48.3. It should work
Elias Benmalti
Elias BenmaltiOP11h ago
I cant for some reason: npm install supabase@latest npm error code ENOTEMPTY npm error syscall rename npm error path /home/ilyes/algerian-essence-erp/node_modules/chownr npm error dest /home/ilyes/algerian-essence-erp/node_modules/.chownr-YW2wu4PB npm error errno -39 npm error ENOTEMPTY: directory not empty, rename '/home/ilyes/algerian-essence-erp/node_modules/chownr' -> '/home/ilyes/algerian-essence-erp/node_modules/.chownr-YW2wu4PB'
inder
inder10h ago
Try removing node_modules folder, set version in your package.json file and then run npm install
Elias Benmalti
Elias BenmaltiOP10h ago
npx supabase login Hello from Supabase! Press Enter to open browser and login automatically. Here is your login link in case browser did not open https://supabase.com/dashboard/cli/login? Enter your verification code: c5b69f39 failed to execute http request: Get "https://api.supabase.com/platdevice_code=c5b69f39": dial tcp [2606:4700:10::6814:1b91]:443: connect: network is unreachable
inder
inder10h ago
You still need to run this command
Elias Benmalti
Elias BenmaltiOP10h ago
SUPABASE_ACCESS_TOKEN=sbp_1d5b635c34bf8 npx supabase link --project-ref failed to parse config: decoding failed due to the following error(s):
'db' has invalid keys: enabled
'realtime' has invalid keys: port
'storage' has invalid keys: port, s3
'auth' has invalid keys: enable_email_confirmations, enable_phone_signup, enable_sms_confirmations, port as I said I think because the config.toml is incmpatible with the latest version
inder
inder10h ago
What version did you create this config file with?
Elias Benmalti
Elias BenmaltiOP10h ago
. lovable created it, thats what I am trying to figure out
inder
inder10h ago
If this config is not being used, you can create a new one npx supabase init --yes --force. --force will overwrite
Elias Benmalti
Elias BenmaltiOP10h ago
but I am afraid overwriting it would make lovable unable to edit my app
inder
inder10h ago
Then you can try commenting out the fields in config.toml which are causing issues For example: Error msg tells 'db' has invalid keys: enabled Just add a # at the beginning of the line
[db]
#enabled = true
[db]
#enabled = true
Elias Benmalti
Elias BenmaltiOP10h ago
the errors are gone but I am getting this instead: Initialising login role... failed to connect as temp role: failed to connect to host=aws-1-eu-west-3.pooler.supabase.com user=cli_login_postgres.zneisgqzui database=postgres: hostname resolving error (lookup aws-1-eu-west-3.pooler.supabase.com on 10.255.255.254:53: no such host) btw will npx supabase init overwrite the whole supabase folder?
inder
inder10h ago
This is with link command?
Elias Benmalti
Elias BenmaltiOP10h ago
yes
inder
inder10h ago
No, only the config.toml file
No description
inder
inder10h ago
and if you run npx supabase --version you get 2.48.3?
Elias Benmalti
Elias BenmaltiOP10h ago
yes
Elias Benmalti
Elias BenmaltiOP10h ago
Retry (7/8): failed to connect as temp role: failed to connect to host=aws-1-eu-west-3.pooler.supabase.com user=cli_login_postgres.database=postgres: hostname resolving error (lookup aws-1-eu-west-3.pooler.supabase.com on 10.255.255.254:53: no such host) Retry (8/8): Forgot your password? Reset it from the Dashboard: https://supabase.com/dashboard/project/zui/settings/database Enter your database password: Connecting to remote database... failed to connect to postgres: failed to connect to host=aws-1-eu-west-3.pooler.supabase.com user=postgres.zneisgqzgkflreauiwui database=postgres: failed SASL auth (FATAL: password authentication failed for user "postgres" (SQLSTATE 28P01)) Try rerunning the command with --debug to troubleshoot the error.
Supabase
Supabase Studio
inder
inder10h ago
Create a copy of your current config.toml file cp config.toml config.toml.backup and generate a new file using npx supabase init --yes.
Elias Benmalti
Elias BenmaltiOP10h ago
should I enter the db password at the end?
inder
inder10h ago
Yes you have to enter password you didn't enter before? Try this only if adding password doesn't work
Elias Benmalti
Elias BenmaltiOP10h ago
I was told that I can skip it, and in the last command I thought it wasnt the cause of the problem
inder
inder10h ago
Initially when linking you will have to enter password
Elias Benmalti
Elias BenmaltiOP10h ago
I am getting this error this time failed to retrieve remote project status: Get "https://api.supabase.com/v1/projects/zneisgqzgkflreauiwui": failed to dial native: dial tcp [2606:4700:10::ac42:95f6]:443: connect: network is unreachable
inder
inder10h ago
This is after you added password
Elias Benmalti
Elias BenmaltiOP10h ago
it didnt show up this time
inder
inder10h ago
Try running the command again
Elias Benmalti
Elias BenmaltiOP10h ago
same thing maybe I should delete supabase/.temp ?
inder
inder10h ago
try it
Elias Benmalti
Elias BenmaltiOP10h ago
I entered my db password but only got an error: failed to connect to postgres: failed to connect to host=aws-1-eu-west-3.pooler.supabase.com user=postgres.zneisgqzgkflreauiwui database=postgres: hostname resolving error (lookup aws-1-eu-west-3.pooler.supabase.com on 10.255.255.254:53: no such host)
inder
inder10h ago
Is your supabase instance active?
Elias Benmalti
Elias BenmaltiOP10h ago
it seems there are network issues
inder
inder10h ago
Also make sure that the instance is healthy
Elias Benmalti
Elias BenmaltiOP10h ago
you mean not paused?
inder
inder10h ago
yes and also healthy
No description
Elias Benmalti
Elias BenmaltiOP10h ago
if thats the case then yes
Elias Benmalti
Elias BenmaltiOP10h ago
No description
Elias Benmalti
Elias BenmaltiOP10h ago
you mentioned earlier that it might be IP4/IP6 problem?
inder
inder10h ago
see if you can connect to your db from psql You might need to install it first
sudo apt install -y postgresql-client
sudo apt install -y postgresql-client
Get connection string from your dashboard. Click on Connect in dashboard navbar and copy Session pooler connection string. You'll need to add your password in the string
psql --dbname='CONNECTION_STRING_YOU_COPIED'
psql --dbname='CONNECTION_STRING_YOU_COPIED'
When you saw this error msg failed to dial native: dial tcp [2606:4700:10::ac42:95f6]:443: connect: network is unreachable This was cli trying to connect to IPV6 address
Elias Benmalti
Elias BenmaltiOP10h ago
from direct connection? URI?
inder
inder10h ago
no, session pooler string. scroll down a bit
inder
inder10h ago
No description
Elias Benmalti
Elias BenmaltiOP10h ago
psql --dbname='postgresql://postgres.:@aws-1-eu-west-3.pooler.supabase.com:5432/postgres' psql: error: connection to server at "aws-1-eu-west-3.pooler.supabase.com" (35.181.159.10), port 5432 failed: duplicate SASL authentication request
inder
inder9h ago
Do you have any special characters in db password?
Elias Benmalti
Elias BenmaltiOP9h ago
nope
inder
inder9h ago
Still reset the password just to be sure because this error usually occurs because of special chars in password. There is a Generate a password button, use that and copy the password https://supabase.com/dashboard/project/_/database/settings use the updated password in psql command
Elias Benmalti
Elias BenmaltiOP9h ago
I used it for my current db password
inder
inder9h ago
And you did add the password in psql command?
Elias Benmalti
Elias BenmaltiOP9h ago
yes is the ip address supposed to be IP4 or IP6?
inder
inder9h ago
No description
inder
inder9h ago
ipv4 for session and transaction pooler brackets don't have be included in password
Elias Benmalti
Elias BenmaltiOP9h ago
i changed IP6 to IP4 in [realtime] config.toml file then got this: psql --dbname='postgresql://postgres.znisui:19Vzk@aws-1-eu-west-3.pooler.supabase.com:5432/postgres' psql (16.10 (Ubuntu 16.10-0ubuntu0.24.04.1), server 17.4) WARNING: psql major version 16, server major version 17. Some psql features might not work. SSL connection (protocol: TLSv1.3, cipher: TLS_GCM_SHA384, compression: off) Type "help" for help. postgres=>
inder
inder9h ago
This isn't related to config.toml Now you're able to connect to db I think previously you added brackets in password
Elias Benmalti
Elias BenmaltiOP9h ago
yeah I was able to connect after I made that change no i didnt
inder
inder9h ago
nope, its because of brackets removed from password this config.toml isn't even used for this step psql is a different program This was used just to confirm that the db is accesible because you were getting errors hostname not found
Elias Benmalti
Elias BenmaltiOP9h ago
alright I will continue tomorrow , Thank you very much for your help! i really appreciate it

Did you find this page helpful?