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

Laravel project on Vercel with error: "Endpoint ID is not specified" (Postgres) #120

Closed
jornatf opened this issue May 5, 2023 · 9 comments

Comments

@jornatf
Copy link

jornatf commented May 5, 2023

I successfully deployed a Laravel project and I enabled Postgres on my project from Vercel. The variables have been set up automatically.

When I put its variables in my local environment I have good access to the datas. On the other hand on the deployed version I get 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=project%3D<endpoint-id>'.

This error caught by Laravel seems to come from the Neon API used by Vercel.

Someone has an idea ??

Thx,

Jordan

@tcc-sejohnson
Copy link
Collaborator

Sorry, I think we're going to need a reproduction to be able to help with this one.

@matheus-delazeri
Copy link

I'm having the same issue as @jornatf. The problem seems to be stated by Neon here: https://neon.tech/docs/connect/connectivity-issues.

Looking at vendor/laravel/framework/src/Illuminate/Database/Connectors/PostgresConnector.php in my Laravel project, I was unable to find a method to set the options required (project=<endpoint_id>) through database configuration (at config/database.php .

I've tried to set my DATABASE_URL env variable to the same pattern as mentioned in Neon's page:

postgres://<user>:<password>@my-endpoint-123456.us-east-2.aws.neon.tech/main?options=project%3Dmy-endpoint-123456

But still no success :(

@asispts
Copy link

asispts commented May 14, 2023

I have encountered the same issue when using Symfony. @tcc-sejohnson, do you still need a test repo?

@tcc-sejohnson
Copy link
Collaborator

Hey @asispts! Yeah, unfortunately I know very little about PHP. There's not much I can do without a repro. I'll ask around and see who we have internally that might be able to help as well.

@asispts
Copy link

asispts commented May 15, 2023

@tcc-sejohnson, here is the test repository: https://github.com/pts-archive/vercel-postgres-test

Let me know if you have any questions.

@tcc-sejohnson
Copy link
Collaborator

Yeah, this seems to be an issue with an outdated installation of libpq. It looks like you're going to have to either upgrade to a version that supports SNI or adjust your environment variables to provide a connection string compatible with your Postgres library. Googling the error took me to a pretty helpful Neon document: https://neon.tech/docs/connect/connectivity-issues

That should give you all the information you need to get going with a legacy client.

@asispts
Copy link

asispts commented May 15, 2023

Adding the options argument doesn't work, as @matheus-delazeri mentioned. Can Vercel team just upgrade the outdated libpq? I'm uncertain whether Symfony will support the passed argument.

@jornatf
Copy link
Author

jornatf commented May 15, 2023

Personally, I finally opted for another solution outside Vercel (MySQL) for my project...

@vvo
Copy link
Member

vvo commented Aug 25, 2023

This seems to be a vercel-php issue: vercel-community/php#458, let's continue the discussion here

@vvo vvo closed this as completed Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants