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 work76 Replies
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 directoryidk which supabase cli version is compatible with my
supabase/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
The latest version is 2.48.3
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 loginlet me try and get back to you
I'm able to login. Tried on wsl

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
For some reason its trying to use ipv6 address. Have you tried with SUPABASE_ACCESS_TOKEN env?
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"
I don't think npx reads env file by default.
Try running this way
like this:
npx supabase@latest link --project-ref
?No, the entire command

make sure to add your project ref at the end
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
do you have some supabase version installed locally in your node_modules folder?
try adding
@latest
after supabaseyeah I did , I have supabase version 2.0 in my package.json
yeah so its using that one
but I used @latest
Not sure why its resorting to local package then. Try setting version to 2.48.3 in your package.json
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.
No need to use older versions.
Try with 2.48.3. It should work
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'
Try removing node_modules folder, set version in your package.json file and then run npm install
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
You still need to run this command
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
'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
What version did you create this config file with?
.
lovable created it, thats what I am trying to figure out
If this config is not being used, you can create a new one
npx supabase init --yes --force
. --force will overwritebut I am afraid overwriting it would make lovable unable to edit my app
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
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?This is with link command?
yes
No, only the config.toml file

and if you run
npx supabase --version
you get 2.48.3?yes
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
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
.should I enter the db password at the end?
Yes you have to enter password
you didn't enter before?
Try this only if adding password doesn't work
I was told that I can skip it, and in the last command I thought it wasnt the cause of the problem
Initially when linking you will have to enter password
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
This is after you added password
it didnt show up this time
Try running the command again
same thing
maybe I should delete supabase/.temp ?
try it
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)Is your supabase instance active?
it seems there are network issues
Also make sure that the instance is healthy
you mean not paused?
yes and also healthy

if thats the case then yes

you mentioned earlier that it might be IP4/IP6 problem?
see if you can connect to your db from psql
You might need to install it first
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
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 addressfrom direct connection?
URI?
no, session pooler string. scroll down a bit

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
Do you have any special characters in db password?
nope
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 commandI used it for my current db password
And you did add the password in psql command?
yes
is the ip address supposed to be IP4 or IP6?

ipv4
for session and transaction pooler
brackets don't have be included in password
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=>
This isn't related to config.toml
Now you're able to connect to db
I think previously you added brackets in password
yeah I was able to connect after I made that change
no i didnt
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
alright I will continue tomorrow , Thank you very much for your help! i really appreciate it