supabase-on-aws icon indicating copy to clipboard operation
supabase-on-aws copied to clipboard

Launch Stack doesn't create "working" stack

Open r00t-us3r opened this issue 2 years ago • 13 comments

Bug report

Describe the bug

I believe this is something relating to the "NamespaceName" parameter that makes all the services link up using an internal dns name. Without any further documentation inside this repository I'm unsure whether this is the case.

Once the stack is finished launching, when accessing the project from inside Supabase Studio it gets stuck "Connecting to project"

When checking the network tab from chrome dev tools, a number of errors are indicated - 404, 503 (see screenshots)

For the 503 error, when manually accessing the url with the api key specified as a url parameter it returns a JSON response {"message":"no Route matched with those values"}

To Reproduce

  1. Open the README.md
  2. Click on "Launch Stack"
    • I have tried both "Stable" & "Latest" for "N. Virginia" & "Ireland"
  3. Scroll down to the bottom on the CloudFormation Stack create page
  4. Check the "Acknowledge" boxes
  5. Click "Create Stack"

Expected behavior

A fully functioning stack of the supabase system to be launched and usable / accessible.

Screenshots

Screen Shot 2022-12-25 at 21 43 16

Screen Shot 2022-12-25 at 21 43 29

Screen Shot 2022-12-25 at 21 44 39

Additional context

To my understanding, this repository is essentially providing a 1-click setup to get Supabase running on AWS. Incase the specific urls for my deployment are helpful, I have listed them below.

Amplify Studio URL: https://main.d2utrizos6o5a4.amplifyapp.com/ CloudFront URL: https://d1j57i0k9sfize.cloudfront.net/

r00t-us3r avatar Dec 25 '22 21:12 r00t-us3r

It seams that the force deployment for ECS Service Connect is not works well, also kong service can not find other services via hosts. (because it need CloudTrail enabled)

I am trying fix it, to change to use internal DNS instead of hosts.

mats16 avatar Dec 26 '22 15:12 mats16

It seams that the force deployment for ECS Service Connect is not works well, also kong service can not find other services via hosts. (because it need CloudTrail enabled)

I am trying fix it, to change to use internal DNS instead of hosts.

Sounds like a headache, is it because of something that recently changed on the AWS end?

Is there anyway to get a stack up and running now using perhaps an older version of the template?

I appreciate your replies during the festive period :)

r00t-us3r avatar Dec 26 '22 17:12 r00t-us3r

I released new version. Please try it.

If you have same issue using new version, please give me Kong container logs. You can see this logs at ECS console or CloudWatch Logs console.

mats16 avatar Dec 27 '22 03:12 mats16

The cause is an omission of consideration of the AWS account status, such as CloudTrail enabled.

mats16 avatar Dec 27 '22 03:12 mats16

I've tried this in Ireland and I get a different error when launching the stack.

I have gone through all sections of the AWS dashboard and removed all existing services relating to the stack before attempting the launch but the problem still persists.

Screen Shot 2022-12-27 at 15 04 47

Resource handler returned message: "Invalid request provided: CreateService error: SC service is already used by arn:aws:servicediscovery:eu-west-1:811985029972:namespace/ns-5vv5t5blurjhvnnf (Service: AmazonECS; Status Code: 400; Error Code: InvalidParameterException; Request ID: 2b6f474e-34e7-44cd-b30c-f35369359ff0; Proxy: null)" (RequestToken: 771661f2-034d-7681-1a09-acf94c4659ec, HandlerErrorCode: InvalidRequest)

I have gone through the same process in N. Virginia and the stack has launched successfully - The dashboard has launched successfull, ideally I'd be able to get this launched in Ireland but unsure on the above error.

r00t-us3r avatar Dec 27 '22 15:12 r00t-us3r

Just come across your problems, I am also seeing this issue in Ireland. I will try N Virginia now.

SteveChurch avatar Jan 28 '23 11:01 SteveChurch

image Same Ireland just auto deletes itself unless there is something I'm missing

gpalaci-carflow avatar Feb 15 '23 15:02 gpalaci-carflow

Doesn't work in N.Virginia either, are there certain variables that must be changed or set on the template script init, otherwise it rolls-back and deletes itself?

gpalaci-carflow avatar Feb 15 '23 20:02 gpalaci-carflow

