josephmachado / beginner_de_project

Beginner data engineering project - batch edition
https://www.startdataengineering.com/post/data-engineering-project-for-beginners-batch-edition/
MIT License
473 stars 142 forks source link

command `make infra-up` failed when creating resource "redshift_schema" "external_from_glue_data_catalog" #26

Open oktavianidewi opened 1 year ago

oktavianidewi commented 1 year ago

Hi @josephmachado when I run make infra-up , I got this error message:

│ Error: error waiting for EMR Cluster (j-626JY5011R9W) to create: unexpected state 'TERMINATED_WITH_ERRORS', wanted target 'RUNNING, WAITING'. last error: VALIDATION_ERROR: EMR service role arn:aws:iam::972206383570:role/EMR_DefaultRole is invalid
│ 
│   with aws_emr_cluster.sde_emr_cluster,
│   on main.tf line 110, in resource "aws_emr_cluster" "sde_emr_cluster":
│  110: resource "aws_emr_cluster" "sde_emr_cluster" {
│ 
╵
╷
│ Error: could not start transaction: dial tcp 18.141.109.61:5439: connect: connection timed out
│ 
│   with redshift_schema.external_from_glue_data_catalog,
│   on main.tf line 172, in resource "redshift_schema" "external_from_glue_data_catalog":
│  172: resource "redshift_schema" "external_from_glue_data_catalog" {
│ 
╵
make: *** [Makefile:45: infra-up] Error 1

in the AWS UI, I checked the EMR cluster has a terminated status.

Terminated with errorsEMR service role arn:aws:iam::972206383570:role/EMR_DefaultRole is invalid
s13tc2 commented 1 year ago

Hello @oktavianidewi,

Regarding the EMR issue, I didn't encounter that problem. However, I was able to resolve the Redshift issue by modifying the inbound rule for the VPC security group.

Link

xichen1995 commented 1 year ago

To resolve the EMR role issue, I was able to fix it by running aws emr create-default-roles

amanattrish commented 11 months ago

Hello,

@josephmachado I got one more error regarding - S3 bucket ACL, as well as EMR cluster

╷
│ Error: error creating S3 bucket ACL for sde-data-lake-20231202080234934600000003: AccessDenied: Access Denied
│       status code: 403, request id: 7CMWQSV3040WTZW5, host id: 7T9dQ4GJKLTH14Dj4C6LiMQYyduv2q/Fbkj5q+a+Rx80JyahzG3C+GH7EHROVYHxqpnfc0NAJMQ=
│ 
│   with aws_s3_bucket_acl.sde-data-lake-acl,
│   on main.tf line 27, in resource "aws_s3_bucket_acl" "sde-data-lake-acl":
│   27: resource "aws_s3_bucket_acl" "sde-data-lake-acl" {
│ 
╵
╷
│ Error: error waiting for EMR Cluster (j-VW7MNHX4PTZ1) to create: unexpected state 'TERMINATED_WITH_ERRORS', wanted target 'RUNNING, WAITING'. last error: VALIDATION_ERROR: EMR service role arn:aws:iam::669370607527:role/EMR_DefaultRole is invalid
│ 
│   with aws_emr_cluster.sde_emr_cluster,
│   on main.tf line 108, in resource "aws_emr_cluster" "sde_emr_cluster":
│  108: resource "aws_emr_cluster" "sde_emr_cluster" {
│ 
╵
╷
│ Error: could not start transaction: dial tcp 52.206.53.130:5439: connect: connection timed out
│ 
│   with redshift_schema.external_from_glue_data_catalog,
│   on main.tf line 170, in resource "redshift_schema" "external_from_glue_data_catalog":
│  170: resource "redshift_schema" "external_from_glue_data_catalog" {
│ 
╵
make: *** [Makefile:45: infra-up] Error 1

Any help?