N
Neon2y ago
ambitious-aqua

Endpoint ID is not specified!!!

Hi all! I need help connecting to neon db from my laravel project please 😢 I'm facing this error: SQLSTATE[08006] [7] ERROR: Endpoint ID is not specified. Either please upgrade the postgres client library (libpq) for SNI support or pass the endpoint ID (first part of the domain name) as a parameter: '?options=endpoint%3D<endpoint-id>'. See more at https://neon.tech/sni And I tried the following solution but it didn't work .env: DB_PASSWORD=endpoint=endpoint$passowrd then i tried this and it didn't work as well: // 'options' => extension_loaded('pdo_pgsql') ? array_filter([ // PDO::ATTR_PERSISTENT => true, // PDO::ATTR_EMULATE_PREPARES => true, // PDO::ATTR_STRINGIFY_FETCHES => true, // PDO::PGSQL_ATTR_DISABLE_PREPARES => true, // 'options' => 'endpoint%3D' . env('DB_OPTIONS') // ]) : [], (I specified DB_OPTIONS in the .env)
4 Replies
harsh-harlequin
harsh-harlequin2y ago
It looks like you added the endpoint ID to your password in env? That doesn't seem right to me. Maybe it should look more like the example at this URL? https://stackoverflow.com/questions/77367792/laravel-vercel-postgress-error-error-endpoint-id-is-not-specified I think the options should be formatted without the encoded = symbol. Something more like:
// Replace the ep-jolly-hill-a7am8n2y with your endpoint from
// your connection string
endpoint=ep-jolly-hill-a7am8n2y
// Replace the ep-jolly-hill-a7am8n2y with your endpoint from
// your connection string
endpoint=ep-jolly-hill-a7am8n2y
Stack Overflow
Laravel + Vercel Postgress error (ERROR: Endpoint ID is not specifi...
I'm building a private application based on Laravel 10.x now deployed also on Vercel using headless php and the Vercel postgress database. I'm having issues with the DB connection. Database Error T...
ambitious-aqua
ambitious-aquaOP2y ago
Heyy and thank you for your reply. I managed to successfully fix the issue - turns out I needed to use the php artisan cache:clear more than once. Now though, I'm facing a different issue. I'm able to successfully fetch the data from the db, but I'm unable to write anything to it. I'm getting this error: Read only sql transaction: 7 ERROR: cannot execute INSERT in a read-only transaction Although the same credentials are being used on a macOS laptop (the error is on a Windows 11 OS) and the post action is working normally there. Any suggestion on what's the case here?
harsh-harlequin
harsh-harlequin2y ago
Double check the credentials. It's likely that you're using different credentials, connecting to a read replica (https://neon.tech/docs/introduction/read-replicas), or perhaps you've somehow changed default_transaction_read_only or set transaction read write; (I've never tested tested with Neon)
ambitious-aqua
ambitious-aquaOP2y ago
Thank you a lot. I will check it soon and let you know if I was able to fix it

Did you find this page helpful?