Failed supabase integration 'Connection terminated unexpectedly'

Having run a few successful tests with Airtable integration, I decided to switch to Supabase as a data source for my app. Unfortunately, having sunk 4 hours into this problem, I was not successful in establishing the connection. I am stuck on the very first step of establishing integration. The error I get is ‘connection terminated unexpectedly’. At the same time on the supabase side I can see successful requests logged. Here is an example:

{
“headers”: [
{
“cf_cache_status”: “DYNAMIC”,
“cf_ray”: “877f2aa2925134de-DUB”,
“content_length”: “10”,
“content_location”: null,
“content_range”: null,
“content_type”: “application/json”,
“date”: “Sun, 21 Apr 2024 17:41:43 GMT”,
“sb_gateway_mode”: null,
“sb_gateway_version”: “1”,
“transfer_encoding”: null,
“x_kong_proxy_latency”: null,
“x_kong_upstream_latency”: null
}
],
“origin_time”: 110,
“status_code”: 200
}

What am I doing wrong? Why is Plasmic dropping the connection?

P.S. I have disabled RLS and checked and re-checked my password multiple times.

Hey welcome to the forum @alexander_eliseev!

Could you share more details about the error, such as a screenshot of the error, URL of the network request that you see in the browser, or a link to your Plasmic project to look at?

1 Like

Sure thing the project is Plasmic

And I attach the screenshots of the error (I tried two different inputs for db name)


And console info of the request:


P.S. I have tried to connect to Supabase via Postman and it worked like a charm.

Hm I think you’re not adding the integration correctly. Can you try following the directions here? Supabase integration | Learn Plasmic

Also just FYI, the console screenshot is not the correct request. The request URL should be something like https://data.plasmic.app.

Hey Jason, I followed the steps in the guide very closely (though not being an experienced developer or db administrator I could have messed something up). The Supabase interface has changed slightly compared to the guide with a few new options but I believe it is largely the same. Is there something in the data I shared above that makes you think I have not followed the instructions?

In your original screenshot, I think your database name may not be correct. It should be just postgres.

I suggest clicking the Copy button in your latest screenshot (with the password replaced) and paste it into the prompt for “Import from connection string” in Plasmic.

I see. Yes, I have tried both directly from the link (“postgres”) and with renaming. Neither works. Have just retried again to no avail. The worst part is that I can’t even get to anything resembling a detailed error code, just that the connection has terminated. Searching the network tab Chrome’s dev tools for “plasmic” returned nothing.

Hmm I’m really not sure what’s up with your Supabase instance. I just tested creating a fresh Supabase instance and was able to connect to it following the above steps. I would take a careful look around at your Supabase settings and see if anything seems off.

It is now solved.
I created a new Supabase DB from scratch and it worked. Weird, as I never played with any settings of the first DB I created. Everything was set to default.

The only configuration-related reason for the original DB not responding I can think of is the fact that I initially created tables with RLS enabled. I have disabled it upon reading your docs, but maybe there was a lingering config somewhere, preventing connection.

1 Like