localstack-pro-samples icon indicating copy to clipboard operation
localstack-pro-samples copied to clipboard

Permission Denied issue when creating an emr cluster

Open hereiskeith opened this issue 1 year ago • 1 comments

I have got my trials localstack pro license and I could start localstack without any issue.

When I was trying the happy path of running emr steps within an EMR cluster under localstack I saw that all of them failed right away. (No log got generated for the EMR steps). So I looked back to the logs of localstack container and found this line during the creation of an EMR cluster: Unable to start up EMR cluster: [Errno 13] Permission denied: '/var/lib/localstack/lib/hive/2.3.9/bin/schematool'

This is the simple script I ran to create the EMR cluster:

awslocal emr create-cluster \
 --name "test-emr" \
 --log-uri "s3://test-local/logs" \
 --release-label "emr-6.11.0" \
 --instance-groups '[{"InstanceCount":2,"InstanceGroupType":"CORE","Name":"keith-core","InstanceType":"c4.large","EbsConfiguration":{"EbsBlockDeviceConfigs":[{"VolumeSpecification":{"VolumeType":"gp2","SizeInGB":50},"VolumesPerInstance":1}],"EbsOptimized":true}},{"InstanceCount":1,"InstanceGroupType":"MASTER","Name":"test-master","InstanceType":"c4.large","EbsConfiguration":{"EbsBlockDeviceConfigs":[{"VolumeSpecification":{"VolumeType":"gp2","SizeInGB":32},"VolumesPerInstance":2}]}}]' \
 --applications Name=Spark \
 --scale-down-behavior "TERMINATE_AT_TASK_COMPLETION" \
 --ebs-root-volume-size "50" \
 --auto-termination-policy '{"IdleTimeout":10800}' \
 --region "us-east-2"

Can anyone suggest what could possibly go wrong? Thanks

hereiskeith avatar Aug 27 '24 16:08 hereiskeith

Hi @hereiskeith! Usually issues concerning LocalStack are created in localstack/localstack. But we can try to tackle this here as well. The issue you are describing looks like either something is off with the permissions.

  • How did you start LocalStack? Did you modify the permissions of LocalStack in any way?
  • Please explicitly pull the image you are using to make sure you are actually using the latest version of the Docker image (instead of a potentially outdated version on your machine).
  • Sometimes the on-demand download of the bigdata tools (for example hive) fails. We do provide a specific "bigdata" image which comes with all packages necessary for the bigdata services: localstack/localstack-pro:latest-bigdata
  • Could you try removing the localstack volume directory on your host machine? This removes the cache and restarts the on-demand download of these packages.

Please let us know if this helps :)

alexrashed avatar Aug 28 '24 06:08 alexrashed