Will try another region but this happens on Ireland(Stable and Latest) Update: Another region didn't fix the problem.

umuthopeyildirim avatar Jun 02 '23 18:06 umuthopeyildirim

Do you wish to deploy these changes (y/n)? y
Supabase: deploying... [1/1]
Supabase: creating CloudFormation changeset...
[████▉·····················································] (19/226)
9:45:45 PM | CREATE_FAILED        | AWS::Lambda::Function                         | Studio/Repository/ImportFunction
Resource handler returned message: "'MemorySize' value failed to satisfy constraint: Member must have value less than or equal to 3008 (Service: Lambda, Status Code: 400, Request ID: 3f0c0bd7-ef8c-49d4-92af-00da1e3ef0bb)" (RequestToken: 520bcdb1-c1f5-0373-fa10-edffa890cc44, HandlerErrorCode: InvalidRequest)
9:45:47 PM | ROLLBACK_IN_PROGRESS | AWS::CloudFormation::Stack                    | Supabase
The following resource(s) failed to create: [ClusterDefaultServiceDiscoveryNamespaceC336F9B4, SmtpGenPasswordProviderframeworkonEventServiceRoleDefaultPolicy2D91E6D6, StudioRepositoryImportFunctionF87C7D62, SmtpSendEmailPolicyCCA0AA9B, VPCPublicSubnet3DefaultRouteA0D29D46, CloudFrontPrefixList22014EFD, CdnCacheManagerQueue786D7FA2, CdnWebAclNestedStackWebAclN
estedStackResourceFDB876C0, DatabaseCluster5B53A178, JwtSecretGenerateTokenFunctionB37EE16F, VPCPublicSubnet1DefaultRoute91CEF279, VPCPublicSubnet2DefaultRouteB7481BBA]. Rollback requested by user.
9:45:47 PM | ROLLBACK_IN_PROGRESS | AWS::CloudFormation::Stack                    | Supabase
The following resource(s) failed to create: [ClusterDefaultServiceDiscoveryNamespaceC336F9B4, SmtpGenPasswordProviderframeworkonEventServiceRoleDefaultPolicy2D91E6D6, StudioRepositoryImportFunctionF87C7D62, SmtpSendEmailPolicyCCA0AA9B, VPCPublicSubnet3DefaultRouteA0D29D46, CloudFrontPrefixList22014EFD, CdnCacheManagerQueue786D7FA2, CdnWebAclNestedStackWebAclN
estedStackResourceFDB876C0, DatabaseCluster5B53A178, JwtSecretGenerateTokenFunctionB37EE16F, VPCPublicSubnet1DefaultRoute91CEF279, VPCPublicSubnet2DefaultRouteB7481BBA]. Rollback requested by user.
9:46:02 PM | DELETE_IN_PROGRESS   | AWS::RDS::DBCluster                           | Database/Cluster

I also tried launching a stack through terminal didn't work either.

umuthopeyildirim avatar Jun 02 '23 18:06 umuthopeyildirim

Nevermind it seems like they put artifical limit on my account and I need to increase it with AWS Support. I hope you have Technical support that can expatiate this request.
https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html

umuthopeyildirim avatar Jun 02 '23 19:06 umuthopeyildirim

@mats16 うまくいけないね

Resource handler returned message: "'MemorySize' value failed to satisfy constraint: Member must have value less than or equal to 3008 (Service: Lambda, Status Code: 400, Request ID: 80317eb7-c2f0-4ea8-ae8e-f5e8d2bd53ff)" (RequestToken: 1311acd8-06bf-ba0c-c6fa-ad778659644c, HandlerErrorCode: InvalidRequest)

Edit: I changed the max memory to 3008 and it worked.

Supabase.template.json

However, it NEEDS ecs to run.. (set everything to micro for lowest cost)

Also, am getting WSS errors for realtime...

y4my4my4m avatar Jan 14 '24 07:01 y4my4my4m

The WSS really doesn't work

The webpage at wss://XXXXXX.cloudfront.net/realtime/v1/websocket?apikey=XXXXXXX&vsn=1.0.0 might be temporarily down or it may have moved permanently to a new web address.
ERR_UNKNOWN_URL_SCHEME

y4my4my4m avatar Jan 14 '24 13:01 y4my4my4m