This message was deleted.
# general
s
This message was deleted.
l
Looks like your app didn't start. It probably died, got restarted, re-died, ad infinitum. Probably not an infra / IaC error.
👍 1
Also, your session token expired during the 20m wait time 🙂
You'll need to check your app logs to learn more.
FYI, Slack has a nice "Text Snippet" widget you can use to paste larger code blocks. It collapses nicely, keeping the channels easier to browse. And as a bonus, it syntax-highlights when it can.
🙌 1
b
thanks @little-cartoon-10569 perhaps some issue with the container itself.
@little-cartoon-10569 Logs should be in cloudwatch correct? Not seeing them there or anywhere for that matter.
l
App logs are not automatically handled: you need to arrange for that. It would be good to send them to CloudWatch, or some other log aggregator. You can start the container locally to investigate the problem though. There should be no difference; so long as you're setting up a similar environment, you should be able to reproduce the behaviour. Obviously it won't keep restarting, since it's ECS that does that. But the stopping should be observable.
👍 1
b
The local container is fine. I'm coming across a 503 error. I attempted to change target group of load balancer to 8000 so that i can forward requests to the same port as the container app but now I'm unable to reach the load balancer. I'm thinking I may need to add a port mapping argument somewhere...
l
You might need a port mapping, yes. If you're setting a 503, does that mean that your LB is serving 443 but it's not finding anything at whatever port is associated with the TG your LB rules are directing the request to?
b
The LB is running on port 80. I tried a change to port mapping by replacing to the lb.default_target_group instead of container application port.
import pulumi
import pulumi_aws as aws
import pulumi_awsx as awsx
repository = awsx.ecr.Repository("repository")
image = awsx.ecr.Image("image",
repository_url=repository.url,
context="..",
platform='linux/x86_64',
)
cluster = aws.ecs.Cluster("cluster")
lb = <http://awsx.lb|awsx.lb>.ApplicationLoadBalancer("lb")
service = awsx.ecs.FargateService("service",
cluster=cluster.arn,
assign_public_ip=True,
desired_count=2,
platform_version="LATEST",
task_definition_args=awsx.ecs.FargateServiceTaskDefinitionArgs(
container=awsx.ecs.TaskDefinitionContainerDefinitionArgs(
name="chainlit",
image=image.image_uri,
port_mappings=[awsx.ecs.TaskDefinitionPortMappingArgs(
target_group=lb.default_target_group,
)],
cpu=2048,
memory=512,
essential=True,
),
log_group=awsx.ecs.TaskDefinitionLogConfigurationArgs(
log_driver="awslogs",
options={
"awslogs-group": "chainlit",
"awslogs-region": "us-east-1",
"awslogs-create-group": "true",
"awslogs-stream-prefix": "ecs",
}
)
))
pulumi.export("url", lb.load_balancer.dns_name)