full deploy succeeded finally! Now how do I start...
# software-contributors
c
full deploy succeeded finally! Now how do I start testing slack? Start ngrok and set my slack bot url to my ngrok url?
f
you’re running in gitpod ec2?
in gp dashbarod open port 4566 and copy url you can use that url instead of ngrok
c
oh awesome
💪 1
f
see localstack docs though
how to call url
because there are two apigw instance - one for core one for slack app
c
🤔 not sure I understand...
image.png
m
we have two separate apps right now. core and slackapp, slack app calls the core APIs.
slack talks to core through slack app and doesn’t directly communicate with core
so the endpoint slack interacts with will be in the slack app api gw
c
ok I tried reading up more on it but I am extremely lost not sure how to find the url of the lambda
is see
m
right but use the id from the get-rest-apis command you send
(i’ve never done this just trying to read the docs with you, hopefully @full-wall-37598 comes back)
c
Yes I did
So now whats the path to the slack app lamda
image.png
idk what the
/local
is, I copied that from the docs
m
in the codebase i am seeing /local urls for the lambda
CleanShot 2025-06-22 at 15.16.20@2x.jpg
so i think those are the suffixes
CleanShot 2025-06-22 at 15.16.48@2x.jpg
like the redirect lambda looks like its local/ynab/oauthRedirect
c
perfect. what does "ynab/oauthRedirect" come from? I think thats the last step I am missing
m
found it
🎉 1
CleanShot 2025-06-22 at 15.18.42@2x.jpg
c
oh nice
m
BUT
for your work, i don’t think we need this one sec
use the aws cli to hit localstack and see if you can find a secret named
/assistant/slack-respond-url
c
it would be
<https://4566--019798d2-c3ea-73c5-8b59-1e53e75c4f68.us01.gitpod.dev/_aws/execute-api/i86ba7wrky/local/assistant/slack-respond-url>
but ill wait for what you say
m
i think that secret will be a direct URL without api gateway
c
oh hmm let me see
m
CleanShot 2025-06-22 at 15.20.51@2x.jpg
yeah okay nevermind don’t hit it directly bc its clear to me this code is overriding it and stupidly just putting in localhost
go to the slack-admin.stack.ts
👍 1
you’ll see it creates a function URL
c
image.png
m
aws lambda get-function-url-config --function-name <your-function-name>
c
ok together with copilot we are getting somewhere
image.png
m
oh yeah for aws cli don’t try it without using an llm
c
now I may need to convert that url to something else
m
i don’t think so, if you hit that url from the remote machine and not the browser it should work fine
just curl it or something
i think it’ll work
c
oh yeah for aws cli don’t try it without using an llm
last time I use awscli with an llm I was reprimanded 🙂 But I wasnt scared this time because its awslocal 🙂
m
haha right using it with awslocal you have nothing to be afraid of
c
hmm
m
ask llm to make a get request to that url?
f
hey I’m here all good?
c
still not sure I got the proper url. getting this error:
Copy code
exception while calling lambda with unknown operation: Execution environment timed out during startup.
when I curl
<http://0emqmw58mpodvv4hdbxyxccv4b7xyfgc.lambda-url.us-east-1.localhost.localstack.cloud:4566/>
m
oh i see, the cdk code only allows post
f
that’s the error I’ve been getting in gitpod
m
oh 😞
try a post request
f
the issue I think is because gitpod is running docker in docker in docker and the networking get’s messed up a bit
c
posts failing too
f
dev container -> localstack -> services 3 docker layers
m
interesting, could be
f
but randomly works and in my last pr it was working in gitpod fine
c
hmm
m
at least everyone has the same error now
c
so you think I can access it through
<https://4566--019798d2-c3ea-73c5-8b59-1e53e75c4f68.us01.gitpod.dev/_aws/execute-api/i86ba7wrky/local>
?
f
another option @curved-bear-18232 There’s a localstack env var for overriding the lambda timeout (the cdk val isn’t used) Try setting that really high like 5 minutes and see what logs come out
that is the base route for that apigw yeah
c
at least everyone has the same error now
misery loves company
m
@full-wall-37598 i mean, if it isn’t working for you, should he waste time trying that out?
c
I saw that and I can try but docker doesnt show any logs to suggest that the lamda even started https://frumfinance.slack.com/archives/C06EKDAM3FE/p1750621250353519?thread_ts=1750618140.359539&amp;cid=C06EKDAM3FE
f
I think it could be just for some reason taking a long time to start and the lwa is causing issues
c
ok ill try, will I need to restart localstack for it to read the variable
f
yeah logs are a pain, you can really quickly do docker ps -a and then docker logs on the stopped container or run localstack with DEBUG=1
c
LAMBDA_RUNTIME_ENVIRONMENT_TIMEOUT
✅ 1
f
@mysterious-tomato-10057 I also tried setting it up as an ecs service but was having issues, however that would solve these problems. AI?
I kept getting integration failure, ecs needs very specific configs to work
c
f
the container works fine when deployed or when run standalone in docker, just on in localstack so it’s either networking or timeout
the base route of the core apigw is a health route
m
ecs is definitely not the solution here IMO
@curved-bear-18232 you can use awslocal to invoke the lambda
and not do it through https
f
still won’t work for the api lambda
m
i mean, it won’t go through api gateway, but it’ll still invoke the lambda
f
same error happens for api lambda
c
copilot tried that but
f
it’s the lambda not starting
m
but the lambda is starting in localstack, otherwise the integration tests would be failing
c
ok @full-wall-37598 ill increase the limit, what do I need to do? if I stop localstack do I need to rerun the full deploy?
f
it’s not @mysterious-tomato-10057, very randomly and not often
I tried fresh from main
but also here it’s 3 docker layers remember
that might be the problem
m
the integ test is green consistently
f
in my local it’s working ok actually I just tested
it’s the dindind
💪 1
so we need to configure localstack networking manually in gitpod probably
m
i am still on team test in alpha haha
f
the error I get is connection refused, which can mean that localstack’s custom lambda runtime interface can’t ping the webserver in the container, or that it is taking too long to start (or crashes silently)
one more possibility - wait a while after the deploy to see if it finishes loading - say 5 minutes before invoking the api
m
@curved-bear-18232 find any workaround?
c
Copy code
C:\Users\Admin\Downloads>curl -X POST "<https://4566--019798d2-c3ea-73c5-8b59-1e53e75c4f68.us01.gitpod.dev/_aws/execute-api/i86ba7wrky/local/user-profiles>"
Gateway Timeout
this command just waited like a bunch of seconds then timed out
@mysterious-tomato-10057 these have been tested and passing in github actions?
m
a bunch of them definitely work bc they are being hti by the slack app @refined-activity-71358 and they work
c
being hti by the slack app
this is with localstack or actual aws?
m
actual aws
i don’t test with localstack, zier does
i test with actual aws
c
gotcha. So whats your development workflow?
Copy code
- Edit Lambda
- Then what? (push to aws test env?)
m
just deploy-alpha
then i test
c
that doesnt sound so horrible. Do I have the proper credentials for that?
m
yes you do, you just need to make sure you don’t stomp on someone else testing something (like i ma testing somethign in alpha right now)
what error are you getting when you hit the lambda slack url
i think i see whats wrong
do that curl -X POST
tell me what you get
c
when you hit the lambda slack url
the one on aws or localstack?
m
localstack
m
that isn’t the right endpoint
c
Gateway Timeout
after like 30 or 45 secs
i think its one of the lamda endpoints
m
i’m asking about the lambda url for the slack admin lambda endpoint
now the api gateway
not*
the url you got from querying the api
c
sorry confused I thought apigw is a tool that connects a http request to a lambda func
m
it is, but there is also an http endpoint of the lambda itself without the apigw wrappper
c
and how does that work?
so hit that function url with a curl post please
or if you have redeployed query to get the updated endpoint
c
its the same url
as last time
posting it gets that timeout error
m
cool, so please hit it with a curl and show me the screenshot please
c
image.png
that screenshot is a bit messy ill share a clearner one in a sec
image.png
m
how long does it take to repsond?
c
im timeing it now
20 seconds
m
okay so we definitely have a networking issue, bc the lambda is broken and fails in under a second
lol
c
invoking it with awslocal also fales
m
so you should be seeing a 500 error instantly
but you aren’t haha
c
yes
m
kk i think running in alpha is your best bet if you can’t get things running locally without gitpod
no big deal
one sec i’ll give you the command to run
c
if you can’t get things running locally without gitpod
I cant get them running even with gitpod
m
haha
c
I can always just make a tiny webserver to call the handler() function... or I can run the lambda docker container locally
m
right but you can work in alpha without concern
i’ll give you the command to just deploy the slack admin stack
which i’m not working on so we won’t bump into each other
just deploy-alpha --stack-name "*Slack*"
so if you run that it will just deploy the slack stack into alpha
c
ok and I guess I can just work on my local devcontainer now and we can dump my gitpod in the trash?
m
i would keep using gitpod IMO bc i imagine @full-wall-37598 is going to get that fixed
since he uses it and likes it
but your deciison
decision
c
image.png
m
i fixed that bug on my PR actually, you just need to install aws cli v2
c
if I rebuild the devcontainer using latest master branch will it install automatically?
m
no
click that link you’ll get the comman
command
c
ogotcha
ok updated it (I hate aws docs btw)
image.png
is this a creds thing?
m
right lol okay i fixed this too, run
aws configure sso
actually just checkout my branch niebloom/codebuild-runner
you’ll get feedback as to the issue
i fixed this
i hope
c
yes or no
m
yes
c
ok ill be back when it finishes
m
when everything is deployed in alpha, this is your lambda
you can see the function url at the bottom right
when you send a post to it, you should get an INTERNAL SERVER ERROR
This is me running it
in the console when i pull the logs i see this
Copy code
[ERROR] Runtime.ImportModuleError: Unable to import module 'main': No module named 'pydantic'
Traceback (most recent call last):
so its clear the lambda is just broken which is why when you ping the url you get 500
c
the install deps doesnt seem to be working now
m
yeah i’m not loving gitpods i had the same issue
i found that just was in fact installed
so you can ignore hopefully
c
ok but the script failed and now other deps arent installed
m
like what
c
node
m
just install manually clearly gitpod needs to be fixed bc i had the same issue and had to install manually
sorry
@full-wall-37598 only recently put together the gitpod setup stuff and clearly it is a bit buggy
its been manual up until a week before you started
so we were trying out gitpod here
but clearly not working as we wanted
c
ok I tried running just install but it has error about no modulke named packaging
m
i had that also, just pip install that
then you’ll get one more error
then pip instal lthat
then it will work
c
ok but there are more deps like platformdirs, is there a requirements.txt anywhere
ahh ok
m
it will install all of them, just do the first couple then
just install
will take care of the rest
c
ok its running
💪 1
m
i had the same issue like an hour ago haha
luckily i hit it first
c
./install.sh: line 3: npm: command not found
m
right,, install npm
i feel like your error messages are pretty self explanatory
c
why didnt i need to do that last time?
m
bc it worked the first time
gitpod rebuilding failed for me too
c
i feel like your error messages are pretty self explanatory
yeah but im afraid to get a wrong version or something
right,, install npm
from apt?
m
i think i just told cursor to install npm
c
bc it worked the first time
yes so I am trying to copy all the commands from the automations.yaml but nothing there seems to be about node or npm node isnt either installed btw
m
i would imagine things are missing when the setup script failed
no surprise
c
yes but I am trying to run the commands the setup script runs
m
that isn’t what i did to get it working, i just fixed the errors the script was giving me as it gave them
c
ok working on it
m
you just need to be able to run just install
if that works things are good
if it fails, fix and iterate,
c
SSO Region
us-east-1?
m
anythign should work
i use us-east-1
c
do i want the slack alpha one?
m
no core alpha
c
wonderful
m
you are using core since this is really an admin endpoint and not a user facing endpoint
👍 1
c
for default client region I should put us-east-1
m
don’t froget to specify the stack you are trying to deploy when you deploy to alpha
c
--stack-name "*Slack*"
m
right 👍
your first deploy might take a bit of time bc you needd to build up a cache, but normally should be 2 min
c
ok
done
m
nice
so that is my workflow, i think its much easier
i use localstack for integration tests only really
i don’t build with it
zier likes to build with it
c
ok now I just need to navigate the aws dashboard to find the lambda
m
right
c
it says no applications
m
right its not an application, its a function
c
image.png
m
what region are you in
the function is in us-east-1
top tool bar
c
us-east-2 lol, not sure how I got there
m
😛
c
thanks
ok this right?
m
yup
c
and the function url is going to be the callback url responding to the slash command
?
m
you mean in slack?
c
yeah
m
the function url is just the url to hit the lambda handler, nothing with slack is setup at this time
and this lambda was thrown together by AI and doesn’t even work
but it gives you a starting point
but this lambda will somehow be invoked by slack, idk how yet, i didn’t develop that far yet
c
no problem. I mean will I configure slack to use that url for the slash command?
m
yeah i think so
c
oh oh ok so ill figure that out
m
but maybe you’ll have a better idea
you are asking great questions, they just don’t have definite answers yet
just ideas in my head
c
but when I POST that url, the function executes?
m
yup!
the monitor tab will show you that
you’ll see the failure show up ~70 seconds after you post to it
c
~70 seconds after
that sounds silly. Why so long? If I got an internal server error right away?
m
cloudwatch graphs aggregate a lot of data and are fairly complicated, they datapoints are not streaming they are processed in batches
the logs will show up live if you stream them
c
ok
Oh I see "live tail"
🎯 1
wonderful, now I can get to work
If I edit the lambda I can just run
just deploy-alpha --stack-name "*Slack*"
again?
m
okay my branch is working now so i am merging so you can go back to master now.
🎉 1
If I edit the lambda I can just run
just deploy-alpha --stack-name "*Slack*"
again?
Yup!
there is a flag we can setup to make lambda deployments faster called hotswap where it just uploads the code without doing the cdk deployment, and hotswaps just the runtime code out
but idk if just will pass the flag in, might need to configure that
--hotswap i think
it makes the deployment < 1 minute
instead of 2-3
c
ok. Ill worry about that later, because this is fast enough compared to the week and a half it took me to get nowhere lol
m
hahaha
sounds good
c
define optional 🙂
anyways, i submitted a bot request
thanks for approving it
m
👍